anki-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@anki-mcplist all my decks"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
anki-mcp
An MCP server that exposes your local Anki collection to MCP clients such as Claude Desktop and VS Code, through the AnkiConnect add-on.
Note fields are HTML and are passed through verbatim, so cards can be generated with cloze deletions, bold/italic, and highlight.js-styled code blocks.
Tools
Read
anki_check_connection— verify Anki is running and AnkiConnect is reachableanki_list_decks— every deck (::denotes nesting)anki_list_models— every note typeanki_get_model_fields— a note type's field names, in template orderanki_find_notes— note ids matching an Anki search queryanki_get_notes_info— full note details: model, tags, fields, cards
Write
anki_create_deck— create a deck, including missing parentsanki_add_note— add one note (fields are HTML, sent unescaped)anki_add_notes— add a batch sharing one deck and note typeanki_update_note_fields— overwrite fields of an existing noteanki_sync— sync the collection with AnkiWeb
Related MCP server: mcp-ankiconnect
Requirements
uv
Anki, running — the server talks to the live application, not the collection file
The AnkiConnect add-on: Anki → Tools → Add-ons → Get Add-ons → code
2055492159, then restart Anki
Setup
uv sync
cp .env.example .env.env (all optional — the defaults work for a standard local Anki):
ANKI_CONNECT_URL=http://localhost:8765
ANKI_TIMEOUT=30Run it:
uv run anki-mcpCheck it can reach Anki:
uv run python scripts/smoke_client.pyUse with Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"anki": {
"command": "uv",
"args": ["run", "--directory", "/absolute/path/to/anki-mcp", "anki-mcp"]
}
}
}No secrets to pass — AnkiConnect is unauthenticated and local.
Remote (HTTP) hosting
Set MCP_TRANSPORT=http to serve over streamable-http (endpoint /mcp):
MCP_TRANSPORT=http HOST=0.0.0.0 PORT=8000 uv run anki-mcpThis is of limited use here. AnkiConnect binds to localhost on the machine where Anki runs, so a remotely hosted instance of this server has nothing to connect to — every tool would fail. The transport toggle exists for structural parity with a normal MCP server; making it genuinely useful would need a tunnel back to the desktop (a WebSocket relay or similar), which is out of scope. Run it locally over stdio.
Conventions
Fields are HTML. Values in
fieldsare sent to Anki byte for byte — no escaping, no sanitizing."<b>x</b>"renders as a bold x; to show a literal<, send<.Cloze deletions use
{{c1::...}}and require a cloze note type; the syntax is inert on"Basic".Field names are case- and space-sensitive (
"Back Extra"). Check them withanki_get_model_fieldsbefore adding notes.Duplicates:
anki_add_notefails on a duplicate first field;anki_add_notesskips the offending note and reports its index. Both acceptallow_duplicate=True.anki_update_note_fieldssilently does nothing if the note is open in Anki's Browse window — Anki refuses the edit but reports success. Close the browser and retry.Tool output is Markdown by default; pass
response_format="json"for the raw payload (and for untruncated field HTML).Anki must stay open, and it stops serving requests while a modal dialog is up.
Development
uv sync --extra dev
uv run pytest # tests (HTTP mocked, no network, no real Anki)
uv run ruff check . # lint
uv run ruff check --fix .
uv run fastmcp inspect src/anki_mcp/server.py:mcpSecurity
AnkiConnect has no authentication: anything that can reach port 8765 can read and modify your collection. That is acceptable because it listens on localhost only — do not expose that port, and do not run this server on an untrusted machine. .env is gitignored, though it holds no secrets by default.
This server can create, overwrite, and sync notes. Back up your collection (Anki → File → Export) before letting an agent make bulk changes.
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-quality-maintenanceEnables AI assistants like Claude to interact with Anki flashcard decks through AnkiConnect. Supports creating and managing decks, basic and cloze deletion cards, searching existing cards, and organizing content with tags.
- Flicense-quality-maintenanceConnects Claude to Anki flashcard software via AnkiConnect, enabling users to review due cards, create flashcards, and manage spaced repetition learning through natural language conversations.
- Flicense-qualityDmaintenanceProvides programmatic access to Anki flashcard operations through the AnkiConnect API, allowing users to list and create decks and cards. It enables seamless management of flashcards directly from MCP-compatible clients like Claude Desktop.
- Alicense-qualityDmaintenanceEnables LLMs to interact with Anki via AnkiConnect for creating, searching, and managing flashcards, decks, and note types.1MIT
Related MCP Connectors
Search, read, and write your Apple Notes from ChatGPT/Claude via a local Mac agent + MCP relay.
Read and write your Fresh Jots notes from Claude, Cursor, and any MCP client.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/chadlis/anki-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server