A Model Context Protocol (MCP) server that enables LLM applications to interact with Anki flashcards through AnkiConnect.
- Deck Management: Get list of all available decks
- Note Creation: Add new flashcards to any deck
- Note Search: Find notes using Anki's search syntax
- Anki must be running
- AnkiConnect plugin must be installed in Anki
- Install from Anki: Tools > Add-ons > Browse & Install
- Code:
2055492159 - Restart Anki after installation
git clone https://github.com/kitagry/anki-mcp
cd anki-mcp
go buildRun the MCP server:
./anki-mcpThe server communicates via stdio and provides the following tools:
Get all deck names from Anki.
Parameters:
anki_url(optional): AnkiConnect URL (defaults to http://localhost:8765)
Add a new flashcard to Anki.
Parameters:
anki_url(optional): AnkiConnect URL (defaults to http://localhost:8765)deck_name(required): Name of the deck to add the note tomodel_name(optional): Note model name (defaults to 'Basic')front(required): Front content of the noteback(required): Back content of the notetags(optional): Comma-separated tags
Add multiple flashcards to Anki in a single operation.
Parameters:
anki_url(optional): AnkiConnect URL (defaults to http://localhost:8765)deck_name(required): Name of the deck to add the notes tomodel_name(optional): Note model name (defaults to 'Basic')notes(required): JSON array of notes with 'front', 'back', and optional 'tags' fields
Example notes format:
[
{
"front": "What is the capital of Japan?",
"back": "Tokyo",
"tags": ["geography", "capitals"]
},
{
"front": "What is 2+2?",
"back": "4",
"tags": ["math"]
}
]Find notes in Anki using a search query.
Parameters:
anki_url(optional): AnkiConnect URL (defaults to http://localhost:8765)query(required): Search query (e.g., 'deck:Default', 'tag:important')
By default, the server connects to AnkiConnect at http://localhost:8765. You can specify a different URL using the anki_url parameter in each tool call.
- mark3labs/mcp-go - Go implementation of Model Context Protocol
- AnkiConnect - Anki plugin for HTTP API access
MIT