anki-mcp
Exposes Anki as a set of tools for LLM clients, enabling note creation, search, review, and deck management via AnkiConnect.
README
anki-mcp
MCP server that exposes Anki as tools for Claude and other LLM clients. Powered by AnkiConnect.
Create notes, search your collection, review due cards, manage decks, track retention — all from your LLM client.
Prerequisites
- Anki must be running on the local machine.
- AnkiConnect add-on must be installed: Anki → Tools → Add-ons → Get Add-ons → code
2055492159.- Default port:
8765. Do not change it.
- Default port:
- Node.js 18+.
Quick start
npm install
npm run build # tsc → dist/
npm start # stdio transport
Development (no build step):
npm run dev # tsx src/index.ts
Claude Desktop integration
Add to claude_desktop_config.json:
{
"mcpServers": {
"anki": {
"command": "node",
"args": ["/absolute/path/to/anki_mcp/dist/index.js"]
}
}
}
Available tools
| Tool | Description |
|---|---|
create_notes |
Create Basic or Cloze notes. Supports batch. |
search_notes |
Search with Anki browser syntax. Returns up to limit notes (default 50). Field search: Front:*keyword*. |
update_note |
Edit note fields in place by note ID. Preserves all card scheduling data. |
add_tags |
Add tags to notes by note ID. Supports :: hierarchy. |
remove_tags |
Remove tags from notes by note ID. |
delete_notes |
Delete notes by ID (also deletes associated cards). |
move_notes |
Move notes to another deck (resolves note IDs → card IDs internally). |
create_deck |
Create deck or subdeck (Parent::Child::Grandchild). |
list_decks |
List all decks with due/new/learn counts. |
get_due_cards |
Get cards due for review in a deck (default limit 20, max 100). Returns due field. |
submit_answer |
Record answer for a card: 1=Again, 2=Hard, 3=Good, 4=Easy. |
reschedule_cards |
Postpone cards by N days. days=0 = due today. |
suspend_cards |
Suspend (hide) or unsuspend cards. Never scheduled but not deleted. |
forget_cards |
Reset cards to new state. Wipes scheduling; preserves note content and tags. |
get_insights |
Retention stats, overdue count, mature/young cards for a deck or all decks. |
sync |
Trigger AnkiWeb sync. |
AnkiConnect conventions
- ID types: Note IDs and card IDs are different namespaces. Never pass note IDs where card IDs are expected.
- Deck names: Use
::for hierarchy. Double-quotes in deck names must be escaped (\"). - Search syntax: Anki browser syntax —
is:due,is:new,prop:due<0(overdue),deck:"Name",tag:foo,nid:123. - Error handling: All AnkiConnect failures throw
AnkiConnectError(action, message). MCP SDK surfaces these to the client as tool errors.
Architecture
src/
ankiconnect.ts — HTTP client, branded ID types, AnkiConnectError
tools/
notes.ts — create / search / update / delete / move notes + tag management
decks.ts — create / list / delete decks
study.ts — get due cards / submit answer / reschedule / suspend / forget
insights.ts — retention stats
index.ts — McpServer wiring (registerTool), stdio transport
Performance notes
search_notes: always pass a narrow query + explicitlimitto avoid large payloads.get_insightson large collections callscardsInfoin 500-card chunks sequentially; expect ~1s per 500 cards.get_insightswithout a deck argument fans outcardReviewsto every deck — adds one request per deck.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.