Anki MCP Server
ankimcp/anki-mcp-server · 320 stars · TypeScript · MIT
MCP server A Model Context Protocol (MCP) server that enables AI assistants to interact with Anki, the spaced repetition flashcard application.
Install
npm install -g @ankimcp/anki-mcp-serverThese repos do not share one command. When an entry shows a command, it was copied as published. Check the repo's README before you run it.
Files
Anki MCP Server
Beta - This project is in active development. APIs and features may change.
A Model Context Protocol (MCP) server that enables AI assistants to interact with Anki, the spaced repetition flashcard application.
Transform your Anki experience with natural language interaction - like having a private tutor. The AI assistant doesn't just present questions and answers; it can explain concepts, make the learning process more engaging and human-like, provide context, and adapt to your learning style. It can create and edit notes on the fly, turning your study sessions into dynamic conversations. More features coming soon!
Examples and Tutorials
For comprehensive guides, real-world examples, and step-by-step tutorials on using this MCP server with Claude Desktop, visit:
ankimcp.ai - Complete documentation with practical examples and use cases
See docs/ for supplementary documentation, including the reviewer setup guide and the sample Anki deck.
Example Use Cases
Three representative prompts showing the tool flows this server enables:
- "Help me review my Spanish deck." — The assistant offers to sync with AnkiWeb (
sync), fetches due cards (get_due_cardswith deck filter), presents each card (present_card), and records your rating (rate_card). Natural study conversation with explanations tailored to you.
- "Create 10 Arabic vocab cards with RTL styling." — The assistant lists note types (
modelNames), creates a custom RTL model if needed (createModel+updateModelStylingfor right-to-left CSS), then batch-creates the cards (addNotes).
- "Import this image from my Downloads folder into the front of the selected note." — The assistant uploads the local file (
storeMediaFilewith a file path), reads the currently-selected note from the browser (guiSelectedNotes+notesInfo), and updates the front field with an `tag (updateNoteFields`).
Available Tools
The server exposes 53 MCP tools — 42 essential tools for everyday Anki operations and 11 GUI tools that drive the Anki desktop interface for note editing/creation workflows.
Essential Tools
#### Review & Study
sync- Sync with AnkiWeb to pull latest data and push changesget_due_cards- Get cards that are due for review, optionally filtered by deck (answers omitted unlessinclude_answer: true, defaultfalse)get_cards- Get cards with flexible filtering by state (due, new, learning, suspended, buried) and deck (answers omitted unlessinclude_answer: true, defaultfalse)present_card- Show a card for review with its question/front siderate_card- Rate card performance (Again, Hard, Good, Easy) and schedule the next reviewforgetCards- Reset cards to new, discarding their scheduling without recording a reviewsetDueDate- Reschedule cards to become due in N days ("0","3-7","1!"), without recording a reviewareSuspended- Check suspension state for one or more cards without changing anythingsuspend- Suspend cards so they are skipped during review until unsuspendedunsuspend- Unsuspend cards so they return to normal review
Note:
forgetCardsandsetDueDatechange scheduling without logging a review, which is what separates them fromrate_card. Reach for them when a card's schedule is wrong rather than the answer: rating a cardAgainto bury it deeper records a real lapse and drops its ease factor, permanently skewing both future scheduling and your statistics.forgetCardswipes the interval and starts the card over;setDueDatekeeps the card's history and just moves the next review.
Note: Card
front/backcontent is rendered per card from its own template (as Anki shows it), so reversed and cloze cards display the correct direction. Static text added by your card templates appears in the output as well.
#### Deck Management
listDecks- List all decks, optionally with per-deck study-queue statisticsdeckStats- Get comprehensive statistics for a single deck (study queue, true card-state counts, ease/interval distributions)createDeck- Create a new empty deck (supportsParent::Child, max 2 levels)changeDeck- Move cards to a different deck (created if it doesn't exist)
Note: Deck statistics come in two flavours. The
countsblock (and everythinglistDecksreports) mirrors Anki's deck browser: cards due today, capped by each deck's daily new/review limits, with suspended and buried cards excluded — soreviewis not "mature cards" and theotherbucket is just the arithmetic remainder (mostly review cards not due today plus new cards over the daily limit). For true per-state totals use thestatesblock ondeckStats/collection_stats, which countsnew,learning,review,suspendedandburiedvia Anki searches, ignoring due dates and daily limits.
#### Note Management
addNote- Create a single note with specified fields and tagsaddNotes- Batch-create up to 100 notes sharing a deck and model (partial success supported)findNotes- Search for notes using Anki query syntax (deck:,tag:,is:due, etc.)notesInfo- Get detailed information about notes (fields, tags, note type, card IDs; CSS comes frommodelStyling)updateNoteFields- Update existing note fields (CSS-aware, supports HTML content)deleteNotes- Delete notes and all associated cards (destructive, requires confirmation)
#### Tag Management
getTags- Get all tags in the collection (use first to avoid duplication)addTags- Add space-separated tags to specified notesremoveTags- Remove space-separated tags from specified notesreplaceTags- Rename a tag across specified notesclearUnusedTags- Remove orphaned tags not used by any notes (destructive)
#### Media Management
getMediaFilesNames- List media files incollection.media, optionally filtered by patternretrieveMediaFile- Download a media file as base64 contentstoreMediaFile- Upload media from base64 data, an absolute file path, or a URLdeleteMediaFile- Remove a media file fromcollection.media(destructive)
💡 Best Practice for Images:
- ✅ Use file paths (e.g.,
/Users/you/image.png) - Fast and efficient - ✅ Use URLs (e.g.,
https://example.com/image.jpg) - Direct download - ❌ Avoid base64 - Extremely slow and token-inefficient
Just tell Claude where the image is, and it will handle the upload automatically using the most efficient method.
#### Model/Template Management
modelNames- List all available note types/modelsmodelFieldNames- Get field names for a specific note typemodelStyling- Get CSS styling information for a note typemodelTemplates- Get the card templates (Front and Back HTML) for a note typecreateModel- Create a new note type with custom fields, card templates, and CSS (e.g., RTL models)updateModelStyling- Update the CSS styling for an existing note type (applies to all its cards)updateModelTemplates- Update the card templates (Front and Back HTML) for an existing note type (applies to all its cards)addModelField- Add a new field to an existing note type (appended at the end or inserted at a specific position)removeModelField- Remove a field from an existing note type (deletes its content from all notes; requires explicit confirmation)renameModelField- Rename a field in an existing note type (Anki rewrites references to the old name in the card templates)repositionModelField- Change the position of a field within an existing note type
#### Statistics
collection_stats- Aggregated statistics across all decks with per-deck breakdown and collection-wide card-state countsreview_stats- Review history analysis (temporal patterns, retention metrics, study streaks)
GUI Tools
Tools that drive the Anki desktop interface. Intended for note editing/creation and deck-management workflows, not for review sessions.
guiBrowse- Open the Card Browser and search for cardsguiSelectCard- Select a specific card in the Card BrowserguiSelectedNotes- Get IDs of notes currently selected in the Card BrowserguiAddCards- Open the Add Cards dialog with preset note detailsguiEditNote- Open the note editor for a specific noteguiDeckOverview- Open the Deck Overview dialog for a specific deckguiDeckBrowser- Open the Deck Browser dialog
Facts
- Kind
- MCP server
- Repo
- ankimcp/anki-mcp-server
- Group
- Uncategorized
- Stars
- 320
- License
- MIT
- Language
- TypeScript
- Last push
- 2026-10-04
- Forks
- 38
- Homepage
- ankimcp.ai
- Topics
- ai, ai-learning-tool, ai-tutor, anki, anki-addon, anki-flashcards
- 1Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
- 2Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k
- 3Gitmodelcontextprotocol/serversA Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.85.8k
- 4Memorymodelcontextprotocol/serversA basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.85.8k
- 5Sequential Thinkingmodelcontextprotocol/serversAn MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.85.8k
- 6Timemodelcontextprotocol/serversA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.85.8k