Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

mcp-ankiconnect

MCP.Pizza Chef: samefarrar

mcp-ankiconnect is an MCP server that bridges conversational AI models like Claude with Anki's spaced repetition system through AnkiConnect. It enables users to interact with their Anki flashcards using natural language commands, such as querying the number of cards due today, retrieving due cards for review, and submitting review results. The server supports filtering by deck and limits on the number of cards, returning data in XML format for easy processing. This integration simplifies flashcard management and review workflows, making spaced repetition more accessible and interactive within AI-driven conversations.

Use This MCP server To

Query number of Anki cards due today Retrieve due flashcards for review sessions Submit review results directly from chat Filter flashcards by specific Anki decks Automate spaced repetition study workflows

README

mcp-ankiconnect MCP server

Connect Claude conversations with AnkiConnect via MCP to make spaced repetition as easy as "Let's go through today's flashcards" or "Make flashcards for this"

Components

Tools

The server implements three tools:

  • num_cards_due_today: Get the number of cards due today

    • Optional deck argument to filter by specific deck
    • Returns count of due cards across all decks or specified deck
  • get_due_cards: Get cards that are due for review

    • Optional limit argument (default: 5) to control number of cards
    • Optional deck argument to filter by specific deck
    • Optional today_only argument (default: true) to show only today's cards
    • Returns cards in XML format with questions and answers
  • submit_reviews: Submit answers for reviewed cards

    • Takes list of reviews with card_id and rating
    • Ratings: "wrong", "hard", "good", "easy"
    • Returns confirmation of submitted reviews

Configuration

Prerequisites

  • Anki must be running with AnkiConnect plugin installed (plugin id 2055492159) AnkiConnect can be slow on Macs due to the AppSleep feature, so disable it for Anki. To do so run the following in your terminal.
    defaults write net.ankiweb.dtop NSAppSleepDisabled -bool true
    defaults write net.ichi2.anki NSAppSleepDisabled -bool true
    defaults write org.qt-project.Qt.QtWebEngineCore NSAppSleepDisabled -bool true

Installation

Quickstart

  1. Install the AnkiConnect plugin in Anki:

    • Tools > Add-ons > Get Add-ons...
    • Enter code: 2055492159
    • Restart Anki
  2. Configure Claude Desktop:

    On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

    Add this configuration:

    {
      "mcpServers": {
        "mcp-ankiconnect": {
          "command": "uv",
          "args": ["run", "--with", "mcp-ankiconnect", "mcp-ankiconnect"]
        }
      }
    }
  3. Restart Anki and Claude desktop

Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector. First, clone the repository and install the dependencies:

git clone https://github.com/samefarrar/mcp-ankiconnect.git
cd mcp-ankiconnect
uv sync

You can launch the MCP Inspector via the mcp CLI:

uv run mcp dev mcp_ankiconnect/server.py

Upon launching, the Inspector will display a URL you can access in your browser to begin debugging.

mcp-ankiconnect FAQ

How do I connect mcp-ankiconnect to my Anki application?
Ensure Anki is running with AnkiConnect installed and enabled, then configure mcp-ankiconnect to communicate with the AnkiConnect API endpoint.
Can I filter flashcards by deck when retrieving due cards?
Yes, mcp-ankiconnect supports an optional 'deck' argument to filter cards by specific decks.
What formats are used to return flashcard data?
Due cards are returned in XML format containing questions and answers for easy parsing.
How do I submit review results using mcp-ankiconnect?
Use the 'submit_reviews' tool with a list of card IDs and ratings such as 'wrong', 'hard', 'good', or 'easy' to record your review outcomes.
Is it possible to limit the number of cards retrieved for review?
Yes, the 'get_due_cards' tool accepts an optional 'limit' argument to control how many cards are returned, defaulting to 5.
Does mcp-ankiconnect support integration with LLMs other than Claude?
While designed with Claude in mind, mcp-ankiconnect can be used with other LLMs like OpenAI's GPT-4 and Anthropic's Claude via MCP protocol.
What prerequisites are needed before using mcp-ankiconnect?
You need Anki installed and running with the AnkiConnect plugin enabled to allow API communication.
Can I review flashcards from multiple decks at once?
Yes, if no deck filter is specified, the server returns cards due across all decks.