Anki MCP
v0.1.2Manage local Anki notes, cards, decks, note types, media, and deck packages via AnkiConnect.
Values you need
| Variable | What it is | |
|---|---|---|
ANKI_URL | required | AnkiConnect base URL on your computer. Keep Anki Desktop open; omit /api/v1. Default: http://127.0.0.1:8765 |
ANKI_API_MODE | optional | Use v1 for the full tool set with compatible AnkiConnect, or legacy for older add-ons. Default: v1 |
ANKI_REQUEST_TIMEOUT_MS | optional | Request deadline in integer milliseconds, including queue wait: 1 to 300000. Default: 30000 |
ANKI_MEDIA_IMPORT_DIRS | optional | Optional trusted local media folders. Separate with : on macOS/Linux or ; on Windows. |
ANKI_PACKAGE_IMPORT_DIR | optional | Optional existing absolute folder for local .apkg imports. Requires API v1. |
ANKI_PACKAGE_EXPORT_DIR | optional | Optional existing absolute folder for local .apkg exports. Requires API v1. |
npm (npx) discovery passed
Requires Node.js 18+
Run in a terminal
claude mcp add anki-mcp -e ANKI_URL=http://127.0.0.1:8765 -- npx -y @ryhus/anki-mcp@0.1.2Add to
claude_desktop_config.json{
"mcpServers": {
"anki-mcp": {
"args": [
"-y",
"@ryhus/anki-mcp@0.1.2"
],
"command": "npx",
"env": {
"ANKI_URL": "http://127.0.0.1:8765"
}
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"anki-mcp": {
"args": [
"-y",
"@ryhus/anki-mcp@0.1.2"
],
"command": "npx",
"env": {
"ANKI_URL": "http://127.0.0.1:8765"
}
}
}
}Add to
.vscode/mcp.json{
"inputs": [
{
"description": "ANKI_URL",
"id": "anki-url",
"password": true,
"type": "promptString"
}
],
"servers": {
"anki-mcp": {
"args": [
"-y",
"@ryhus/anki-mcp@0.1.2"
],
"command": "npx",
"env": {
"ANKI_URL": "${input:anki-url}"
},
"type": "stdio"
}
}
}Add to
~/.codex/config.toml[mcp_servers.anki-mcp]
command = "npx"
args = ["-y", "@ryhus/anki-mcp@0.1.2"]
env = { "ANKI_URL" = "http://127.0.0.1:8765" }For AI agents
- Ask the user for: ANKI_URL. Never invent or guess these values; secrets go into the client config, not into chat logs.
- Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
- Restart or reload the client so it starts the server.
- Verify: the server should expose these tools: list-decks, create-deck, rename-deck, list-deck-presets, get-deck-preset, create-deck-preset, update-deck-preset, assign-deck-preset, ….
- If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.
Machine-readable: install.md · manifest.json