mcp -anki
Model Context Protocol (MCP) server enabling AI assistants (Claude, GPT-4, Gemini, etc.) to interact with Anki flashcards through AnkiConnect.
claude mcp add --transport stdio here-tunan-mcp-server-anki node /path/to/mcp-server-anki/dist/index.js
How to use
This MCP server bridges Anki with AI tooling via the MCP protocol, enabling AI-assisted deck management, card creation, editing, searching, and analytics. It exposes a set of tools that interact with Anki through AnkiConnect, allowing MCP clients such as Claude Code, Cline, or Zed AI to query deck names, search cards, add or update notes, delete notes, and retrieve model information. The workflow typically involves running Anki with AnkiConnect enabled, starting this MCP server, and configuring your MCP client to connect to the server entry point (for example via a ready-made CLI or CLI-like configuration). Once connected, you can issue natural-language prompts that trigger the corresponding MCP tools (e.g., get_deck_names, search_cards, add_note) to perform actions inside Anki.
Available capabilities include:
- Deck management (get_deck_names, get_cards_in_deck, get_deck_stats)
- Card operations (search_cards, add_note, update_note, get_note_info, delete_notes)
- Model and field introspection (get_models, get_model_fields)
- Template management and data analytics related to learning progress The server is designed to work with Claude Code as a primary example, but the configuration is similar for other MCP-compatible tools. To integrate, configure the MCP client to point to the server (e.g., using an npx-based command or a client-specific configuration) and then issue tool calls via the MCP protocol. The included API documentation section in the README provides examples of how each tool should be invoked and what data is expected.
How to install
Prerequisites:
- Anki Desktop with AnkiConnect plugin installed and enabled
- Node.js 16 or higher
- MCP-compatible AI tool (e.g., Claude Code, Cline, Zed AI)
Install and run the MCP server locally:
-
Clone the repository git clone https://github.com/here-tunan/mcp-server-anki.git cd mcp-server-anki
-
Install dependencies npm install
-
Build (TypeScript to JavaScript) npm run build
-
Run the server (example path; adjust to your environment) node dist/index.js
If you want to use the server with Claude Code or another MCP client:
- You can also start it via npx (if published): claude mcp add anki -- npx mcp-server-anki
Configuration example for an MCP client (npx style):
{
"mcp": {
"servers": {
"anki": {
"command": "npx",
"args": ["mcp-server-anki"]
}
}
}
}
Additional notes
Tips and considerations:
- Ensure AnkiConnect is installed in Anki and that Anki is running when using the server.
- The MCP server relies on AnkiConnect to communicate with Anki Desktop; if you encounter connection errors, verify AnkiConnect is enabled and the port ( default 8765 ) is accessible.
- For production deployments, point the MCP client to a built dist/index.js via the appropriate command (e.g., node /path/to/dist/index.js) and consider packaging with your preferred environment manager.
- The tools expose deck, card, and model operations; when using add_note or update_note, provide the correct deckName, modelName, fields, and tags as described in the API documentation sections.
- If you need to customize note fields or create new note types, use get_models and get_model_fields to understand supported fields before crafting add_note requests.
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud