An MCP server that gives Claude Code direct access to a running Anki instance. The goal is to automatically generate flashcards from study materials (PDFs, Markdown, notebooks) and sort them into Anki decks — without any manual copying or formatting.
The included /anki-erstellen skill orchestrates the entire workflow: reading files, deriving the deck structure, detecting duplicates, creating cards, and tracking already-processed files.
| Tool | Description |
|---|---|
anki_list_decks |
Lists all available Anki decks. |
anki_add_notes |
Adds one or more cards to a deck. Supports Markdown (bold, italic, tables, code, MathJax) and optional media attachments (image, audio, video). |
anki_get_deck_notes |
Returns all existing cards in a deck (including sub-decks) — used to avoid duplicates before creating new cards. |
anki_get_processed_files |
Returns the list of files in a directory that have already been converted to Anki cards. |
anki_mark_files_processed |
Marks files as processed so they are skipped in future runs. |
- Install and open Anki.
- In Anki: Tools → Add-ons → Get Add-ons → enter code
2055492159→ Install → restart Anki. - AnkiConnect then listens on
http://localhost:8765. Anki must be running whenever the MCP server is used.
Requires Python ≥ 3.13. Install dependencies:
uv syncclaude mcp add anki -- uv run --directory /path/to/anki-mcp python server.pyTo register it globally (available in all projects):
claude mcp add --scope user anki -- uv run --directory /path/to/anki-mcp python server.pyAdd the server to ~/.claude/settings.json (global) or .claude/settings.json (project-local):
{
"mcpServers": {
"anki": {
"command": "uv",
"args": ["run", "--directory", "/path/to/anki-mcp", "python", "server.py"]
}
}
}Adjust the path, then restart Claude Code. The anki_* tools will be available in every session.
The skill at .claude/commands/anki-erstellen.md guides Claude through the full workflow:
- Read all files in the current directory (skip already-processed ones)
- Derive the deck name from the directory path (
Bachelor::Semester 2::ModuleName) - Check existing cards to avoid duplicates
- Create cards organized in thematic sub-decks
- Mark processed files as done
- Print a summary report
Run it from your study directory:
/anki-erstellen
Or with an explicit deck name:
/anki-erstellen Master::Semester 1::Statistics::Distributions