anki-mcp
Enables AI assistants to create and manage Anki cards through AnkiConnect, including decks, card creation, search, updates, deletion, and mobile sync.
README
anki-mcp
A thin Model Context Protocol (MCP) adapter that lets AI assistants (Claude Code, Hermes Agent, etc.) create and manage Anki cards directly — via AnkiConnect.
No custom AI app. The AI stays the intelligence layer; this server is just a bridge to Anki.
Claude Code / Hermes / ChatGPT
│ MCP (stdio)
▼
anki-mcp server
│ AnkiConnect HTTP (localhost:8765)
▼
Anki Desktop + AnkiConnect add-on
│ sync
▼
AnkiWeb ──► Anki mobile (iOS/Android)
Features
| Tool | Description |
|---|---|
list_decks |
List all decks with card counts |
create_deck |
Create a deck if it doesn't exist |
create_card |
Basic front/back card |
create_cloze |
Cloze deletion card ({{c1::...}}) |
create_cards |
Batch-create many cards at once |
search_cards |
Full-text search (Anki query syntax) |
update_card |
Update a card's front/back by note ID |
delete_card |
Delete a card by note ID |
Setup
1. Install Anki Desktop
Download and install from https://apps.ankiweb.net/. Start it once and sync with your AnkiWeb account so mobile sync works.
2. Install the AnkiConnect add-on
AnkiConnect exposes Anki over a local HTTP API on localhost:8765.
Option A — Anki add-on browser (easiest):
- In Anki: Tools → Add-ons → Get Add-ons…
- Enter the code
2055492159and install.
Option B — manual (Git):
cd "$APPDATA/Anki2/addons21" # Windows
# or: ~/.local/share/Anki2/addons21 (Linux)
# or: ~/Library/Application Support/Anki2/addons21 (macOS)
git clone --depth 1 https://github.com/FooSoft/anki-connect.git 2055492159
cd 2055492159
cp plugin/*.py plugin/*.json plugin/*.md .
rm -rf plugin tests .git 2>/dev/null
- Restart Anki. Verify it's up:
curl -s http://127.0.0.1:8765 -X POST -d '{"action":"version","version":6}'
# → {"result": 6, "error": null}
3. Run the MCP server
pip install mcp
python server.py
The server speaks MCP over stdio. Anki Desktop must be running (with AnkiConnect loaded) for tools to work.
Configure in a client
Hermes Agent
Add to ~/.hermes/config.yaml (or %USERPROFILE%\AppData\Local\hermes\config.yaml on Windows):
mcp_servers:
anki:
command: python
args:
- /absolute/path/to/server.py
timeout: 60
connect_timeout: 30
Then reload MCP in-session (/reload-mcp) or restart. Tools appear as mcp_anki_*.
Claude Code
claude mcp add anki -- python /absolute/path/to/server.py
Usage
Once wired up, just tell the AI what you want:
"Add a card to my System Design deck: front = 'Why does consistent hashing use virtual nodes?', back = 'To distribute keys more uniformly.'"
"Make Anki cards from the important concepts we just discussed."
Card-generation rules (put these in your AI instructions)
- One concept per card.
- Prefer questions that require recall.
- Avoid huge answers.
- Don't create cards for trivial facts.
- Use cloze cards where appropriate.
- Add source/topic tags.
Sync to mobile
MCP-created cards live in Anki Desktop until you sync. Trigger a sync:
- Manually: Anki → Sync (or press
Y), or - Via AnkiConnect:
curl -s http://127.0.0.1:8765 -X POST -d '{"action":"sync","version":6}'
Then sync the Anki mobile app to pull the new cards.
Requirements
- Python 3.10+
mcppackage (pip install mcp)- Anki Desktop (running)
- AnkiConnect add-on
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。