AFFiNE MCP Server
Read, write and organise AFFiNE workspaces, docs, databases and comments from an MCP client
Study, create and manage Anki flashcards from an AI client through the AnkiConnect add-on
By AnkiMCP.ai TypeScript Local · stdio Productivity
65 popularity score ★ 547 ↓ 1.1k/wk
Opens the app, which asks before it adds the server.
claude mcp add anki -- npx -y @ankimcp/anki-mcp-server --stdio{
"mcpServers": {
"anki": {
"command": "npx",
"args": [
"-y",
"@ankimcp/anki-mcp-server",
"--stdio"
]
}
}
}{
"mcpServers": {
"anki": {
"command": "npx",
"args": [
"-y",
"@ankimcp/anki-mcp-server",
"--stdio"
]
}
}
}{
"servers": {
"anki": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@ankimcp/anki-mcp-server",
"--stdio"
]
}
}
}[mcp_servers.anki]
command = "npx"
args = ["-y", "@ankimcp/anki-mcp-server", "--stdio"]gemini mcp add --scope user anki npx -- -y @ankimcp/anki-mcp-server --stdioOpens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.
git clone https://github.com/ankimcp/anki-mcp-server.git
cd anki-mcp-server
npm install
npm run buildclaude mcp add anki -- node '<ABSOLUTE_PATH_TO_CLONE>/dist/main-stdio.js'{
"mcpServers": {
"anki": {
"command": "node",
"args": [
"<ABSOLUTE_PATH_TO_CLONE>/dist/main-stdio.js"
]
}
}
}{
"mcpServers": {
"anki": {
"command": "node",
"args": [
"<ABSOLUTE_PATH_TO_CLONE>/dist/main-stdio.js"
]
}
}
}{
"servers": {
"anki": {
"type": "stdio",
"command": "node",
"args": [
"<ABSOLUTE_PATH_TO_CLONE>/dist/main-stdio.js"
]
}
}
}[mcp_servers.anki]
command = "node"
args = ["<ABSOLUTE_PATH_TO_CLONE>/dist/main-stdio.js"]gemini mcp add --scope user anki node -- '<ABSOLUTE_PATH_TO_CLONE>/dist/main-stdio.js'ANKI_CONNECT_URL |
Optional: Address of AnkiConnect; http://localhost:8765 by default. |
|---|---|
ANKI_CONNECT_API_KEY |
Optional: Key, if AnkiConnect is configured to require one. |
ANKI_CONNECT_TIMEOUT |
Optional: AnkiConnect request timeout in ms; 5000 by default. |
READ_ONLY |
Optional: true or 1 blocks content changes and manual rescheduling; rating, suspend and sync still work. |
MEDIA_IMPORT_DIR |
Optional: Limit file-path media imports to this folder. |
MEDIA_ALLOWED_TYPES |
Optional: Extra MIME types allowed for file-path imports, comma-separated. |
MEDIA_ALLOWED_HOSTS |
Optional: Private network hosts allowed for URL imports, comma-separated. |
PORT |
Optional: HTTP mode port; 3000 by default. |
HOST |
Optional: HTTP mode bind address; 127.0.0.1 by default. |
ALLOWED_HOSTS |
Optional: HTTP mode: extra Host header values to accept when bound beyond loopback. |
TUNNEL_SERVER_URL |
Optional: Tunnel mode: WebSocket server; wss://tunnel.ankimcp.ai by default. |
LOG_LEVEL |
Optional: debug, info, warn or error; info by default. |
Anki MCP Server is a Node.js process that sits between an MCP client and a running copy of the Anki desktop app. It does not open the Anki collection file itself: every action goes as a request to the AnkiConnect add-on, which listens on http://localhost:8765 by default.
With it an assistant can run a review session (fetch due cards, show the front, record an Again/Hard/Good/Easy rating), add notes one at a time or up to 100 in one call, search notes with Anki's query syntax, edit fields, manage tags, decks and note types (fields, templates, CSS), store and fetch media, read deck and review statistics, and drive parts of the Anki window such as the card browser and the Add dialog.
It runs over stdio for desktop clients, as a local Streamable HTTP server (the default when no flag is given), or through a tunnel so a cloud-hosted assistant can reach the Anki on your machine. Its makers now point most users to their AnkiMCP add-on, which runs the server inside Anki; this npm package remains maintained and is the route for stdio clients and the Claude Desktop .mcpb bundle.
Beyond the 53 tools the README lists, version 0.27.0 also registers two MCP prompts (a review-session prompt and a twenty-rules prompt for writing cards) and a system-info resource (src/mcp/primitives/essential/index.ts). Its config schema also reads LOG_LEVEL (debug, info, warn or error; info by default) and a 5000 ms AnkiConnect timeout unless ANKI_CONNECT_TIMEOUT is set (src/config/config.schema.ts). The project is still pre-1.0 and its versioning note allows breaking changes in 0.x releases.
| Runtime | Node.js 22+ |
|---|
Node.js 22.12.0 or newer (npx comes with it). The Anki desktop app must be running with the AnkiConnect add-on installed; if AnkiConnect is set to require a key, pass it as ANKI_CONNECT_API_KEY. Tunnel mode needs a one-time browser sign-in (ankimcp --login) to the ankimcp.ai tunnel service; the --ngrok flag needs ngrok installed globally with an authtoken. Building from source needs git and npm.
Works only while Anki is open with AnkiConnect reachable. updateNoteFields fails silently if the note is open in Anki's browser window at the time, an AnkiConnect limitation its README names. createDeck accepts at most two levels (Parent::Child). Media imports by file path accept only image, audio and video types unless MEDIA_ALLOWED_TYPES adds more, and URL imports refuse private and loopback addresses unless MEDIA_ALLOWED_HOSTS lists them. Tunnel mode serves only the 2025 MCP protocol revision, so a client that speaks only 2026-07-28 must use stdio or HTTP. Without a TTY, --tunnel exits until you run --login first.
Suits Anki users who want an assistant to quiz them, write cards in bulk or tidy decks and note types, using a desktop client that starts servers over stdio (Claude Desktop, Cursor, Cline, Zed, opencode). It can change and delete collection content, so --read-only (READ_ONLY=true) is the safer start for exploring. If you only need HTTP or tunnel access for claude.ai or ChatGPT, its makers recommend their AnkiMCP add-on (github.com/ankimcp/anki-mcp-server-addon), which runs inside Anki and needs neither Node.js nor AnkiConnect.
syncget_due_cardsget_cardspresent_cardrate_cardforgetCardssetDueDateareSuspendedsuspendunsuspendlistDecksdeckStatscreateDeckchangeDeckaddNoteaddNotesfindNotesnotesInfoupdateNoteFieldsdeleteNotesgetTagsaddTagsremoveTagsreplaceTagsclearUnusedTagsgetMediaFilesNamesretrieveMediaFilestoreMediaFiledeleteMediaFilemodelNamesmodelFieldNamesmodelStylingmodelTemplatescreateModelupdateModelStylingupdateModelTemplatesaddModelFieldremoveModelFieldrenameModelFieldrepositionModelFieldcollection_statsreview_statsguiBrowseguiSelectCardguiSelectedNotesguiAddCardsguiEditNoteguiDeckOverviewguiDeckBrowserguiCurrentCardguiShowQuestionguiShowAnswerguiUndo