DA

dhkim0124/anki-mcp-server

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

10 stars 4 forks Качество 68 Тренд 8MIT

A Model Context Protocol (MCP) server that connects Claude to Anki. This integration allows you to create and manage flashcards in Anki using natural language commands with Claude.

Обзор

Read this in other languages: English, 한국어 A Model Context Protocol (MCP) server that connects Claude and Anki, allowing you to create, manage, and enrich flashcard decks through natural language — without ever opening the Anki UI. - Python 3.9 or higher - Anki 2.1.x or higher - AnkiConnect add-on - Claude Desktop (or any MCP-compatible client) 1. Install Anki. 2. Install the AnkiConnect add-on: - In Anki, go to Tools > Add-ons > Get Add-ons - Enter code 2055492159 and click OK - Restart Anki 3. Verify it works by visiting http://localhost:8765 — you should see AnkiConnect v.6. - %APPDATA%\Claude\claude_desktop_config.json - ~/Library/Application Support/Claude/claude_desktop_config.json - ~/.config/Claude/claude_desktop_config.

README

Показан фрагмент оригинального README. Открыть оригинал.

anki-mcp-server

Read this in other languages: English, 한국어

A Model Context Protocol (MCP) server that connects Claude and Anki, allowing you to create, manage, and enrich flashcard decks through natural language — without ever opening the Anki UI.

Requirements

  • Python 3.9 or higher
  • Anki 2.1.x or higher
  • AnkiConnect add-on
  • Claude Desktop (or any MCP-compatible client)

Installation

1. Set up Anki and AnkiConnect

  1. Install Anki.
  2. Install the AnkiConnect add-on:
    • In Anki, go to Tools > Add-ons > Get Add-ons
    • Enter code 2055492159 and click OK
    • Restart Anki
  3. Verify it works by visiting http://localhost:8765 — you should see AnkiConnect v.6.

2. Install anki-mcp-server

git clone https://github.com/dhkim0124/anki-mcp-server.git
cd anki-mcp-server

python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

pip install -r requirements.txt

3. Configure Claude Desktop

Edit your Claude Desktop config file:

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

Usage

With Anki running in the background, you can ask Claude things like:

  • “Create a Python deck with Code style and add 10 cards about decorators”
  • “Show me my decks and their stats”
  • “Search for cards tagged ‘sql’ and update the one about indexes”
  • “Create a custom dark-mode deck with fields: Word, Definition, Example, Audio”
  • “Upload this image and attach it to a new card in my Biology deck”
  • “Sync my collection with AnkiWeb”

The server guides the conversation — it asks clarifying questions about deck, style, and card type before creating anything, and always asks for confirmation before destructive operations.

Available Tools

Deck Management

Tool Description
list_decks List all decks with stats (total, new, due, learning cards)
create_deck Create a new deck (supports nested decks with ::)
delete_deck Delete a deck — requires explicit confirmation

Card Operations

Tool Description
create_card Create a single Basic card (front/back)
create_card_batch Create multiple cards in one call
create_card_custom Create a card using a custom note type, with optional audio/image attachments
search_cards Search using Anki’s query syntax (tags, text, deck filters)
update_card Edit fields and tags of an existing card
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "anki-mcp": { "command": "python", "args": ["/absolute/path/to/anki_server.py"] } } }