Anki MCP
About
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.
Details
- Author
- letuanvu08
- Categories
- Productivity, Other, Knowledge Base
Jump to
Setup
Install Anki MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/letuanvu08/anki-mcp
Follow the installation instructions in the repository README, then restart your MCP client.
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.
- 🎴Card Management: Create, retrieve, and update flashcards with full field customization
- 🔍Smart Search: Query cards by ID, keywords, tags, decks, or any Anki search syntax
- 📊Review Integration: Access due cards, new cards, and answer cards programmatically
- 🎵Media Support: Automatic handling of audio and images (local files, URLs, or existing media)
- 🔄Batch Operations: Create multiple cards efficiently in a single operation
- 🎯Generic Tools: Flexible tools that work with any deck, note type, and field configuration
- Anki Desktop App- Must be running during MCP server usage
- AnkiConnect Add-on- Install from Anki: Tools → Add-ons → Get Add-ons → Code:2055492159
⚠️Important: Anki must be running with AnkiConnect enabled for this MCP server to function.
- anki://search/deckcurrent- All cards from current deck
- anki://search/isdue- Cards due for review
- anki://search/isnew- New unseen cards
- Custom queries:anki://search/tag:vocabulary,anki://search/deck:Spanish, etc.
- update_card- Update cards/notes (answer, update fields, update tags)
- add_card- Create a new flashcard with custom deck, model, and fields
- batch_add_card- Create multiple flashcards at once
- get_due_cards- Get list of cards due for review
- get_new_cards- Get list of new unseen cards
- get_card- Retrieve detailed card information by ID or query
When you add cards with images or audio files, the server automatically handles different types of media sources:
-
Local File Paths: If you provide an absolute path to a file on your computer (e.g.,/Users/mycomputer/Documents/images/prune.jpg), the server will:
- Read the file from your disk
- Convert it to base64
- Upload it to Anki's media collection using thestoreMediaFileAPI
- Reference it in the card by filename
URLs: If you provide a URL (e.g.,https://example.com/image.jpg), Anki-Connect will download the file automatically when the card is created.
Existing Media: If you provide just a filename (e.g.,prune.jpg), it assumes the file already exists in Anki's media folder.
If images don't show up properly in Anki:
- Check the file path: Make sure the path to your image file is correct and the file exists
- File permissions: Ensure the file is readable by the application
- Supported formats: Anki supports common image formats (JPG, PNG, GIF, SVG, WebP)
- File size: Very large files might cause issues
- Special characters: Avoid special characters in filenames when possible
The server will now automatically handle local file paths, so you don't need to manually copy images to Anki's media folder anymore.
- Clone or download this repository
- Install dependencies:
npm install
Add the server configuration to your Claude Desktop config file:
MacOS:~/Library/Application Support/Claude/claude_desktop_config.json
Windows:%APPDATA%/Claude/claude_desktop_config.json
{ "mcpServers": { "anki-mcp-server": { "command": "/absolute/path/to/anki-mcp-server/build/index.js" } } }
💡Tip: Replace/absolute/path/to/anki-mcp-serverwith the actual full path to where you cloned this repository.
This server follows the standard MCP protocol and can be used with any MCP-compatible client. Configure it as a stdio-based server pointing tobuild/index.js.
- Restart Claude Desktop (or your MCP client)
- Ensure Anki is running with AnkiConnect installed
- The server should appear in your available MCP servers
- Test with a simple query like "Show me 5 due cards from Anki"
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using theMCP Inspector, which is available as a package script:
The Inspector will provide a URL to access debugging tools in your browser where you can:
- Test tool calls interactively
- View request/response logs
- Debug connection issues
- Validate tool schemas
- Verify the path in config is absolute (not relative)
- Check thatbuild/index.jsexists (runnpm run build)
- Restart Claude Desktop after config changes
"Connection refused" or timeout errors:
- Ensure Anki is running
- Verify AnkiConnect is installed (Tools → Add-ons)
- Check AnkiConnect settings allow localhost connections (default)
- Close the Anki browser if you have it open (known AnkiConnect limitation)
- Verify the deck and note type names match exactly (case-sensitive)
- Check field names match your note type's field configuration
Contributions are welcome! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.
- Fork the repositoryon GitHub
- Clone your forklocally:
git clone https://github.com/YOUR_USERNAME/anki-mcp.git cd anki-mcp
git checkout -b feature/your-feature-name
npm install npm run build npm run inspector # Test with MCP Inspector
git commit -m "Add: description of your changes"
git push origin feature/your-feature-name
- Write clean, readable TypeScript code
- Follow the existing code style and structure
- Test your changes with the MCP Inspector
- Update documentation if you're adding new features
- Keep commits focused and atomic
Found a bug or have a feature request? Please open an issue on GitHub with:
- A clear, descriptive title
- Steps to reproduce (for bugs)
- Expected vs actual behavior
- Your environment (OS, Anki version, Node version)
Feel free to open an issue for questions or join the discussion in existing issues.
This project is licensed under the MIT License - see theLICENSEfile for details.
- Built on theModel Context Protocolby Anthropic
- UsesAnkiConnectfor Anki integration
- Powered byyanki-connectnpm package
Manage Anki flashcards and decks via the AnkiConnect plugin.
Connect Claude with AnkiConnect to create and review flashcards using natural language.
Create Anki flashcards using natural language by connecting to the AnkiConnect add-on.
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.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





