Provides programmatic access to Anki flashcard operations via the AnkiConnect API, enabling users to list existing decks and cards, as well as create new decks and flashcards within the Anki desktop application.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Anki MCP ServerAdd a card to 'Python' with front 'What is PEP 8?' and back 'The Python style guide'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Anki MCP Server
MCP server providing programmatic access to Anki flashcard operations via AnkiConnect API.
Features
list_decks - List all Anki decks
list_cards - List all flashcards in a specific deck
create_deck - Create a new Anki deck
create_card - Create a new flashcard in a deck
Prerequisites
Before using this MCP server, you must have:
Anki desktop application installed and running
AnkiConnect plugin installed in Anki
Plugin ID: 2055492159
Install from: https://ankiweb.net/shared/info/2055492159
Or install via Anki: Tools → Add-ons → Get Add-ons → Enter code
2055492159
Verifying AnkiConnect Installation
After installing AnkiConnect, verify it's working:
You should see a response like: {"result": 6, "error": null}
If you get a connection error, make sure Anki is running.
Installation
Using uv (recommended)
Using pip
Configuration
Add the server to your MCP client configuration (e.g., claude_desktop_config.json):
Replace /absolute/path/to/mcp-server-anki with the actual path to the project directory.
Alternative Configuration (without uv)
Usage
List Decks
Response:
Create Deck
Response:
Create Card
Response:
List Cards
Response:
Example Workflow
This will:
Create the deck "System Design"
Add the flashcard to the deck
Confirm both operations succeeded
Error Handling
Anki Not Running
If Anki is not running or AnkiConnect is not installed:
Solution: Start Anki and ensure AnkiConnect is installed.
Deck Not Found
If you try to list cards from a non-existent deck:
Solution: Create the deck first or check the deck name spelling.
Card Creation Failed
If you try to create a card in a non-existent deck:
Solution: Ensure the deck exists or check for duplicate cards.
Limitations
Only supports "Basic" note type (two-sided cards)
No support for custom note types
No card editing or deletion
No deck editing or deletion
No media attachments (images/audio)
Only works with local Anki instance on localhost:8765
Development
Project Structure
Running Tests Manually
Start Anki with AnkiConnect installed
Use the MCP client to test each operation:
List existing decks
Create a new deck
Create a card in the deck
List cards in the deck
Test error conditions (Anki not running, deck not found)
Troubleshooting
"Could not connect to Anki"
Verify Anki is running
Verify AnkiConnect is installed (Tools → Add-ons)
Test AnkiConnect with curl (see verification section above)
"Deck not found"
Deck names are case-sensitive
Check spelling and capitalization
List all decks to see available names
"Cannot create note because it is a duplicate"
Anki prevents duplicate cards by default
Either use different content or allow duplicates in Anki settings
License
MIT
Links
AnkiConnect: https://github.com/FooSoft/anki-connect
Anki: https://apps.ankiweb.net/
MCP: https://modelcontextprotocol.io/