Skip to main content
Glama
Anki Flashcard MCP

Anki Flashcard MCP

by ctjmaxwell

Anki Flashcard MCP Server 🃏

Project Overview 🚀

This project provides a Dockerized Model Context Protocol (MCP) server specifically designed to work with the Anki desktop application. By leveraging the anki-flashcard-mcp server, you can use a large language model (LLM), such as Claude, to automatically generate flashcards and sync them with your Anki decks.

Related MCP server: MCP-AnkiConnect

Prerequisites ✅

Before you get started, please make sure you have the following installed:

  • Docker: The containerization platform. 🐳

  • uv: A fast Python package installer and bundler (recommended for development).

  • AnkiConnect Add-on: This Anki add-on is required to allow the server to communicate with your Anki application. In Anki, go to Tools > Add-ons > Get Add-ons... and enter the code 2055492159.

  • Anki Desktop: The Anki application must be open and running for the server to work. 💡

Development Setup (Optional) ⚙️

If you plan to develop or modify the server, you can set it up locally using uv.

  1. Initialize the project:

uvx create-mcp-server anki-flashcard-mcp
cd anki-flashcard-mcp
  1. Install dependencies and run the server:

uv sync --dev --all-extras
uv run my-server

Running with Docker 📦

This is the recommended way to use the server.

  1. Build the Docker image:

docker build -t anki-flashcard-mcp .

This command builds the Docker image and tags it as anki-flashcard-mcp.

  1. Test the server (optional): You can test the container using the MCP inspector tool to ensure it's running correctly.

npx @modelcontextprotocol/inspector docker run -i --rm --init -e DOCKER_CONTAINER=true anki-flashcard-mcp

This command will run the inspector, which lets you test prompts and tools to verify the container's output.

Using with the Claude App 🤖

Follow these steps to integrate the Dockerized server with the Claude desktop application.

  1. Enable Docker access for Claude: Sometimes, Claude doesn't have the necessary shell environment variables to access Docker. Run the following command in your terminal to fix this:

launchctl setenv PATH "$PATH"
  1. Configure Claude Desktop:

    • Open the Claude app and navigate to Settings > Developer.

    • Find the Local MCP Servers section and click Edit Config.

    • This will open claude_desktop_config.json. Add the following configuration to the JSON file:

{
  "mcpServers": {
    "anki-flashcard-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--init",
        "-e",
        "DOCKER_CONTAINER=true",
        "anki-flashcard-mcp"
      ]
    }
  }
}
  1. Troubleshooting - Wrapper Script (if direct config fails): ⚠️ If the direct configuration doesn't work, you can use a shell script as a stable entry point.

    • Create a new script file, for example: /Users/cademaxwell/.scripts/run-anki-docker.sh

#!/bin/bash
exec /usr/local/bin/docker run -i --rm --init -e DOCKER_CONTAINER=true anki-flashcard-mcp
  • Make the script executable:

chmod +x ~/.scripts/run-anki-docker.sh
  • Note: Replace /usr/local/bin/docker with the actual path to your Docker executable (you can find this by running which docker).

  • Update the claude_desktop_config.json to point to the new script:

{
  "mcpServers": {
    "anki-flashcard-mcp": {
      "command": "/Users/cademaxwell/.scripts/run-anki-docker.sh"
    }
  }
}

Your Dockerized MCP server is now ready to be used by Claude! Each time you open the Claude desktop app, a new Docker container will start for the anki-flashcard-mcp image.

Available Tools

2 tools
add_anki_noteC
    Adds a SINGLE Anki note. Use this for adding one card at a time.

    :param deck: The name of the deck to add the note to.
    :param front: The content for the front of the card.
    :param back: The content for the back of the card.
    :param tags: A list of tags to add to the note.
    

Inputs: back (required), deck (required), front (required), tags.

add_multiple_anki_notesB
    Adds a BATCH of multiple Anki notes in a single, efficient operation. Use this for adding more than one card at once.

    :param deck: The name of the deck to add the notes to.
    :param notes: A list of notes to add. Each note should be a dictionary with "Front" and "Back" keys.
    :param tags: A list of tags to add to every note in the batch.
    

Inputs: deck (required), notes (required), tags.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.7/5.0

    Scored across 2 tools

    Disambiguation3/5

    The two tools are clearly distinguished by single vs. batch operation, and the descriptions explicitly state when to use each. However, there is still some ambiguity since both serve the same fundamental purpose (adding notes to a deck), and an agent might reasonably pick either for a single-note add when the batch tool would also work.

    Naming Consistency3/5

    Both tools follow a verb_noun style with 'add' as the verb, which is consistent. However, the naming is somewhat redundant ('add_anki_note' vs 'add_multiple_anki_notes') rather than a clean noun-based pattern like 'create_note' and 'create_notes', and the repetition of 'anki' in both is verbose.

    Tool Count1/5

    Only two tools exist, and they cover only the 'add' operation. For a flashcard MCP server, this is extremely thin — there are no tools to retrieve, update, delete, search, or review notes or decks. A server this narrow is difficult to justify as useful for real workflows.

    Completeness1/5

    The surface only supports adding notes. There are no get/update/delete operations for notes, no deck management, no card review/study operations, and no search capability. This is a severely incomplete surface for managing Anki flashcards and will cause agents to hit dead ends immediately after adding content.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      An 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.
      9
      45
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An 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.
      4
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      An MCP server that enables Claude Code to create, manage, and search Anki flashcards directly from the terminal. It supports batch card creation, deck statistics retrieval, and synchronization with AnkiWeb for cross-platform review.
      8
      -