anki-mcp
Provides tools for managing Anki cards and notes, including listing decks, adding basic and cloze cards, finding and retrieving notes, updating fields and tags, deleting notes, and importing media.
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-mcpAdd a card to my Spanish deck: 'casa' means 'house'."
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
MCP server for headless Anki card management. Runs as a sidecar to a sync server (e.g. anki-sync) and writes directly to the same SQLite collection (collection.anki2) that the Anki Desktop client syncs.
LLM agents connect via the Model Context Protocol (streamable-http) and call one of 10 tools: list_decks, create_deck, delete_deck, add_card, add_cloze, find_notes, get_note, update_note, delete_note, add_media.
Built on top of AnswerDotAI/fastanki (vendored under src/fastanki/, version 3.0).
Prerequisites
Docker Engine 24+ with Compose v2 (
docker composeplugin)An existing Anki Desktop profile whose
collection.anki2you want to manage(Optional) an Anki sync server —
anki-mcpis designed to share its collection with one, but it can also run standalone
Related MCP server: Anki MCP Server
Quick start
git clone https://github.com/icem0/anki-mcp.git
cd anki-mcp
# 1. Configure secrets
cp .env.example .env
$EDITOR .env # set SYNC_USER1, SYNC_USER1_NAME and ANKI_MCP_TOKEN
# ANKI_MCP_TOKEN can be any random string >= 32 chars. Generate with:
# openssl rand -hex 32
# 2. Build and start
docker compose up -d --build
# 3. Verify the MCP endpoint responds (unauthenticated request returns 401;
# this is expected — only requests with the correct Bearer token succeed)
curl -s -o /dev/null -w '%{http_code}\n' -X POST http://localhost:8765/mcp
# → 401
# 4. With the token from .env:
TOKEN=$(grep ^ANKI_MCP_TOKEN .env | cut -d= -f2)
curl -s -X POST http://localhost:8765/mcp \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"smoke","version":"0"}}}'The first list_decks call will return what is currently in collection.anki2 at the path pointed to by FASTANKI_DIR.
Repo layout
anki-mcp/
├── server.py # FastMCP server, 10 tools
├── src/fastanki/ # vendored fastanki 3.0 (added to sys.path at startup)
├── Dockerfile # python:3.12-slim + requirements
├── compose.yaml # 2-service stack: anki-sync + mcp, shared collection volume
├── requirements.txt
├── pyproject.toml # fastanki metadata
├── .env.example
├── docs/
│ ├── env.md # complete env-var reference
│ ├── architecture.md # how the two services share one collection
│ └── deployment.md # standard docker compose workflow
└── .gitignoreMCP tools
Tool | Args | Returns |
| — |
|
| deck name (use |
|
| deck name |
|
| deck name, | note id |
| cloze text with | note id |
| all optional, AND-joined |
|
| note id |
|
| id + mutators |
|
| note id |
|
| absolute file path, optional rename | stored filename |
Environment variables
See docs/env.md for the complete reference. Three values are secrets, all defined in .env.
Architecture
See docs/architecture.md for how anki-sync and anki-mcp share one SQLite collection via a Docker named volume and the FASTANKI_DIR environment variable.
Deployment
See docs/deployment.md for the standard docker compose workflow (build, start, update, inspect).
License
Apache-2.0 (inherited from upstream fastanki).
This server cannot be deployed
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
A Model Context Protocol server for Wix AI tools
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
Related MCP Servers
- AlicenseAqualityBmaintenanceA Model Context Protocol server that enables LLMs to interact with Anki flashcard software through AnkiConnect, allowing for creation and management of flashcards, decks, and note types.1675252MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that allows LLMs to interact with Anki flashcard software, enabling functions like creating decks, adding notes, searching cards, and managing flashcard content through natural language.751MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables interaction with Anki flashcards through AnkiConnect, providing organized tools for managing decks, notes, cards, models, and media files.407MIT
- AlicenseCqualityBmaintenanceServer that enables programmatic interaction with Anki through the Model Context Protocol, allowing users to manage flashcards, decks, and review processes.31139MIT