MCP server for Anki via AnkiConnect — create, search, and manage flashcards directly from Claude Code or any MCP client.
- Card CRUD — create (bulk with duplicate detection), search, update, delete
- Deck management — list, create (supports
::hierarchy) - Archive & sync — export/import
.apkgfiles, trigger AnkiWeb sync - Progress analytics — deck maturity, Interest Heat Score (which topics you retain best), study streak
- Conversation extraction —
/anki extractscans a conversation for learnable moments and proposes cards - Daily progress script — cron-friendly report generator that reads Anki's SQLite directly
- Claude Code skill — interactive card creation via
/ankislash command
- Python 3.13+
- uv
- Anki desktop running
- AnkiConnect addon installed (addon code
2055492159) - Claude Code or any MCP client
git clone https://github.com/chaosisnotrandomitisrhythmic/anki-mcp.git
cd anki-mcp
uv syncAdd to your MCP config (~/.claude/settings.json, project .mcp.json, or Claude Desktop config):
{
"mcpServers": {
"anki": {
"command": "uv",
"args": ["--directory", "/path/to/anki-mcp", "run", "anki-mcp"]
}
}
}| Tool | Description |
|---|---|
add_notes |
Create flashcards (bulk, with duplicate detection) |
search_notes |
Find cards using Anki query syntax |
update_note |
Edit a card's fields or tags |
delete_notes |
Remove cards by ID |
list_decks |
All decks with card counts (new/learn/review) |
create_deck |
Create a deck (supports :: hierarchy) |
export_deck |
Export deck to .apkg (optionally archive + delete) |
import_deck |
Restore .apkg from archive |
sync |
Trigger AnkiWeb sync |
progress |
Learning report with Interest Heat Score |
health |
Check AnkiConnect connectivity |
All configuration is via environment variables with sensible defaults:
| Variable | Description | Default |
|---|---|---|
ANKI_MCP_ARCHIVE_DIR |
Directory for .apkg exports/imports |
~/.local/share/anki-mcp/archive |
ANKI_DB_PATH |
Path to Anki's collection.anki2 |
Platform-aware (macOS: ~/Library/Application Support/Anki2/User 1/collection.anki2, Linux: ~/.local/share/Anki2/User 1/collection.anki2) |
ANKI_MCP_OUTPUT_DIR |
Directory for daily progress reports | ~/Anki Progress |
A standalone script that reads Anki's SQLite database and generates a Markdown progress report. Works even when Anki is running (read-only via WAL mode).
# Run manually
cd /path/to/anki-mcp && uv run python scripts/daily_progress.py
# Cron example (daily at 7:03 AM)
3 7 * * * cd /path/to/anki-mcp && uv run python scripts/daily_progress.pyThe report includes deck overview, Interest Heat Score, and study streak.
The skills/SKILL.md file provides a Claude Code skill for interactive card creation. It supports:
/anki— manual card creation/anki extract— scan conversation for extractable knowledge and create cards/anki progress— show learning progress
- Remove the
ankientry frommcpServersin your MCP config - Optionally remove the skill:
rm -rf ~/.claude/skills/anki/ - Optionally delete the archive directory (
~/.local/share/anki-mcp/by default) - Remove the repo:
rm -rf /path/to/anki-mcp
Your Anki cards are stored in Anki itself — nothing is lost by removing this server.
See CONTRIBUTING.md.
See SECURITY.md.