Anki MCP Server
A lightweight MCP server that gives Claude (Desktop and Code) direct access to your Anki flashcards via AnkiConnect.
Ask Claude to create flashcards, search your collection, manage decks — all through natural conversation.
Setup
1. Install Anki
Download from apps.ankiweb.net.
2. Install AnkiConnect add-on
In Anki: Tools → Add-ons → Get Add-ons... → paste code 2055492159 → restart Anki.
> Anki must be running whenever you want Claude to use these tools.
3. Paste to Claude
Copy the block below and paste it to Claude (Desktop or Code). It will handle the rest — installing dependencies, cloning the repo, and configuring the MCP server.```
Set up the anki-mcp-server MCP server for me. Here's what to do:
-
Check if
uvis installed by runninguv --version. If not installed, install it:
- macOS/Linux:curl -LsSf https://astral.sh/uv/install.sh | sh
- Windows:powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" -
Ask me where I'd like to clone the repo (e.g. ~/Development, ~/Projects, ~/.local/share, etc.).
Then clone it there:
git clone https://github.com/andrew-roci/anki-mcp-server.git <chosen-directory>/anki-mcp-server
(If the directory already exists, skip this step.) -
Configure this MCP server:
For Claude Code — run:
claude mcp add -s user anki -- uv --directory ~/Development/anki-mcp-server run anki_mcp_server.py
For Claude Desktop — add to the config file
(macOS: ~/Library/Application Support/Claude/claude_desktop_config.json,
Windows: %APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"anki": {
"command": "uv",
"args": ["--directory", "/ABSOLUTE/PATH/TO/anki-mcp-server", "run", "anki_mcp_server.py"]
}
}
}
Replace /ABSOLUTE/PATH/TO/anki-mcp-server with the actual absolute path to the cloned repo.
- Verify the setup works by listing my Anki decks.
```
Usage examples
Once set up, just ask Claude naturally:
- "Create a flashcard: front 'What is spaced repetition?' back 'A learning technique that reviews material at increasing intervals'"
- "Make 10 flashcards from this article about photosynthesis"
- "Search my Anki for cards tagged 'spanish'"
- "What decks do I have?"
- "Add this diagram to my Anki media and create a card using it"
How it works
The server is a single Python file (anki_mcp_server.py) that:
- Exposes tools via the Model Context Protocol
- Translates tool calls into AnkiConnect API requests to
localhost:8765 - Returns results back to Claude
Dependencies (mcp, httpx) are managed by uv in an isolated virtual environment — nothing is installed globally.
License
MIT
