@lifeng688/anki-mcp
Allows managing Anki decks and notes via AnkiConnect, including adding, updating, searching notes, and deck management.
Click on "Install 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., "@@lifeng688/anki-mcplist all my decks"
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.
@lifeng688/anki-mcp
MCP stdio server for controlling local Anki via AnkiConnect. Enables LLMs (Claude, Cursor, Cline) to manage Anki decks and notes through a standardized tool interface.
v0.1.0 — Initial MVP release. Safety-first, read-heavy toolset with dryRun support for writes.
Quick Install
npm install @lifeng688/anki-mcpOr try it instantly:
npx @lifeng688/anki-mcpRelated MCP server: Anki MCP Server
Prerequisites
Anki desktop installed
AnkiConnect add-on (code
2055492159) — install via Tools → Add-ons → Get Add-onsNode.js >= 18.0.0
Verify AnkiConnect is running:
curl -X POST http://127.0.0.1:8765 \
-H "Content-Type: application/json" \
-d '{"action":"version","version":6}'
# Expected: {"result":6,"error":null}Core Features
Deck management — List and create decks (including hierarchical
::decks)Note operations — Add, search, update, and inspect notes
Batch operations — Add multiple notes with per-item result tracking
Safety first —
dryRunsupport for batch writes, duplicate prevention, field validationUnified responses — Consistent success/error envelope across all tools
Security-focused — Localhost only, no DB access, no card content logging
Available Tools
Tool | Description | Side Effects |
| Server health check | None |
| Verify AnkiConnect reachable | None |
| List all decks | None |
| Create a new deck | Creates deck |
| List note models | None |
| Get model fields | None |
| Add single note | Creates note |
| Batch add notes | Creates notes |
| Search notes | None |
| Get note details | None |
| Update note fields | Modifies note |
See Tool Schema Reference for full input/output specs.
MCP Client Configuration
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"anki": {
"command": "node",
"args": ["$(npm root)/@lifeng688/anki-mcp/dist/index.js"]
}
}
}With environment variables:
{
"mcpServers": {
"anki": {
"command": "node",
"args": ["$(npm root)/@lifeng688/anki-mcp/dist/index.js"],
"env": {
"ANKI_CONNECT_URL": "http://127.0.0.1:8765",
"ANKI_CONNECT_VERSION": "6",
"ANKI_DEFAULT_DECK": "Default::MCP",
"ANKI_DEFAULT_MODEL": "Basic",
"ANKI_LOG_LEVEL": "warn"
}
}
}
}Note: Replace
$(npm root)/@lifeng688/anki-mcp/dist/index.jswith the actual resolved path. You can find it with:npm root -g # or npm root
Cursor / Cline
Same JSON format — add to your MCP server configuration. Point args to the installed dist/index.js inside the @lifeng688/anki-mcp package directory.
Global Install
npm install -g @lifeng688/anki-mcpThen configure your client to point to:
<global-npm-root>/@lifeng688/anki-mcp/dist/index.jsEnvironment Variables
Variable | Default | Description |
| (none) | Full AnkiConnect HTTP endpoint (highest priority). Overrides HOST:PORT. |
|
| Host part, used when |
|
| Port part, used when |
|
| AnkiConnect API version |
| (empty) | AnkiConnect API key (if configured) |
|
| Default deck for note operations |
|
| Default note model |
|
| HTTP request timeout in milliseconds |
|
| Log verbosity: |
URL Resolution Priority:
ANKI_CONNECT_URL— if set, used as-is (must point to localhost)ANKI_CONNECT_HOST+ANKI_CONNECT_PORT— composed ashttp://{HOST}:{PORT}http://127.0.0.1:8765— hardcoded default
Security
This server only connects to
http://127.0.0.1:8765(localhost)It does not read/write Anki SQLite databases directly
It does not upload any data externally
ANKI_CONNECT_KEYis never loggedDangerous operations (delete, sync, import, export) are not in v0.1.0
First-Time Setup
Create a
Test::MCPdeck before making real changesRun
pingandcheck_anki_connectionto verify connectivityUse
add_noteswithdryRun: trueto preview before writingNever expose port 8765 to the network
Documentation
Installation & Configuration — Full setup guide
Tool Schema Reference — All tools: input/output/examples/errors
Roadmap — Feature progression plan (v0.1 → v0.6)
Security Guide — Boundaries, risks, safety policies
Conversation Quality Guide — How LLMs should create cards
Testing Guide — How to run the test suite
License
MIT — See LICENSE for details.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/guanweiqiang/anki-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server