Anki MCP Server

by dhkim0124

Not rated
GitHub

About

Create Anki flashcards using natural language by connecting to the AnkiConnect add-on.

Details

Author
dhkim0124
Categories
Productivity, Other, Knowledge Base

Setup

Install Anki MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/dhkim0124/anki-mcp-server

Follow the installation instructions in the repository README, then restart your MCP client.

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
-
AnkiConnectadd-on
- Claude Desktop (or any MCP-compatible client)
- Install
Anki.
- Install the AnkiConnect add-on:

- In Anki, go toTools > Add-ons > Get Add-ons
- Enter code2055492159and click OK
- Restart Anki

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

- 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"] } } }

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.

Four built-in styles are available via thestyleparameter increate_note_type:

Forcustom style, describe what you want in natural language and Claude generates the CSS:

"Dark blue background, mint green accents, smooth fade-in animation"

All custom CSS is validated to blockjavascript:URLs,<script>tags, and inline event handlers before being sent to Anki.

anki-mcp-server/ ├── anki_server.py # MCP tool definitions and AnkiConnect client ├── config.py # Constants: URL, API version, media limits ├── instructions.py # LLM system instructions for conversational behavior ├── templates.py # Built-in CSS themes, CSS validation, HTML generators └── tests/ ├── test_anki_server.py # Tests for all tools (mocked AnkiConnect) └── test_templates.py # Tests for template logic and CSS validation
pip install pytest pytest-asyncio pytest tests/ -v

All tests mock AnkiConnect viahttpx— no running Anki instance required.

- Anki must be open:The MCP server requires Anki to be running.
- AnkiConnect not responding:Visithttp://localhost:8765to confirm it's active.
- Windows firewall:You may need to allow Anki through the firewall for AnkiConnect to work.
- Restart everything:If issues persist, restart Anki, Claude Desktop, and re-check the config file path.

Fork the repository and open a pull request. Contributions are welcome in:

- New card types or template styles
- Additional language support
- Interface and UX improvements
- Documentation

Manage Anki flashcards and decks via the AnkiConnect plugin.

Connect Claude with AnkiConnect to create and review flashcards using natural language.

A Model Context Protocol (MCP) server that provides seamless integration with Anki, enabling AI assistants to interact with your flashcard collection. Create, read, update, and manage Anki cards programmatically through a standardized interface.

Connects to Anki via AnkiConnect to retrieve leech-tagged flashcards for use in Claude Desktop.

Interact with the Anki flashcard app via the AnkiConnect add-on. Supports audio generation and similarity search.

Connects to a local Anki instance to review and create flashcards. Requires the Anki desktop app and Anki-Connect add-on.

Enables AI assistants to interact with Anki flashcard decks via the AnkiConnect plugin.

ree certification prep for the Claude Certified Architect exam. 390 questions, guided capstone build, 30 handouts, 6 reference projects, practice exams, interactive UI, progress dashboard, spaced repetition, deterministic grading. Runs locally.

Interactive flashcards, quizzes, and cloze cards with FSRS spaced repetition, rendered inline in Claude Desktop as an MCP App.

A MCP server that enables AI assistants to interact with Anki, the spaced repetition flashcard application.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.