ClaudeCodeMod

All shelves / MCP servers

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

In your shell
npm install -g @ankimcp/anki-mcp-server

These 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.

Open the repo

Files

README.md

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:

  1. "Help me review my Spanish deck." — The assistant offers to sync with AnkiWeb (sync), fetches due cards (get_due_cards with deck filter), presents each card (present_card), and records your rating (rate_card). Natural study conversation with explanations tailored to you.
  1. "Create 10 Arabic vocab cards with RTL styling." — The assistant lists note types (modelNames), creates a custom RTL model if needed (createModel + updateModelStyling for right-to-left CSS), then batch-creates the cards (addNotes).
  1. "Import this image from my Downloads folder into the front of the selected note." — The assistant uploads the local file (storeMediaFile with 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 changes
  • get_due_cards - Get cards that are due for review, optionally filtered by deck (answers omitted unless include_answer: true, default false)
  • get_cards - Get cards with flexible filtering by state (due, new, learning, suspended, buried) and deck (answers omitted unless include_answer: true, default false)
  • present_card - Show a card for review with its question/front side
  • rate_card - Rate card performance (Again, Hard, Good, Easy) and schedule the next review
  • forgetCards - Reset cards to new, discarding their scheduling without recording a review
  • setDueDate - Reschedule cards to become due in N days ("0", "3-7", "1!"), without recording a review
  • areSuspended - Check suspension state for one or more cards without changing anything
  • suspend - Suspend cards so they are skipped during review until unsuspended
  • unsuspend - Unsuspend cards so they return to normal review

Note: forgetCards and setDueDate change scheduling without logging a review, which is what separates them from rate_card. Reach for them when a card's schedule is wrong rather than the answer: rating a card Again to bury it deeper records a real lapse and drops its ease factor, permanently skewing both future scheduling and your statistics. forgetCards wipes the interval and starts the card over; setDueDate keeps the card's history and just moves the next review.

Note: Card front/back content 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 statistics
  • deckStats - Get comprehensive statistics for a single deck (study queue, true card-state counts, ease/interval distributions)
  • createDeck - Create a new empty deck (supports Parent::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 counts block (and everything listDecks reports) mirrors Anki's deck browser: cards due today, capped by each deck's daily new/review limits, with suspended and buried cards excluded — so review is not "mature cards" and the other bucket is just the arithmetic remainder (mostly review cards not due today plus new cards over the daily limit). For true per-state totals use the states block on deckStats / collection_stats, which counts new, learning, review, suspended and buried via Anki searches, ignoring due dates and daily limits.

#### Note Management

  • addNote - Create a single note with specified fields and tags
  • addNotes - 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 from modelStyling)
  • 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 notes
  • removeTags - Remove space-separated tags from specified notes
  • replaceTags - Rename a tag across specified notes
  • clearUnusedTags - Remove orphaned tags not used by any notes (destructive)

#### Media Management

  • getMediaFilesNames - List media files in collection.media, optionally filtered by pattern
  • retrieveMediaFile - Download a media file as base64 content
  • storeMediaFile - Upload media from base64 data, an absolute file path, or a URL
  • deleteMediaFile - Remove a media file from collection.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/models
  • modelFieldNames - Get field names for a specific note type
  • modelStyling - Get CSS styling information for a note type
  • modelTemplates - Get the card templates (Front and Back HTML) for a note type
  • createModel - 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 counts
  • review_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 cards
  • guiSelectCard - Select a specific card in the Card Browser
  • guiSelectedNotes - Get IDs of notes currently selected in the Card Browser
  • guiAddCards - Open the Add Cards dialog with preset note details
  • guiEditNote - Open the note editor for a specific note
  • guiDeckOverview - Open the Deck Overview dialog for a specific deck
  • guiDeckBrowser - 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

More on this shelf

  1. 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
  2. 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
  3. 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
  4. 4Memorymodelcontextprotocol/serversA basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.85.8k
  5. 5Sequential Thinkingmodelcontextprotocol/serversAn MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.85.8k
  6. 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