list_decksLABSCO SUMMARY
Ten cards on a topic, in the deck style you asked for.
The server asks about deck, style and card type before it creates anything and requires explicit confirmation before a delete, so a vague request does not quietly produce fifty wrong cards. Anki has to be open — everything routes through AnkiConnect, and nothing works while the app is closed.
What it is
A Python server that drives a running Anki through the AnkiConnect add-on. Fifteen tools across decks, cards, note types and media, plus built-in styling templates.
What you get
- Decks listed with total, new, due and learning counts, created — nested with :: — and deleted — list_decks, create_deck, delete_deck
- Cards created one at a time, in a batch, or on a custom note type with audio or image attached — create_card, create_card_batch, create_card_custom
- Anki's own query syntax for finding cards, then editing fields and tags or removing them — search_cards, update_card, delete_cards
- Custom note types with your own fields, CSS and HTML templates, updated later without recreating them — create_note_type, get_note_types, update_note_type_style, update_note_type_template
- Images and audio uploaded to Anki's media folder, and the collection synced with AnkiWeb — add_media, sync_anki
- Four built-in styles — default, duolingo, dark and code — plus custom CSS, checked for javascript: URLs, script tags and inline event handlers before it reaches Anki
Requirements
Anki 2.1.x or newer running in the background with the AnkiConnect add-on installed — add-on code 2055492159, and http://localhost:8765 should return AnkiConnect v.6. Python 3.9 or higher with the dependencies from requirements.txt, and your client pointed at anki_server.py.
Setup effort
Build from source — git clone https://github.com/dhkim0124/anki-mcp-server.git
USE CASES
Turning a topic into a deck
Create the deck, pick a style that suits the material, and generate the cards in one batch instead of one at a time.
Cleaning up cards you wrote badly
Search with Anki's own query syntax — by tag, text or deck — then edit the fields and tags on what comes back.
Making a deck look the way you want
Describe the styling in words and get CSS generated for it, then apply it to an existing note type without rebuilding the cards.
Adding images and audio to cards
Upload the media into Anki's own folder first, then attach it while creating the card on a custom note type.
15 tools
Listed in project docs. Your client may show a different list.
create_deckdelete_deckcreate_cardcreate_card_batchcreate_card_customsearch_cardsupdate_carddelete_cardscreate_note_typeget_note_typesupdate_note_type_styleupdate_note_type_templateadd_mediasync_ankiBEFORE YOU INSTALL
What to know first
Tools you get
15 tools named in the project's documentation.
Requires
- Python 3.9 or later
- Anki 2.1.x or later, open while you use it, with the AnkiConnect add-on installed (add-on code 2055492159)
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
git clone https://github.com/dhkim0124/anki-mcp-server.git
cd anki-mcp-server
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txtMCP Clients
Claude Desktop
Use the Python inside the venv you created, so the packages from requirements.txt are found: <YOUR_PATH_TO_ANKI_MCP_SERVER> is your clone's path (on Windows the interpreter is venv\Scripts\python.exe). Keep Anki open with AnkiConnect running.
{
"mcpServers": {
"anki-mcp": {
"command": "<YOUR_PATH_TO_ANKI_MCP_SERVER>/venv/bin/python",
"args": [
"<YOUR_PATH_TO_ANKI_MCP_SERVER>/anki_server.py"
]
}
}
}