anki-mcp-server
Provides tools for managing an Anki flashcard collection through the AnkiConnect add-on: creating decks and subdecks, adding notes (skipping duplicates), importing TSV/CSV/plain-text files, searching notes and tags, editing fields and tags, moving notes between decks, renaming decks and profiles, and deleting notes or decks. Supports pronunciation audio generation into note fields and syncing the collection to AnkiWeb so changes reach AnkiDroid/AnkiMobile. All changes and deletions are two-step (preview then confirm) with automatic backups.
Used as the built-in text-to-speech engine for adding pronunciation audio to Anki notes, offering free Google Translate voices in 60+ languages and several English accents, stored as [sound:…] in the chosen note field. Requires internet and sends the spoken text to Google.
Click on "Deploy 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-mcp-serverCreate a deck Spanish::Verbs and add these 10 verbs with example sentences."
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-server
An MCP server that lets Claude (or any MCP client) work with your Anki flashcards. It can create decks, add notes, import TSV/CSV files, search, edit, move, rename and delete, add pronunciation audio, and sync to AnkiWeb so changes reach AnkiDroid / AnkiMobile.
"Create a deck Spanish::Verbs and add these 10 verbs with example sentences." "Import
~/Downloads/spanish.csvinto my Spanish deck. Do a dry run first." "Add Spanish pronunciation audio to the notes I added today, then sync." "Find every card taggedverbsthat has no example sentence." "Move all notes taggedgrammarinto Spanish::Grammar."
It works on macOS, Windows and Linux, with Anki Desktop and the free AnkiConnect add-on.
Quick start
1. Install Anki Desktop (once)
Download it from https://apps.ankiweb.net, install it, and open it once: its first window asks for a language and creates your profile.
macOS: open the
.dmgand drag Anki to Applications. With Homebrew:brew install --cask anki.Windows: run the installer (
anki-…-windows.exe).Linux: use the official package from the download page, or Flatpak:
flatpak install flathub net.ankiweb.Anki.
Anki 23.10 or newer is required. If Anki is missing, the installer below offers to install it with Homebrew/Flatpak, or opens the download page.
Phone: to get your cards on your phone, create a free AnkiWeb account, click Sync in Anki, and sign in to AnkiDroid (Android) or AnkiMobile (iPhone) with the same account.
2. Run the installer (one line)
macOS / Linux (Terminal):
curl -LsSf https://raw.githubusercontent.com/MeisamHakimi/anki-mcp-server/main/install.sh | shWindows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/MeisamHakimi/anki-mcp-server/main/install.ps1 | iex"The installer:
installs uv if it's missing. uv brings its own Python, so you don't need Python or git.
starts the setup wizard, which asks before every change:
checks that Anki is installed,
installs the AnkiConnect add-on from AnkiWeb (the same download Anki's Get Add-ons uses, verified before installing),
optionally installs the Anki MCP Bridge add-on (recommended if you use AwesomeTTS),
restarts Anki and checks the connection,
adds the server to Claude Desktop (backing up your config; an existing
ankientry is never replaced without asking) and to Claude Code if it's installed.
Add --dry-run to see what it would do without changing anything (… | sh -s -- --dry-run). To read the scripts first, see install.sh and install.ps1.
3. Restart Claude and try it
Quit Claude Desktop completely (⌘Q on Mac, File → Exit on Windows) and reopen it. Then say "Check my Anki status."
You don't need to open Anki first: if it isn't running, the server starts it in the background. Claude asks permission the first time it uses each tool.
Don't have Claude Desktop yet? Get it at https://claude.ai/download, then run the installer again.
Manual setup (if you prefer not to use the installer)
AnkiConnect: in Anki choose Tools → Add-ons → Get Add-ons…, enter
2055492159, click OK, then restart Anki.uv: run
curl -LsSf https://astral.sh/uv/install.sh | sh(macOS/Linux) orpowershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"(Windows). Then find the full path of uvx withwhich uvx(macOS/Linux) orwhere uvx(Windows).Claude Desktop: go to Settings → Developer → Edit Config, add the following inside the top-level
{ }, save, and fully restart Claude. Use the full uvx path: desktop apps often can't see your terminal's PATH."mcpServers": { "anki": { "command": "/Users/<you>/.local/bin/uvx", "args": ["--from", "anki-mcp-server @ https://github.com/MeisamHakimi/anki-mcp-server/archive/refs/heads/main.zip", "anki-mcp-server"] } }If
"mcpServers"already exists, add just the"anki": {…}part inside it.Claude Code:
claude mcp add anki --scope user -- uvx --from "anki-mcp-server @ https://github.com/MeisamHakimi/anki-mcp-server/archive/refs/heads/main.zip" anki-mcp-serverOther MCP clients: run the same
uvx …command (orpip installthe zip URL and runanki-mcp-server) as a stdio server.
macOS tip: if Anki responds slowly while it's in the background, run this once and restart Anki:
defaults write net.ankiweb.dtop NSAppSleepDisabled -bool trueUpdating
Run the installer again. It points Claude at the newest release; restart Claude afterwards.
Related MCP server: AnkiMCP Server
Pronunciation audio (text-to-speech)
Audio works out of the box:
"Add audio of the Word field into the Audio field for deck:"English" notes." "Add Spanish audio (lang es) of the Front field into the Back field for notes added today."
Built-in engine (default): free Google Translate voices in 60+ languages (
lang:en,es,fr,de,ja,zh-CN, …) and English accents (accent:comUS,co.uk,com.au,ca,co.in). No add-on or API key is needed. It needs internet, and the text being spoken is sent to Google.AwesomeTTS: if you use the AwesomeTTS add-on and install the bridge add-on (below), audio uses your AwesomeTTS voice and presets automatically.
Nothing is overwritten: only notes whose audio field is empty get audio. Use
dry_runto preview.
Audio is stored as [sound:…] in the field you choose. If your note type has no audio field, use an existing one (e.g. Back), or add a field in Anki via Tools → Manage Note Types → Fields.
Optional: the Anki MCP Bridge add-on
Everything works without it. The bridge adds three things AnkiConnect can't do:
Rename your Anki profile (e.g. "User 1" → your name)
Exact deck renames, which keep the deck description and allow capitalization-only changes. Without the bridge, renames move the cards to a newly named deck, which keeps the cards, review history and options.
Use your AwesomeTTS voice
Install: say yes when the installer offers it, or ask Claude "Install the Anki MCP bridge". Then restart Anki.
It listens on 127.0.0.1:8766 only, refuses requests from web browsers, and never returns AwesomeTTS settings or API keys. AwesomeTTS support relies on AwesomeTTS internals (tested with 1.89.4), so an AwesomeTTS update could break only that feature.
Safety
Your collection is personal data you've built over years, so this server is cautious by default:
Local connections only. It uses the stdio transport (no network listener) and only talks to Anki on
127.0.0.1; other URLs are rejected. The one exception is built-in TTS, which sends the spoken text to Google.Adding never overwrites. Notes are added with
allowDuplicate=false; duplicates are reported back as skipped.dry_runpreviews adds, imports and audio.Changes and deletions are two-step. A tool that edits, moves, renames or deletes first returns a preview and a
confirm_token, without changing anything. The change only runs when the tool is called again with that token. The token is rejected if the arguments differ, if the notes changed since the preview, or if the server restarted. The server tells the model to get your explicit approval first.Backups before every change go to
~/.anki-mcp-server/backups/: affected notes as JSON, and deleted decks as an.apkgwith review history (restore it via Anki → File → Import). AnkiConnect edits bypass Anki's undo, so these backups are your undo. Anki's own automatic backups (File → Switch Profile → Open Backup) are another safety net.Allowlisted actions. Only the AnkiConnect actions this server needs are used. Note-type, template and deck-option editing are never exposed.
Modes.
ANKI_MCP_READ_ONLY=1exposes only read tools.ANKI_MCP_ALLOW_DELETE=0hides the delete tools.Tool annotations. Every tool is marked read-only or destructive, so MCP clients can ask for confirmation appropriately.
Tools
Tool | Kind | What it does |
| read | AnkiConnect version, profile, decks, note types and their fields, available features |
| read | Anki search syntax → notes with fields, tags and decks |
| read | All tags |
| read | Opens Anki's Browse window filtered by a search |
| read | Available audio engines, languages and AwesomeTTS presets |
| add | Creates a deck ( |
| add | Adds notes; duplicates skipped; |
| add | Imports |
| add | Text-to-speech into empty audio fields (Google built-in or AwesomeTTS) |
| add | Syncs with AnkiWeb |
| change | Edits fields and tags (preview → confirm, backup) |
| change | Moves notes to another deck (preview → confirm, backup) |
| change | Renames a deck and its subdecks (preview → confirm) |
| change | Renames the Anki profile (preview → confirm; bridge) |
| change | Installs or updates the bridge add-on (preview → confirm) |
| delete | Deletes notes (preview → confirm, JSON backup) |
| delete | Deletes a deck and its cards (preview → confirm, |
Note types and field names
You can use friendly field names. Matching is case-insensitive, and a unique prefix works: "example" maps to a field called Example sentence. If you don't pass model, adds and imports use ANKI_DEFAULT_MODEL, else the note type most used in the target deck, else Anki's standard Basic (Front/Back).
Importing files
word meaning example
resilient able to recover quickly She is remarkably resilient.
GRAMMAR NOTE: present perfect have/has + past participle I have lived here for years."Import
~/vocab.txtintoEnglish::Vocabulary. Tag rows whose word starts withGRAMMAR NOTE:asgrammarand everything else asvocab."
This becomes:
{"path": "~/vocab.txt", "deck": "English::Vocabulary",
"tag_rules": [{"field": "Word", "starts_with": "GRAMMAR NOTE:", "tag": "grammar"}],
"default_tag": "vocab", "dry_run": true}Delimiter: tab, comma, semicolon or pipe, auto-detected. Tab-separated files are read literally; other delimiters follow CSV quoting rules. Files must be UTF-8.
Columns: taken from a header row if there is one (auto-detected when it matches field names), else from
columns, else in the note type's field order. Use""to skip a column and"tags"for a space-separated tags column.Anki exports: "Notes in Plain Text" exports work, including their
#separator:and#columns:lines.Tag rules: each rule needs
field,tag, and one ofstarts_with,containsorregex. They're case-insensitive unless you set"case_sensitive": true.
Configuration (optional)
Set these in the env block of your MCP config.
Variable | Default | Meaning |
|
| AnkiConnect address (must be localhost) |
| – | Set this if you configured |
|
| Bridge add-on address (must be localhost) |
|
| Start Anki if it isn't running |
| per OS | Custom command to start Anki, e.g. |
| per OS | Anki's data folder, used to install the bridge (Anki: Tools → Add-ons → View Files, one level up) |
|
| Where backups go |
| – | Default note type for adds/imports |
|
|
|
|
|
|
"anki": {
"command": "/Users/<you>/.local/bin/uvx",
"args": ["--from", "anki-mcp-server @ https://github.com/MeisamHakimi/anki-mcp-server/archive/refs/heads/main.zip", "anki-mcp-server"],
"env": { "ANKI_MCP_ALLOW_DELETE": "0" }
}Troubleshooting
Problem | Fix |
Claude doesn't list the anki tools | Fully quit and reopen Claude. Run the installer again (it fixes the config), or check that the config uses the full path to |
"Can't connect to AnkiConnect" | Run the installer again, or install AnkiConnect manually and restart Anki. To check, run |
"Anki isn't installed / couldn't be found" | Install Anki (step 1) and open it once. For a non-standard install, set |
"Started Anki, but AnkiConnect didn't answer" | Anki is waiting at the profile picker or a dialog; check its window. Otherwise AnkiConnect isn't installed. |
Slow or timing out on macOS | Run the App Nap command from Manual setup, then restart Anki. |
Audio fails | Built-in audio needs internet. If several requests fail, Google may be rate-limiting; try again later or with a smaller |
An edit shows | The note was open in Anki's editor or Browse window. Close it and retry. |
"needs the Anki MCP Bridge add-on" | Ask Claude to install the bridge, then restart Anki. |
Restoring something | Decks: import the |
Development
git clone https://github.com/MeisamHakimi/anki-mcp-server && cd anki-mcp-server
python -m venv .venv && .venv/bin/pip install -e ".[dev]"
.venv/bin/pytest # tests use fake AnkiConnect and bridge servers; Anki isn't needed
python scripts/build_addon.py # builds dist/anki_mcp_bridge.ankiaddon
.venv/bin/anki-mcp-server setup --dry-run # try the setup wizard without changing anything
npx @modelcontextprotocol/inspector .venv/bin/anki-mcp-server # try the tools interactivelyLicense
MIT. Not affiliated with Anki, AnkiConnect, AwesomeTTS or Google.
This server cannot be deployed
Maintenance
Related MCP Connectors
- TaprootOAuthcom.taproothq
Persistent memory layer for AI tools. Save and recall notes across Claude and other MCP clients.
- mcpOAuthai.butlerbrain
Persistent memory for AI assistants. Save once; recall from Claude, ChatGPT, or any MCP client.
Read, write, and conversationally review open-source flashcards through split read/write MCP tools.
Search, read, and write your Apple Notes from ChatGPT/Claude via a local Mac agent + MCP relay.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables 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.-
- FlicenseNot gradedqualityAmaintenanceExposes Anki flashcard collections to AI assistants via MCP, enabling AI-powered study sessions, card creation, deck management, and review workflows. Supports comprehensive collection operations including search, media management, and note type customization.81-
- AlicenseNot gradedqualityNot gradedmaintenanceConnects Claude to Anki flashcard software via AnkiConnect, enabling users to review due cards, create flashcards, and manage spaced repetition learning through natural language conversations.MIT
- FlicenseNot gradedqualityDmaintenanceProvides 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.-