Anki MCP
Anki MCP connects AI assistants to a local Anki collection through AnkiConnect, enabling natural-language flashcard management, study, analytics, and GUI automation.
Flashcards: Create, batch-create/import, search, inspect, update, delete, tag/untag notes, and clear empty cards.
Study sessions: Find due cards, record answers, check status, suspend/unsuspend, forget, and relearn cards.
Decks: List/create/delete decks, get stats/config, set per-deck limits, assign presets, and move cards.
Analytics: Read deck/collection stats, daily reviews, review history, card details, and today’s reviews.
Note types/models: List/create models, add/remove/rename fields, add/remove templates, and update CSS.
Utilities: Sync with AnkiWeb, check version/profiles, import/export .apkg, and list/store/retrieve/delete media.
Media access: Read media files such as images or audio for model analysis.
GUI control: Open Anki windows/dialogs, run on-screen reviews, answer/grade cards, browse/select notes, undo, check database, import files, and exit Anki.
Extras: Read-only MCP resources and a
writing_good_flashcardsprompt.
Provides full access to Anki flashcards through AnkiConnect, enabling deck management, card operations, note management, and statistics retrieval. Allows creating, updating, and organizing flashcards, running quizzes, and analyzing study performance.
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 quiz me on 10 random cards from my biology deck"
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
Transform your Anki flashcard experience with AI! This MCP (Model Context Protocol) server bridges your Anki flashcard collection with AI assistants like Claude, enabling natural conversations about your study materials.
🚀 What Can You Do?
Imagine having an AI tutor that knows your entire flashcard collection and can:
📚 Interactive Learning
"Quiz me on Japanese vocabulary I haven't seen in 3 days"
"Test me on challenging cards from my medical deck"
"Show me cards I've been struggling with recently"
✨ Smart Content Creation
"Create flashcards about photosynthesis with diagrams"
"Turn this PDF chapter into spaced repetition cards"
"Generate cloze deletion cards from my lecture notes"
🔍 Powerful Analytics
"Which topics am I struggling with most?"
"Show me my study patterns for the last month"
"What's my retention rate for different card types?"
🎯 Bulk Operations
"Tag all my chemistry cards with 'exam-prep'"
"Move cards with low retention to an intensive review deck"
"Find and fix duplicate cards across my decks"
Related MCP server: Anki MCP Server
🎯 Features
🎯 Smart Tool Design: Intuitive, high-level tools designed specifically for AI agents
💬 Natural Conversations: Talk to Claude about your flashcards like you would a study buddy
⚡ Lightning Fast: Efficient operations that don't bog down your AI assistant
📦 Bulk Operations: Update thousands of cards at once with simple commands
📊 Study Insights: Deep analytics on your learning progress and patterns
🎨 Rich Media: Full support for images, audio, and other media in your cards
🔍 Powerful Search: Leverage Anki's advanced search syntax through natural language
🔒 Rock Solid: Fully typed TypeScript with comprehensive error handling
🛠 Technical Stack
Node.js: Runtime environment (20+ required)
TypeScript: Type safety and developer experience
MCP SDK: Model Context Protocol implementation
yanki-connect: 🙏 Fully-typed, isomorphic AnkiConnect API client
tsup: Fast TypeScript bundler
PNPM: Efficient package manager
Special thanks to the yanki-connect library for providing the robust AnkiConnect interface that powers this integration!
📋 Prerequisites
1. Install Anki and Node.js
Download and install Anki if you haven't already, plus Node.js 20 or newer.
2. Install AnkiConnect Plugin
Open Anki
Go to Tools → Add-ons
Click Get Add-ons...
Enter code:
2055492159Restart Anki
📋 Version Requirements: This server requires AnkiConnect version 25.2.25.0 or newer (released 2025-02-25) for full compatibility. Most features work with older versions, but we recommend updating for the best experience.
3. Configure AnkiConnect (Optional)
AnkiConnect works out of the box, but you can customize settings:
Go to Tools → Add-ons
Select AnkiConnect and click Config
Default settings should work fine for most users
🚀 Quick Start
Option 1: Use with Claude Desktop (Recommended)
Configure Claude Desktop
Edit your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:%APPDATA%\Claude\claude_desktop_config.jsonAdd this configuration (
npxdownloads and runs the latest release):{ "mcpServers": { "anki": { "command": "npx", "args": ["-y", "@arielbk/anki-mcp"] } } }Or install globally if you prefer a fixed version on your machine:
npm install -g @arielbk/anki-mcpand use
"command": "anki-mcp"with"args": []in the config above.Restart Claude Desktop
Start using it!
Make sure Anki is running with AnkiConnect enabled
Ask Claude: "Show me my Anki decks" or "Quiz me with 5 cards"
💡 Pro Tip: You can test your setup by asking Claude simple questions like "How many Anki decks do I have?" or "What's in my largest deck?"
Use with Claude Code
claude mcp add --scope user anki -- npx -y @arielbk/anki-mcpThe tools only appear in a newly started Claude Code session; /clear is not enough. Run /mcp to check that anki is connected.
Option 2: Development Setup
Clone the repository
git clone https://github.com/arielbk/anki-mcp.git cd anki-mcpInstall dependencies
pnpm installBuild the project
pnpm buildTest the server
# Use the MCP inspector to test functionality pnpm inspect
Option 3: Use with Other MCP Clients
This server works with any MCP-compatible client. You can also use it with:
MCP Inspector: Interactive debugging tool
Cline: VS Code extension for AI coding
Custom MCP clients: Build your own using the MCP SDK
For stdio transport, run:
node dist/index.jsFor localhost HTTP (Streamable HTTP) transport, run:
node dist/index.js --http --host=127.0.0.1 --port=3000
# The MCP endpoint will be at http://127.0.0.1:3000/mcpClients that support Streamable HTTP can connect directly. Legacy SSE clients may still work via client-side fallback.
HTTP mode is stateless: every POST /mcp is answered by a fresh server instance, no Mcp-Session-Id is issued, and GET/DELETE /mcp (2025 session operations) return 405 Method Not Allowed.
Protocol versions. Both transports serve the stateless 2026-07-28 revision (server/discover plus the per-request _meta envelope) and the 2025-era revisions via the initialize handshake (2025-11-25, 2025-06-18, 2025-03-26 and 2024-11-05), so existing clients keep working unchanged.
When bound to a loopback address (the default), the HTTP server rejects requests whose Host header is not localhost, 127.0.0.1 or [::1], and requests carrying a browser Origin header from another host (DNS rebinding protection). Clients that send no Origin header, such as desktop and CLI MCP clients, are unaffected. If you bind to another interface, set ALLOWED_HOSTS to a comma-separated list of hostnames to keep the Host check.
Option 4: Container
The repository includes a Dockerfile. It works with any OCI-compatible container tool, such as Podman or Rancher Desktop with the docker/nerdctl CLI:
podman build -t anki-mcp .
podman run -i --rm anki-mcpAnkiConnect must be reachable from inside the container for tool calls to work. Listing tools and resources works without it.
🎮 Usage Examples
Once configured with Claude Desktop, you can have natural conversations like:
📖 Study Sessions
You: "I have a Japanese exam tomorrow. Can you quiz me on Hiragana cards I haven't reviewed in a week?"
Claude: I'll find your Hiragana cards that need review and start a quiz session...📝 Content Creation
You: "Create flashcards for the major battles of World War II with dates and significance"
Claude: I'll create comprehensive flashcards covering the key WWII battles...📊 Study Analytics
You: "How am I doing with my medical terminology deck? Show me my weak areas."
Claude: Let me analyze your performance on the medical terminology deck...🏷️ Organization
You: "Tag all cards about cardiovascular system with 'cardiology' and move them to my MCAT prep deck"
Claude: I'll help you organize those cards...🔧 Available Tools
The server provides 8 high-level tools. Each takes an operation parameter, so a handful of tools covers the whole AnkiConnect API:
📝 Manage Flashcards (manage_flashcards)
Create, update, delete, and search your flashcards. Perfect for content creation, bulk updates, and organization.
Batch creation (create_batch)
Defaults: top-level
deckName,modelNameandtagsapply to every note. A note's owndeckName/modelNameoverride the defaults; itstagsare added to the default tags.Chunking: notes are sent one chunk at a time (
chunkSize, default 10, max 50) with a short pause between chunks, so large imports don't overload Anki.Per-note results: every note is reported as
#n "first 40 chars of the first field"with its new note ID or the reason it failed (duplicate in the collection or earlier in the same batch, unknown note type, wrong field names, empty first field, ...). Field names match case-insensitively (frontworks forFront).Partial failure: if Anki stops responding partway, the batch stops and reports which notes were saved, which chunk may or may not have been saved, and which notes to resend.
Duplicates:
allowDuplicate: trueallows notes whose first field already exists;duplicateScope: "deck"checks for duplicates only in the target deck (default: whole collection).Dry run:
dryRun: truevalidates every note (note type, field names, duplicates) without writing anything.
Import from a file
Instead of notes, pass filePath (an absolute path or ~/...; relative paths are rejected because the server's working directory is usually not your project) to a .json, .csv or .tsv file. An agent can draft cards to a file for you to review, then import them in one call without sending every card through the conversation.
JSON: an array of notes, same shape as
notes:[{ "fields": { "Front": "...", "Back": "..." }, "tags": ["x"] }]CSV / TSV: the header row holds the field names. Optional
tags(space-separated),deckandmodelcolumns set those per row. Quoted fields may contain commas, tabs, newlines and""for a literal quote. Anki text-export header lines (#separator:,#html:,#columns:,#deck:,#notetype:,#tags:) are understood;#columns:replaces the header row.
Front,Back,tags
"What does <code>Array.prototype.map</code> return?",A new array,js arrays
Capital of France,Paris,geography{
"operation": "create_batch",
"filePath": "/Users/me/cards.csv",
"deckName": "Interview prep",
"modelName": "Basic",
"dryRun": true
}Searching (find)
find takes any Anki search query and returns compact results: the total match count, the next offset, and one line per note. Use include to choose what each note carries (fields, tags, deck, model, cards, state). The default is ["fields"], with HTML stripped and each field cut to maxFieldChars (default 120). state adds each card's queue (new, learning, review, relearning, suspended or buried), interval, due date, reps, lapses and ease. includeDetails: true still works and means all of these.
{ "operation": "find", "query": "rated:2:1", "include": ["tags", "state"] }For counts, use groupBy (tag, deck, model or state). It covers every match, not just one page:
{ "operation": "find", "query": "deck:\"Interview prep\"", "groupBy": "tag" }166 notes, 166 cards (126 new, 40 seen) match "deck:\"Interview prep\""; 27 tag groups
infra: 96 notes, 96 cards, 56 new, 40 seen
postgres: 44 notes, 44 cards, 4 new, 40 seen
...Listings are capped at about 20k characters. Past that you get the notes that fit, the total, and a hint to narrow the query. format: "json" returns single-line JSON instead. Handy queries: rated:2:1 (answered Again in the last 2 days), is:new, is:due, prop:ivl>=21 (mature), prop:lapses>=3, deck:"Name", tag:name.
🎯 Study Sessions (study_session)
Run interactive quiz sessions, manage card scheduling, and track which cards need review.
suspend, unsuspend, forget and relearn take cardIds or a query (Anki search syntax). With a query, the server finds the cards itself, so pausing a whole deck is one call however many cards it has. dryRun: true returns the match count without changing anything:
{ "operation": "suspend", "query": "deck:\"Hrvatski\"", "dryRun": true }The same query / dryRun options work for manage_decks move_cards (which also reports the source decks) and manage_flashcards add_tags / remove_tags. Other operations reject dryRun rather than ignore it.
📚 Manage Decks (manage_decks)
Create and organize decks, move cards around, and configure deck settings.
rename takes deckName and newName. AnkiConnect has no rename, so the server creates the new deck (and subdecks), gives each the old deck's options preset, moves the cards (scheduling is kept) and deletes the old decks once they are empty. It refuses to merge into an existing deck that has cards. Anki's "studied today" counters start fresh for the new deck.
delete reports how many cards each deck held (a filtered deck's cards go back to their home decks, and are reported that way). Pass requireEmpty: true to refuse if any of the decks still has cards that would be deleted.
get_stats takes deckName or deckNames (an array) and returns one line per deck with the total card count and today's new, learning and review due counts. Unknown deck names are reported, not created.
Per-deck daily limits
Decks usually share an options preset (e.g. "Default"), so changing it changes every deck that uses it. To give one deck its own limits, use create with newPerDay / reviewsPerDay, or set_limits on an existing deck:
{ "operation": "set_limits", "deckName": "Interview prep", "newPerDay": 15 }If the deck uses a shared preset, it is cloned into a new preset named after the deck, assigned to that deck only, and then changed. Other decks are not affected.
Options and display order
get_config returns a readable summary of the deck's preset: which other decks share it, daily limits, learning/relearning steps, leech handling, sibling burying, maximum interval, FSRS desired retention, and the display order with named values. Pass raw: true for the full preset JSON (FSRS parameters included).
set_display_order changes the order cards are shown in, with the same shared-preset safety as set_limits (it reports each change as old → new and whether a preset was cloned). Give deckName plus any of:
Parameter | Values |
|
|
|
|
|
|
|
|
|
|
{ "operation": "set_display_order", "deckName": "Interview prep", "newGatherOrder": "random_notes" }Anki uses the display order of the deck you click to study, not its subdecks'.
📊 Get Analytics (get_analytics)
Study statistics aggregated by the server into compact JSON or one line per row (never Anki's HTML stats page). deckName includes subdecks; where it is optional, omitting it covers the whole collection.
Scope | Parameters | Returns |
|
| Counts (new/learning/review/suspended, seen vs unseen), the preset's new/day and reviews/day limits, the date the unseen cards run out at the new/day limit, reviews, correct % and retention over the window, top tags by Again count |
|
| Studied today, card counts (new/learning/young/mature/suspended), correct % by card type over 30 days, due forecast (overdue split out), what Anki shows today per deck after limits, average/longest interval |
|
|
|
|
| Cards answered Again in the window grouped by tag, and the worst cards (front text, again count, lapses) |
|
| Anki's deck counts |
| – | Reviews today |
|
| Raw review log, one line per review; a summary with narrowing hints when over |
|
| Ease factor and interval per card |
{ "scope": "deck_overview", "deckName": "Interview prep" }For the failing cards themselves, use manage_flashcards find with Anki search syntax, e.g. rated:2:1 (answered Again in the last two days).
🎨 Manage Models (manage_models)
Customize note types, add fields, modify templates, and style your cards. list shows each note type's field names, so agents don't have to guess Front/Back.
🔧 Anki Operations (anki_operations)
Handle sync, media files, imports/exports, and other utility operations.
🖼️ Get Media File (get_media_file)
Retrieve media files (images, audio, etc.) from your Anki collection. AI assistants can analyze images directly (though they won't display in the UI).
🖥️ Anki GUI (anki_gui)
Drive the Anki desktop app: open the Card Browser with a search, open pre-filled Add Cards or Edit dialogs, start a deck review and answer cards on screen, or read the current card and the browser selection. These operations change what is shown in Anki (and exit_anki quits it), so prefer the other tools for anything that doesn't need the UI.
Upgrading from 0.5.x: the separate
gui_*tools were merged intoanki_gui.gui_browseis nowanki_guiwithoperation: "browse", and so on.
📚 Resources
The server also exposes read-only MCP resources under anki:/// (deck names, note types, card and note details, review statistics) for clients that support resources.
✍️ Prompt: writing good flashcards
The server also provides an MCP prompt, writing_good_flashcards (optional topic argument), with guidelines for effective cards: the minimum information principle, one fact per card, no yes/no questions, several angles on one idea, one cloze per list item in a fixed order, and only making cards for material you already understand. It is based on Andy Matuschak's How to write good prompts and SuperMemo's Twenty rules of formulating knowledge. In Claude Code it is available as a slash command (/mcp__anki__writing_good_flashcards).
💡 Pro Tip: Many operations support pagination to prevent overwhelming your context window. Use
limitandoffsetparameters when working with large result sets.
🛠 Development
# Run in development mode with auto-reloading
pnpm dev
# Type-check, lint and check formatting (what CI runs)
pnpm typecheck
pnpm lint
pnpm format:check
# Run unit tests (AnkiConnect is mocked; tests never touch your collection)
pnpm test
# Format the code
pnpm format
# Test with MCP inspector
pnpm inspect🔧 Configuration
AnkiConnect Settings
The server connects to AnkiConnect on localhost:8765 by default. If you've customized your AnkiConnect configuration, you may need to adjust the connection settings.
Important: Make sure Anki is running and AnkiConnect is installed before using the MCP server. The server will fail to connect if AnkiConnect is not accessible.
💡 Note: The underlying yanki-connect library supports auto-launching Anki on macOS, but this feature is not currently exposed in the MCP server configuration. You'll need to start Anki manually.
Claude Desktop Advanced Configuration
For advanced users, you can pass additional parameters:
{
"mcpServers": {
"anki": {
"command": "anki-mcp",
"args": ["--verbose"],
"env": {
"ANKI_CONNECT_HOST": "localhost",
"ANKI_CONNECT_PORT": "8765"
}
}
}
}Troubleshooting
Common Issues:
"Failed to connect to AnkiConnect": Ensure Anki is running and AnkiConnect plugin is installed
"Couldn't reach AnkiConnect at http://127.0.0.1:8765. Is Anki running?": Anki is not running or quit during the last operation. Restart it; if a
create_batchwas interrupted, its result lists which notes were saved and which to resend."No decks found": Make sure you have at least one deck in Anki
Claude doesn't respond: Restart Claude Desktop after configuration changes
Permission errors: Check that the global npm install worked correctly with
npm list -g @arielbk/anki-mcp
🤝 Contributing
We welcome contributions! Please:
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
📜 License
MIT - see LICENSE file for details.
🙏 Acknowledgments
yanki-connect - Excellent TypeScript client for AnkiConnect
AnkiConnect - The plugin that makes Anki automation possible
Model Context Protocol - Enabling seamless AI integrations
Transform your flashcard experience with AI-powered conversations! 🚀
Available Tools
8 toolsanki_guiControl the Anki app UIADestructive
Drive the Anki desktop application's user interface: open windows and dialogs (Card Browser, Add Cards, Edit Note, deck overview, import), run an on-screen review session, and read what the user currently has selected or on screen. Use this when the user wants to see or act on something inside the Anki app itself; use manage_flashcards (and the other non-GUI tools) for headless reads and writes, which are faster and do not disturb the user's windows.
Side effects: every operation except current_card and selected_notes changes what is shown in Anki. answer_card records a review and reschedules the card. undo reverts the user's last action in Anki. exit_anki quits the Anki application (and AnkiConnect with it), so only use it when the user explicitly asks. add_cards, edit_note and import_file only open pre-filled dialogs; nothing is saved until the user confirms in Anki.
Operations and the parameters they use:
add_cards: open Add Cards pre-filled (deckName, modelName, fields, tags?); returns the note ID it would create.
browse: open the Card Browser with a search (query, reorderCards?); returns matching card IDs.
select_card: select a card in an open Card Browser (cardId).
select_note: legacy alias that also selects by card ID in the Card Browser (noteId, treated as a card ID by AnkiConnect).
selected_notes: read-only; note IDs selected in the Card Browser.
edit_note: open the Edit dialog for a note (noteId).
deck_browser: show the main deck list.
deck_overview: show a deck's overview screen (deckName).
deck_review: start reviewing a deck (deckName).
current_card: read-only; the card currently shown in the reviewer, or none.
show_question / show_answer: flip the current review card.
start_card_timer: restart the answer timer for the current card.
answer_card: grade the current card (ease 1-4); the answer must be showing.
undo: undo the last action in Anki.
check_database: start Tools > Check Database (returns before it finishes).
import_file: open the Import dialog for a file (filePath, forward slashes on Windows; Anki 2.1.52+).
exit_anki: gracefully close Anki.
Requires Anki to be running with the AnkiConnect add-on.
Inputs: operation (required), ease, tags, query, +7 more.
anki_operationsAnki utilities: sync, packages, mediaADestructive
Utility operations for the Anki app: AnkiWeb sync, version check, .apkg import/export, profiles, and media files. Use this for maintenance tasks that are not about card content, decks, note types or reviews. To read a media file's contents (e.g. view an image), use get_media_file.
Operations:
version: read-only; AnkiConnect version (also a quick "is Anki running?" check).
get_profiles: read-only; profile names.
sync: syncs the collection with AnkiWeb (network; may upload or download changes).
export_deck: needs deckName and filePath (.apkg path to write); optional includeSched. Writes a file on disk.
import_package: needs filePath to an .apkg; adds its contents to the collection.
list_media: read-only; needs pattern (e.g. ".png", "").
retrieve_media: read-only; needs filename; reports whether it exists and its size.
store_media: needs filename plus mediaData (base64) or mediaUrl (downloaded by Anki). Overwrites a file with the same name.
delete_media: needs filename. Deletes the file from the media folder.
Inputs: operation (required), pattern, deckName, filePath, +4 more.
get_analyticsStudy analyticsARead-onlyIdempotent
Read-only study statistics and review history from the local Anki collection, aggregated server-side into compact JSON or one line per row. Use this for reporting and diagnosing progress; it never changes data. To act on the findings, use study_session or manage_flashcards.
Scopes (set scope, then the listed parameters). deckName always includes subdecks; where optional, omitting it means the whole collection:
deck_overview: needs deckName; optional days (default 30), limit (top tags, default 10). One-call answer to "how am I doing on this deck": new/learning/review/suspended and seen/unseen counts, the preset's new/day and reviews/day limits, the date the unseen cards run out at the new/day limit, reviews, correct % and retention over the window, and top tags by Again count.
collection_stats: optional deckName, days (forecast length, default 14). Studied today (cards, minutes, again, correct %), card counts (new/learning/young/mature/suspended; mature = interval >= 21d), correct % by card type over the last 30 days, due-review forecast per day before limits (overdue backlog separate from today), shownToday (what Anki's deck list shows today after daily limits: new/learning/review for each top-level deck, or the deck and its direct subdecks), average/longest interval.
reviews_by_day: optional deckName, days (default 30) or since (YYYY-MM-DD). One "YYYY-MM-DD: n" line per day (zero days included) plus a total.
trouble_cards: optional deckName, days (default 7), limit (default 10). Cards answered Again in the window, grouped by tag, plus the worst cards (cardId, front text, again count, lapses).
deck_stats: needs deckName; Anki's new/learning/review counts for the deck.
reviews_today: number of reviews today across all decks.
card_reviews: needs deckName and startTimestamp (epoch ms); raw review log for that deck (not subdecks), one line per review. Over limit (default 300) rows it returns a summary and how to narrow.
card_details: needs cardIds; ease factor and current interval per card.
For "what am I failing", trouble_cards gives the aggregate; to get the cards themselves use manage_flashcards find with Anki search syntax, e.g. "rated:2:1" (answered Again in the last 2 days), "deck:Spanish rated:7:1", "prop:lapses>3" or "is:due".
Inputs: scope (required), days, limit, since, +4 more.
get_media_fileGet media file contentsARead-onlyIdempotent
Read one file from Anki's media folder and return it as base64; images are also returned as image content the model can look at. Read-only. Use this when you need a referenced image/audio file's actual contents; use anki_operations list_media to find file names and store_media/delete_media to change files. Pass the bare filename as it appears in the card (e.g. "diagram.png"); paths and ".." are rejected. Returns an error object if the file doesn't exist.
Inputs: filename (required).
manage_decksManage decksADestructive
Create, list, inspect, configure, rename and delete Anki decks, and move cards between them. Use this for deck organization and per-deck daily limits; use manage_flashcards for card content. To suspend/unsuspend cards (e.g. pause a deck), use study_session.
Operations:
list: read-only; all deck names and IDs.
create: needs deckName (use "Parent::Child" for subdecks). Optional newPerDay and/or reviewsPerDay give the new deck its own daily limits (see set_limits). Does nothing if the deck already exists.
set_limits: needs deckName plus newPerDay and/or reviewsPerDay. Changes daily limits for this deck only: if the deck uses a shared options preset (e.g. "Default"), the preset is cloned into a new preset named after the deck, assigned to the deck, and only the clone is changed. Other decks are never affected. Cloned presets stay in Anki; deleting one later (in Anki's Deck Options) forces a full sync.
get_stats: read-only; deckName (one deck) or deckNames (array). One line per deck: total cards and today's new/learning/review due counts. Unknown names are reported, never created. For counts by tag or state within a deck, use manage_flashcards find with groupBy.
get_config: read-only; needs deckName. Readable summary of the deck's options preset: name/ID and which other decks share it, daily limits, learning/relearning steps, leeches, burying, max interval, FSRS desired retention, and display order as named values. raw: true returns the full preset JSON instead (FSRS parameters included).
set_display_order: needs deckName plus any of newGatherOrder (deck, deck_then_random_notes, ascending_position, descending_position, random_notes, random_cards), newSortOrder (card_type_then_gathered, gathered, card_type_then_random, random_note_then_card_type, random), reviewOrder (due_date_then_random, due_date_then_deck, deck_then_due_date, ascending/descending_intervals, ascending/descending_ease, ascending/descending_retrievability, relative_overdueness, random, order_added, reverse_order_added), newReviewMix and interdayLearningMix (mix_with_reviews, after_reviews, before_reviews). Same shared-preset safety as set_limits; reports each change as old → new. For random new cards, set newGatherOrder random_notes (newSortOrder random only shuffles the cards already gathered). Anki uses the display order of the deck you study, not its subdecks'.
set_config: needs deckNames and configId; assigns an existing options preset to the decks.
rename: needs deckName and newName. Subdecks follow; cards keep their scheduling and each deck keeps its options preset. Refuses if newName already exists with cards. Anki's "studied today" counters start fresh for the renamed deck.
move_cards: needs targetDeck plus cardIds OR query (Anki search, e.g. 'deck:"Old" tag:x'; any number of cards). Reports the count and source decks. dryRun: true reports what would move without moving (only move_cards takes dryRun).
delete: needs deckNames. Permanently deletes the decks AND all their cards (deleteCards must not be false; AnkiConnect always deletes cards) and reports how many cards each held. Deleting a filtered deck returns its cards to their home decks instead. requireEmpty: true refuses if any deck has cards that would be deleted. Cannot be undone.
Inputs: operation (required), raw, query, dryRun, +15 more.
manage_flashcardsManage flashcardsADestructive
Create, search, inspect, edit, tag and delete Anki notes (flashcards) in the local collection via AnkiConnect. Use this for card content; use manage_decks for deck structure/limits, manage_models for note-type fields and templates, and study_session for review state (to suspend/unsuspend cards, use study_session). For guidance on writing effective cards, use the "writing_good_flashcards" prompt.
Operations (set operation, then the listed parameters):
create: add one note. Needs deckName, modelName, fields; optional tags, allowDuplicate, duplicateScope. Writes immediately.
create_batch: add many notes. Give
notesinline ORfilePathto a .json (array of notes), .csv or .tsv file (header row = field names; optional tags, deck, model columns). Top-level deckName/modelName act as defaults that each note can override; top-level tags are added to every note. Notes are validated first (note type exists, field names match, duplicates, empty first field: each failure gets a reason), then sent sequentially in chunks of chunkSize (default 10). The result maps every note (#n plus the first ~40 chars of its first field) to its new note ID or failure reason. If Anki stops responding partway, it stops and lists which notes were saved and which to resend. Use dryRun: true to validate without writing. Prefer filePath for large imports: it keeps card text out of the conversation.update: change fields and/or replace tags of one note. Needs noteId plus fields and/or tags.
delete: permanently delete notes and all their cards. Needs noteIds. Cannot be undone.
find: read-only search with Anki query syntax. Needs query. Output is compact: a header with the total match count and next offset, then one line per note. Optional:
include: what each note carries. Default ["fields"] (field text, HTML stripped, each field cut to maxFieldChars, default 120; 0 = no limit). Add "tags", "deck", "model", "cards" (card IDs) or "state" (per card: new/learning/review/relearning/suspended/buried, interval, due date, reps, lapses, ease). [] returns IDs only. includeDetails: true = all of them.
groupBy: "tag" | "deck" | "model" returns {notes, cards, new, seen} per group, and "state" returns card/note counts per queue, over ALL matches (ignores limit). Use this for "how many cards per topic" or "how much of this deck have I seen" instead of listing.
limit (default 50), offset, format ("lines" default, or "json" for single-line JSON). Listings are capped at ~20k chars: past that you get the first notes that fit plus a hint to use groupBy, include or a narrower query/limit. Search power-ups: deck:"Interview prep", tag:verbs, is:new, is:due, is:suspended, rated:2:1 (answered Again in the last 2 days; the go-to for "what am I failing"), rated:7 (reviewed in the last 7 days), prop:ivl>=21 (mature), prop:lapses>=3 (leeches), added:7, "front:word". Combine with spaces (AND), "or", and "-" for NOT.
get_info: read-only card details. Needs cardIds (max 50).
add_tags / remove_tags: needs tags plus noteIds OR query (Anki search; the server finds the notes, any number). dryRun: true reports the match count and sample IDs without writing.
clear_empty: deletes every note with empty cards in the whole collection.
Fails with a clear message if Anki isn't running.
Inputs: operation (required), tags, limit, notes, +18 more.
manage_modelsManage note typesADestructive
List and modify Anki note types (models): fields, card templates and CSS. Use list before creating notes to find a note type's exact field names (e.g. "Front"/"Back"); use manage_flashcards for note content.
Operations:
list: read-only; every note type with its ID and ordered field names.
create: needs modelName, fields (ordered names) and templates ([{ Front, Back }]); optional css, isCloze.
add_field: needs modelName, fieldName, fieldIndex.
remove_field: needs modelName, fieldName. Deletes that field's content from every note of this type (destructive).
rename_field: needs modelName, fieldName, newFieldName.
add_template: needs modelName, template ({ Front, Back }). Generates new cards for existing notes.
remove_template: needs modelName, templateName. Deletes the cards generated by that template (destructive).
update_styling: needs modelName, css. Replaces the note type's CSS.
All operations except list change the collection immediately and affect every note of that type.
Inputs: operation (required), css, fields, isCloze, +7 more.
study_sessionStudy session and schedulingADestructive
Find due cards and change review state (answer, suspend, unsuspend, reset, relearn) in the local Anki collection. Use this to run a quiz or adjust scheduling; use manage_flashcards to edit card content and get_analytics for history and statistics.
Operations:
find_due: read-only. Needs query (Anki search syntax, e.g. "deck:Spanish"); returns which matching cards are due now.
check_status: read-only. Needs cardIds; returns due/suspended flags per card.
answer: records reviews, as if answered in Anki. Needs answers: [{ cardId, ease }] where ease 1=Again, 2=Hard, 3=Good, 4=Easy. Affects future scheduling.
suspend / unsuspend: needs cardIds OR query. Suspended cards are excluded from reviews until unsuspended (e.g. pause a whole deck: query 'deck:"Spanish"').
forget: needs cardIds OR query. Resets cards to new, discarding their review progress (destructive).
relearn: needs cardIds OR query. Puts cards back into relearning. With query (Anki search syntax), the server finds the cards and applies the change in chunks, so thousands of cards take one call; it returns the count. dryRun: true returns the match count and sample IDs without writing. A query matching nothing changes nothing.
All writes apply immediately and are not undoable through this tool.
Inputs: operation (required), query, dryRun, answers, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool owns a clear domain (card content, deck structure, note types, review state, analytics, GUI, app maintenance), and descriptions explicitly cross-reference boundaries (e.g. 'use study_session to suspend'). However, several read paths overlap heavily — manage_flashcards find with state/groupBy, study_session find_due, manage_decks get_stats, and get_analytics scopes can all answer 'what's due / how am I doing', which risks misselection despite the guidance.
The manage_flashcards / manage_decks / manage_models trio follows a clean verb_noun pattern, and get_analytics/get_media_file fit it. But study_session, anki_operations, and anki_gui are noun-phrase names that break the convention, and the aggregate 'anki_operations' bucket is vague about its scope.
Eight tools is well-scoped for an Anki integration, and each aggregates a coherent area via an operation parameter rather than exploding into dozens of single-action tools. Every tool earns its place in the surface.
Coverage is broad and lifecycle-complete: note CRUD plus batch import, deck CRUD and limits/config, note-type fields/templates/CSS, review answering/suspend/forget/relearn, analytics, media files, sync/import/export, and even GUI driving. Only niche gaps (e.g. tag renaming, own-write undo) remain.
Maintenance
Related MCP Connectors
Spaced-repetition flashcards your AI writes, quizzes you on by voice, and schedules with FSRS.
Read, write, and conversationally review open-source flashcards through split read/write MCP tools.
Turn text, files, URLs, or photos into Anki flashcard decks from your AI assistant.
AI-powered YouTube to flashcards with spaced repetition and Anki export
Related MCP Servers
- AlicenseAqualityBmaintenanceAn MCP server that enables AI assistants like Claude to interact with Anki flashcard decks, allowing users to create, manage, and update flashcards through natural language conversations.945MIT
- AlicenseNot gradedqualityAmaintenanceAn MCP server that enables AI assistants to interact with the Anki flashcard application for studying, deck management, and note creation. It supports natural language interaction for reviewing cards, searching content, and managing media files across local and remote environments.993 npm582MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI assistants to seamlessly manage Anki flashcards, decks, and templates through the AnkiConnect API. It supports intelligent querying, batch note creation, and detailed study progress analysis using natural language.4MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol (MCP) server that integrates with Anki flashcard application, allowing LLM applications like Claude to interact with your Anki decks and cards.111MIT