Anki MCP Server for Local Review and Creation
Connect to an MCP server to access a locally running Anki for seamless card review and creation.
npx -y @scorzeth/anki-mcp-serverOverview
Anki MCP Server is a small MCP (Model Context Protocol) server that connects a local Anki desktop instance to MCP-compatible clients. It leverages the Anki-Connect add-on (which exposes Anki over a local HTTP API) to provide MCP endpoints for listing cards, fetching due/new cards, creating new cards, and reporting answers. This lets tools that speak MCP (for example, Claude Desktop or other local agents) access and drive Anki review workflows without needing web APIs or remote sync.
The server is designed for local use: Anki must be running on the same machine with the Anki-Connect add-on installed and enabled. The MCP server itself runs as a process that communicates with clients over stdio (the MCP transport) and with Anki via Anki-Connect (default localhost:8765). This setup enables fast, private, offline-first card review and card creation flows for developers integrating Anki with local agents and automation.
Features
- Exposes Anki search URIs over MCP (deck current, due, new)
- Fetch N due or new cards for batched review
- Create new cards in the Default deck
- Mark cards as answered and supply ease (1-4)
- Built for local development and integration with MCP-capable clients (e.g., Claude Desktop)
- Includes tooling to run an MCP Inspector for debugging stdio traffic
Installation / Configuration
Prerequisites:
- Anki desktop installed and running
- Anki-Connect add-on installed and enabled (listens by default on http://localhost:8765)
Clone and install dependencies:
Build the server:
Run in development mode with auto-rebuild:
Run the inspector (helps debug stdio MCP messages):
# The script will print a URL to open the Inspector UI in your browser
Configure an MCP-capable client (example for Claude Desktop). Add the server executable path in the client config:
On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
Example config JSON:
Note: the “command” value should point to the built entry script or the wrapper you use to launch the Node process.
Available Resources
The server exposes several Anki-style URIs and resource patterns over MCP:
| Resource URI | Purpose |
|---|---|
| anki://search/deckcurrent | Returns all cards in the current deck (Anki search: deck:current) |
| anki://search/isdue | Returns review and learning cards currently waiting to be studied (is:due) |
| anki://search/isnew | Returns unseen/new cards (is:new) |
Use these URIs from any MCP-aware client to request card lists matching Anki search semantics.
Available Tools
The MCP server exposes a set of tools (MCP actions) to interact with cards:
update_cards
- Purpose: mark cards as answered and apply an ease (1 = Again, 4 = Easy)
- Input schema:
add_card
- Purpose: create a new note/card in the Default deck
- Input schema:
get_due_cards
- Purpose: return N cards currently due for review
- Input schema:
get_new_cards
- Purpose: return N new (unseen) cards
- Input schema:
Responses follow MCP conventions and return card objects with identifiers you can later pass to update_cards.
Use Cases
- Local review loop from an assistant: An MCP client requests get_due_cards(20), presents cards to the user, and calls update_cards with the chosen ease values as answers. This enables private, fast review without leaving the assistant UI.
- Quick card authoring: A note-taking workflow can call add_card to push new Q/A pairs into Anki directly from your editor or clipboard.
- Batch import + validation: Use get_new_cards or anki://search/isnew to fetch recently added notes, verify formatting or duplicates, then adjust or tag them via additional automations.
- Integration with automation scripts: Use get_due_cards in a scheduled script to export today’s review list, or to create summaries/statistics before a study session.
Source / Contributing
Source and issues: https://github.com/scorzeth/anki-mcp-server
If you plan to extend or debug the server, enable the MCP Inspector (npm run inspector) to view stdio MCP traffic in a browser — useful because MCP servers communicate over stdio rather than a network socket.