Minimal Model Context Protocol (MCP) server for adding flashcards to Anki via AnkiConnect. Anki needs to be running in the background for the MCP server to work.
- Add notes (flashcards) to Anki decks using MCP tools directly from your LLM chat interface
- Designed for integration with Claude Desktop and other MCP clients
It only uses two AnkiConnect endpoints: adding notes and listing decks. There are many more we could expose as tools.
- Python 3.12+
- AnkiConnect Add-on installed and enabled in your Anki desktop app
- MCP Python library
-
Install AnkiConnect
- Open Anki desktop
- Go to Tools > Add-ons > Get Add-ons...
- Paste the AnkiConnect add-on id and install
- Restart Anki
-
Install dependencies
pip install mcp[cli]>=1.13.0
or setup the project using uv
uv sync
-
Start the MCP server
python anki_mcp
In Claude Desktop you can register your own MCP server following this documentation. After registration, the tools should be visible in the UI. Make sure Anki is running for the MCP server to work as the AnkiConnect add-on spins up a local server with a simple HTTP API.
- Based on AnkiConnect