Is the Anki MCP server safe? What it can reach
What the Anki MCP server can read, write and delete, how it signs in, and how to limit it in Claude Code and Codex.
Anki has no official MCP server. The most used one is AnkiMCP from the ankimcp.ai project, which runs locally and talks to the AnkiConnect add-on without a sign-in. It can add, edit and delete notes, media and note types in your collection. Start it with --read-only, and skip the ngrok option, which is unauthenticated.
Who maintains it
| Implementation | Kind | Status |
|---|---|---|
| @ankimcp/anki-mcp-server (community, ankimcp.ai) | Community | active |
| AnkiMCP addon (community, same project, runs inside Anki) | Community | active |
It runs as a local process on your machine.
How it signs in
No sign-in. The server calls AnkiConnect on your machine (http://localhost:8765 by default), with an optional ANKI_CONNECT_API_KEY if you set one in AnkiConnect. It acts on your whole local collection.
What its tools can do
| Kind | Tools |
|---|---|
| Read | get_due_cards, get_cards, present_card, areSuspended, listDecks, deckStats, findNotes, notesInfo, getTags, getMediaFilesNames, retrieveMediaFile, modelNames, modelFieldNames, modelStyling, modelTemplates, collection_stats, review_stats, guiBrowse, guiSelectCard, guiSelectedNotes, guiDeckOverview, guiDeckBrowser, guiCurrentCard, guiShowQuestion, guiShowAnswer |
| Write | sync, rate_card, setDueDate, suspend, unsuspend, createDeck, changeDeck, addNote, addNotes, updateNoteFields, addTags, removeTags, replaceTags, storeMediaFile, createModel, updateModelStyling, updateModelTemplates, addModelField, renameModelField, repositionModelField, guiAddCards, guiEditNote, guiUndo |
| Can’t be undone | deleteNotes, clearUnusedTags, deleteMediaFile, removeModelField, forgetCards |
The README counts 53 tools. The addon variant uses different snake_case tool names and lists extra tools, so check tools/list for that one.
Built-in limits
| Option | What it does |
|---|---|
--read-only (or READ_ONLY=true) | Blocks changes to notes, decks, tags, media and note types, plus forgetCards, setDueDate, guiUndo, guiAddCards and guiEditNote. rate_card, suspend, unsuspend and sync still work. |
ANKI_CONNECT_API_KEY | Passes the API key if you configured one in AnkiConnect. |
ALLOWED_HOSTS | Host header allowlist for HTTP mode. Loopback only by default, and needed only if you bind beyond localhost. |
MEDIA_ALLOWED_HOSTS | Private network hosts that URL imports may reach. Private and loopback addresses are blocked by default. |
The risks
- deleteNotes, deleteMediaFile, removeModelField and forgetCards destroy cards, files, fields and scheduling, so one injected instruction can wipe years of study data unless you keep an Anki backup.
- storeMediaFile accepts a local file path or a URL, so the agent can pull files from your disk into your collection, which AnkiWeb sync then uploads.
- sync pushes changes to AnkiWeb, so a bad edit spreads to your other devices, even in read-only mode.
- The --ngrok option exposes your collection at a public URL with no authentication, and the HTTP mode has no authentication of its own.
- Card text is untrusted content, so a shared deck can carry instructions the agent reads during a review.
Limit it in Claude Code
Add it from the documented launch settings, at local or user scope so a token never lands in a shared .mcp.json:
claude mcp add --env ANKI_CONNECT_URL=... anki -- npx -y @ankimcp/anki-mcp-server --stdioClaude Code names MCP tools mcp__anki__<tool>. Deny rules win over ask rules, and ask rules over allow rules. Put these in ~/.claude/settings.json or the project’s .claude/settings.json:
{
"permissions": {
"deny": [
"mcp__anki__deleteNotes",
"mcp__anki__clearUnusedTags",
"mcp__anki__deleteMediaFile",
"mcp__anki__removeModelField",
"mcp__anki__forgetCards"
],
"ask": [
"mcp__anki__updateNoteFields",
"mcp__anki__storeMediaFile",
"mcp__anki__createModel",
"mcp__anki__updateModelTemplates",
"mcp__anki__updateModelStyling",
"mcp__anki__setDueDate",
"mcp__anki__changeDeck",
"mcp__anki__replaceTags",
"mcp__anki__sync"
]
}
}Limit it in Codex
Codex reads MCP servers from ~/.codex/config.toml. disabled_tools removes tools, and enabled_tools keeps only the ones you list:
[mcp_servers.anki]
command = "npx"
args = ["-y", "@ankimcp/anki-mcp-server", "--stdio"]
env_vars = ["ANKI_CONNECT_URL"]
disabled_tools = ["deleteNotes", "clearUnusedTags", "deleteMediaFile", "removeModelField", "forgetCards"]Checklist
- Export a backup from Anki before you give an agent write access.
- Start with --read-only, then drop it only for a deck-building session.
- Use stdio, and do not use --ngrok.
- Review cards from shared decks before an agent reads them.
Checked against the vendor documentation on November 25, 2026. ankimcp/anki-mcp-server README · ankimcp/anki-mcp-server-addon README · AnkiConnect add-on
What Excellent covers
Excellent doesn’t inspect MCP servers themselves. Its free scan reads supported logs on the Mac (Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code) and reports findings for review, so you can see what an agent did after a session. Run the free scan · See a sample report · How to vet any MCP server
Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Pro is US-only for now. Agent coverage · Pricing