Anki MCP Server

Selectively commit what you learn in conversation with an LLM to memory using a rigorous and proven learning framework

Python 3.10+ MCP 1.21+ MIT License

Features

🎯

Core Anki Operations

Full CRUD operations on flashcards and collections, with powerful search capabilities using Anki's native query syntax.

âš¡

Zero Dependencies

Works directly with Anki's stable pylib. No additional dependencies to manage or worry about.

🔒

Thread-Safe

Safe concurrent access to Anki collections with proper locking mechanisms.

📡

Stdio Transport

Simple stdio-based communication - no HTTP ports or network configuration needed.

🔌

Anki Addon

Can be installed as a native Anki addon for direct integration with your Anki installation.

📚

Well Documented

Comprehensive documentation with examples for all features and use cases.

MCP Tools

Loading tools...

Installation

Prerequisites

  • Python 3.10 or higher
  • UV package manager
  • Anki 2.1.50+ installed (to create collections)
  • Note: Anki application must be closed when using the MCP server

Step 1: Clone and Install

git clone https://github.com/listfold/ankimcp.git
cd ankimcp
uv sync

# Test the installation
uv run python test_server.py

Step 2: Configure Claude Code

Add the MCP server with user scope (available globally):

claude mcp add --transport stdio --scope user anki -- \
  uv --directory /absolute/path/to/ankimcp run python -m ankimcp.mcp.stdio_server

Replace /absolute/path/to/ankimcp with the actual path.

Flags explained:

  • --transport stdio: Specifies stdio communication
  • --scope user: Makes server available in all Claude Code sessions
  • --: Separates Claude Code flags from server command

Verify configuration: claude mcp list

Step 3: Configure Claude Desktop (Optional)

Edit your Claude Desktop configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "anki": {
      "command": "uv",
      "args": [
        "run",
        "python",
        "-m",
        "ankimcp.mcp.stdio_server"
      ],
      "cwd": "/absolute/path/to/ankimcp"
    }
  }
}

Restart Claude Desktop after saving.