anki-mcp
Allows AI assistants to manage Anki collections including decks, note types, notes, cards, tags, and media via the AnkiConnect add-on.
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-mcpadd a note to my Spanish vocabulary deck"
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 lets AI assistants (Claude Code, Claude Desktop, and other MCP clients) manage your Anki collection — decks, note types, notes, cards, tags and media — through the AnkiConnect add-on.
It is a thin, local wrapper: each MCP tool maps to one or more AnkiConnect
actions over http://127.0.0.1:8765. Nothing leaves your machine and no
telemetry is collected — requests are proxied straight to your local Anki.
Unofficial project. Not affiliated with, endorsed by, or sponsored by Anki / AnkiWeb. "Anki" is a trademark of its respective owner. AnkiConnect is a separate third-party add-on. See Prior art for similar tools.
Prerequisites (one-time)
Install Anki Desktop — https://apps.ankiweb.net
Install the AnkiConnect add-on: Anki → Tools → Add-ons → Get Add-ons… → paste code
2055492159→ OK → restart Anki.Keep Anki Desktop running whenever you use the tools.
AnkiConnect only talks to Anki Desktop. To get cards onto your phone, use the
synctool (or Anki's own sync) and pull them in AnkiDroid via AnkiWeb.
Related MCP server: AnkiMCP Server
Install
Requires Python 3.10+.
git clone https://github.com/kazim4uk/anki-mcp.git
cd anki-mcp
python -m venv .venvInstall into the venv:
# Windows (PowerShell)
.venv\Scripts\python.exe -m pip install -e .
# macOS / Linux
.venv/bin/python -m pip install -e .Smoke test (optional, verifies the connection)
With Anki running:
# Windows
.venv\Scripts\python.exe scripts\smoke_test.py
# macOS / Linux
.venv/bin/python scripts/smoke_test.pyExpected: AnkiConnect version: 6 and a list of your decks. With Anki closed
you'll get a friendly "cannot reach AnkiConnect" message — that confirms the
error handling works.
Register the server
Use the absolute path to the venv's console script (installed as
anki-mcp). It works from any working directory.
Windows:
<repo>\.venv\Scripts\anki-mcp.exemacOS / Linux:
<repo>/.venv/bin/anki-mcp
Claude Code
claude mcp add anki -s user -- "/absolute/path/to/anki-mcp/.venv/bin/anki-mcp"Claude Desktop
Add to your claude_desktop_config.json
(%APPDATA%\Claude\ on Windows, ~/Library/Application Support/Claude/ on
macOS), then restart Claude Desktop:
{
"mcpServers": {
"anki": {
"command": "/absolute/path/to/anki-mcp/.venv/bin/anki-mcp"
}
}
}On Windows use the .exe and escaped backslashes, e.g.
"C:\\path\\to\\anki-mcp\\.venv\\Scripts\\anki-mcp.exe".
Tools
Tool | What it does |
| Health check — is AnkiConnect reachable? |
| List all deck names |
| Create a deck ( |
| Delete a deck (optionally keep its cards) |
| Review stats for given decks |
| List note type (model) names |
| Field names of a note type |
| Add one note |
| Add many notes at once |
| Search notes → IDs + field data |
| Edit fields of an existing note |
| Delete notes (and their cards) |
| List all tags |
| Tag / untag notes |
| Search cards → IDs + card info |
| Suspend / unsuspend cards |
| Add image/audio to the media folder |
| Count of today's reviews |
| Sync with AnkiWeb |
Search syntax
find_notes / find_cards use Anki's native
search syntax, e.g.:
deck:Defaulttag:new -is:suspendeddeck:"My Deck" front:*hello*
Configuration
Environment variables (see .env.example) — all optional:
Variable | Default | Purpose |
|
| AnkiConnect endpoint |
| (none) | Only if you set an |
|
| Request timeout (seconds) |
Troubleshooting
"Cannot reach AnkiConnect" — Anki Desktop isn't running, or the add-on isn't installed. Start Anki; verify
2055492159is under Tools → Add-ons.Tool calls hang / time out — Anki is showing a modal dialog (e.g. a sync prompt). Dismiss it in Anki.
duplicateerror onadd_note— passallow_duplicate=true, or change a field so the first field is unique.
Prior art
Several other open-source Anki MCP servers exist — worth a look if you want different trade-offs (TypeScript, read-only, extra features): ankimcp/anki-mcp-server, nailuoGG/anki-mcp-server, CamdenClark/anki-mcp-server.
Credits
Built on AnkiConnect and the Model Context Protocol.
License
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/kazim4uk/anki-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server