anki-mcp-server
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. Simply ask Claude to create flashcards, and they will be automatically added to your Anki decks.
Install / Use
claude mcp add dhkim0124 -- npx -y github:dhkim0124/anki-mcp-serverIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AutomationSupported Platforms
Tags
Our assessment of anki-mcp-server
anki-mcp-server scores 75/100 on our quality scale, 2631st of 2,874 Automation skills we index.
Its MCP Server is 5.6 KB long, well organised into 18 sections with 4 code examples: a solid amount of guidance for an agent.
It has 10 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated about 8 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 91/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
anki-mcp-server compared with similar skills
All 4 of these similar skills score higher than anki-mcp-server; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| anki-mcp-server (this skill)by dhkim0124 | 75 | 10 | 8mo ago | MCP Server |
| Agent-Reachby Panniantong | 100 | 102.9k | 1d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 77.9k | 1d ago | CLAUDE.md |
| CowAgentby zhayujie | 100 | 47.6k | 1d ago | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 89.8k | today | MCP Server |
Frequently asked questions
- How do I install anki-mcp-server?
- Run
claude mcp add dhkim0124 -- npx -y github:dhkim0124/anki-mcp-server. The install tabs above show the steps for each supported agent. - Which AI agents does anki-mcp-server work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is anki-mcp-server safe to use?
- It is MIT-licensed and scores 91/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is anki-mcp-server still maintained?
- The repository was last updated about 8 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
Skill content
View source on GitHubanki-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
- Install Anki.
- Install the AnkiConnect add-on:
- In Anki, go to
Tools > Add-ons > Get Add-ons - Enter code
2055492159and click OK - Restart Anki
- In Anki, go to
- Verify it works by visiting
http://localhost:8765— you should seeAnkiConnect 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 |
| delete_cards | Delete one or more cards — requires explicit confirmation |
Note Types & Styling
| Tool | Description |
|------|-------------|
| create_note_type | Create a custom note type with chosen fields, CSS style, and HTML templates |
| get_note_types | List all available note types and their fields |
| update_note_type_style | Update the CSS of an existing note type |
| update_note_type_template | Update the HTML templates of an existing note type |
Media & Sync
| Tool | Description |
|------|-------------|
| add_media | Upload an image or audio file (base64) to Anki's media folder |
| sync_anki | Sync your local collection with AnkiWeb |
Style Templates
Four built-in styles are available via the style parameter in create_note_type:
| Style | Key | Best for |
|-------|-----|----------|
| Default | "default" | General use |
| Duolingo | "duolingo" | Language learning, gamified feel |
| Dark Mode | "dark" | Night studying, reduced eye strain |
| Code | "code" | Programming, algorithms |
| Custom | "custom" | Full control — you provide the CSS |
For custom 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 block javascript: URLs, <script> tags, and inline event handlers before being sent to Anki.
Project Structure
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
Running Tests
pip install pytest pytest-asyncio
pytest tests/ -v
All tests mock AnkiConnect via httpx — no running Anki instance required.
Troubleshooting
- Anki must be open: The MCP server requires Anki to be running.
- AnkiConnect not responding: Visit
http://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.
Contributing
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
License
MIT License — see LICENSE for details.
Related Skills
Agent-Reach
102.9kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
77.9kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
CowAgent
47.6kOpen-source personal AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
Scrapling
89.8k🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
