anki-mcp
Provides tools for safe, review-first Anki authoring, including deck and note management, note type creation/modification, card suspension, media import, and preview of real Anki rendering.
Click on "Deploy 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., "@anki-mcp add a note to my Japanese deck with front 'hello' and back 'こんにちは'"
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.
anki-mcp
MCP server for safe, review-first Anki authoring built on official Anki concepts: profile, deck, note type, note, card, tag, and media.
It is designed for agents that need to inspect existing Anki structure, create or revise note types, add notes, preview the real Anki rendering, and only then release cards into study.
The package was renamed from anki-mcps to @yama662607/anki-mcp. The CLI command is now anki-mcp.
Why this exists
avoid custom abstractions on top of Anki's own data model
keep note creation review-first by suspending new cards until they are accepted
let agents learn from existing decks and note types before writing new content
keep note type changes additive-safe and validate them before apply
Related MCP server: Anki MCP Server
Features
deck and note discovery for example-driven authoring
additive-safe note type authoring with
dryRun=trueby defaultlightweight note type linting with structured
errorsandwarningsbefore applydirect note creation with
modelName,deckName,fields, andtagsreview-first isolation by suspending new cards until the user keeps them
optimistic conflict detection for
update_notebatch add/delete note operations with stable per-item outcomes
local media import for audio and image fields
frozen v1 contract resource at
anki://contracts/v1/tools
Requirements
Node.js 22+
Anki with AnkiConnect enabled
optional: the
anki-connect-extensionadd-on for read-only native preview instead of edit-dialog fallback
Quick start
Install
@yama662607/anki-mcpfrom npm.Start Anki with AnkiConnect enabled.
Add the MCP server to your client.
Ask the agent to run
get_runtime_statusfirst.Use the review-first flow:
add_note->open_note_preview->update_noteorset_note_cards_suspended(false).
For a first-time setup guide, see 5-minute quick start.
Dependency model
AnkiConnectis required for real Anki usageanki-connect-extensionis optional and provides a read-only native preview pathwithout the extension,
open_note_previewfalls back to opening the edit dialogin
ANKI_GATEWAY_MODE=memory, neither dependency is required because the server is running in test mode
Installation
From npm
npm install -g @yama662607/anki-mcpFrom source
npm install
npm run buildRunning
As a local command
anki-mcpFrom source
npm run devMCP client setup
Codex
Official Codex setup is codex mcp add or ~/.codex/config.toml.
Add the server with the CLI:
codex mcp add anki-mcp \
--env ANKI_CONNECT_URL=http://127.0.0.1:8765 \
--env ANKI_ACTIVE_PROFILE=default \
-- anki-mcpEquivalent ~/.codex/config.toml entry:
[mcp_servers.anki-mcp]
command = "anki-mcp"
[mcp_servers.anki-mcp.env]
ANKI_ACTIVE_PROFILE = "default"
ANKI_CONNECT_URL = "http://127.0.0.1:8765"Claude-style clients
Some MCP clients use mcpServers JSON instead.
{
"mcpServers": {
"anki-mcp": {
"command": "anki-mcp",
"env": {
"ANKI_CONNECT_URL": "http://127.0.0.1:8765",
"ANKI_ACTIVE_PROFILE": "default"
}
}
}
}Environment
ANKI_CONNECT_URLdefault:http://127.0.0.1:8765ANKI_ACTIVE_PROFILEoptional fallback for read toolsANKI_MCP_DB_PATHdefault: user state directory (~/Library/Application Support/anki-mcp/anki-mcp.sqliteon macOS,%LOCALAPPDATA%\anki-mcp\anki-mcp.sqliteon Windows,$XDG_STATE_HOME/anki-mcp/anki-mcp.sqliteor~/.local/state/anki-mcp/anki-mcp.sqliteon Linux)ANKI_GATEWAY_MODE=memoryfor deterministic local tests without Anki
ANKI_MCP_DB_PATH is the internal SQLite path used for idempotency and operational metadata. DRAFT_DB_PATH is still accepted as a backward-compatible fallback.
Core workflow
Verify setup with
get_runtime_status.Discover existing structure with
list_decks,list_note_types,get_note_type_schema,search_notes, andget_notes.Create missing decks with
ensure_deck.Create or revise note types with
upsert_note_type(dryRun=true)and inspectresult.validation.Add review-pending content with
add_noteoradd_notes_batch.Inspect the real Anki rendering with
open_note_preview(the extension path uses a read-only native previewer, not a live editor dialog).After user feedback, call
update_note,delete_note, orset_note_cards_suspended(suspended=false).
Media workflow
import_media_assetInsert returned
asset.fieldValueinto the target note fieldadd_noteorupdate_noteopen_note_preview
Main docs
License
MIT
Available Tools
16 toolsadd_noteAdd NoteB
Create a review-pending note directly from deck, note type, fields, and tags.
Inputs: fields (required), deckName (required), modelName (required), profileId (required), +3 more.
add_notes_batchAdd Notes BatchA
Create multiple review-pending notes with stable per-item outcomes.
Inputs: items (required), profileId (required).
delete_noteDelete NoteADestructive
Delete a note directly by note ID. Idempotent when already missing.
Inputs: noteId (required), profileId (required).
delete_notes_batchDelete Notes BatchBDestructive
Delete multiple notes with stable per-item outcomes.
Inputs: items (required), profileId (required).
ensure_deckEnsure DeckA
Create a deck if missing. Safe and idempotent.
Inputs: deckName (required), profileId (required).
get_notesGet NotesARead-only
Read concrete note fields and metadata by note ID.
Inputs: noteIds (required), profileId.
get_note_type_schemaGet Note Type SchemaARead-only
Inspect fields, templates, CSS, and field bindings for one note type.
Inputs: modelName (required), profileId.
get_runtime_statusGet Runtime StatusARead-only
Report whether AnkiConnect is reachable and whether preview can use the optional extension path.
Inputs: profileId.
import_media_assetImport Media AssetA
Import a local audio or image file into Anki media and return an Anki-ready field value.
Inputs: localPath (required), profileId (required), mediaKind, preferredFilename.
list_decksList DecksARead-only
List available Anki decks using official hierarchical deck names.
Inputs: profileId.
list_note_typesList Note TypesBRead-only
Return available Anki note types with field and template summaries.
Inputs: profileId.
open_note_previewOpen Note PreviewARead-only
Open the existing note in Anki Browser preview for human review.
Inputs: noteId (required), profileId.
search_notesSearch NotesARead-only
Search existing notes by Anki query, note type, deck, or tag filters.
Inputs: tags, limit, query, deckNames, +2 more.
set_note_cards_suspendedSet Note Cards SuspendedB
Suspend or unsuspend all cards generated from one note.
Inputs: noteId (required), profileId (required), suspended (required).
update_noteUpdate NoteA
Update note fields or tags with optimistic mod-timestamp conflict detection.
Inputs: noteId (required), profileId (required), expectedModTimestamp (required), tags, +1 more.
upsert_note_typeUpsert Note TypeA
Dry-run by default. Create or update a note type with additive-safe constraints.
Inputs: fields (required), modelName (required), profileId (required), templates (required), +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool targets a distinct resource and action. The batch variants (add_notes_batch, delete_notes_batch) are clearly differentiated from their singular counterparts by name and description, and get_note_type_schema vs list_note_types are distinct in detail level.
All tool names follow a consistent snake_case verb_noun pattern (e.g., list_decks, ensure_deck, add_note, delete_notes_batch). The use of 'batch' suffix is uniform and predictable.
At 16 tools, the count is slightly above the typical 3-15 range, but each tool covers a meaningful aspect of Anki management (decks, note types, notes, media, runtime). The batch operations and preview tool add breadth without feeling redundant.
The tool surface provides robust CRUD for notes (add/get/update/delete/batch/suspend) and reasonable coverage for note types (list/get/upsert). Missing operations like deck deletion or note type deletion are minor gaps that can be worked around, but do not severely hinder typical Anki workflows.
Maintenance
Related MCP Connectors
Spaced-repetition flashcards in Markdown: create cards, manage decks and study with FSRS.
Search, read, and safely update Markdown notes in your connected Phasoric knowledge vaults.
Read, write, and conversationally review open-source flashcards through split read/write MCP tools.
Make Anki flashcards from lecture PDFs, slides, notes and YouTube videos, each with its source page.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Anki desktop flashcard app through the AnkiConnect plugin. Provides tools to manipulate notes and make arbitrary RPC requests to manage flashcards and decks.17 npm-
- AlicenseNot gradedqualityDmaintenanceEnables interaction with the Anki desktop flashcard application through the Anki-Connect plugin. Supports managing decks, cards, notes, and models, allowing AI assistants to create and query flashcards through natural language.10 npm1ISC
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to interact with Anki via AnkiConnect for creating, searching, and managing flashcards, decks, and note types.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to interact with Anki flashcard collections, including deck management, note search, viewing contents, and editing fields.17 npmMIT