Anki MCP Server
@greycodee
This project provides an MCP (Model Context Protocol) server that bridges communication with the AnkiConnect add-on for Anki.
Overview
What is Anki MCP Server?
Anki MCP Server bridges the Model Context Protocol (MCP) to the Anki spaced repetition software via the Anki-Connect add-on. It allows MCP-compatible clients, such as AI assistants, to interact with your Anki collection by managing decks, cards, and notes.
How to use Anki MCP Server?
Install dependencies with uv sync after cloning the repository. Start the server by running uv run python main.py (stdio transport), or uv run mcp dev main.py for interactive testing, or uv run mcp install main.py --name "Anki Bridge" to register with Claude Desktop. Before using any tool, call anki_request_permission to authorize the connection.
Key features of Anki MCP Server
- Deck management: create, list, delete, move cards, get stats.
- Card management: find, suspend, unsuspend, forget, relearn.
- Note management: add, update, find, tag, and delete notes.
- Model management: list note types and their fields.
- Synchronization with AnkiWeb via
anki_sync. - Exposes a comprehensive set of Anki-Connect actions as MCP tools.
Use cases of Anki MCP Server
- Automate flashcard creation from AI-generated content.
- Bulk update or tag notes across an Anki collection.
- Move cards between decks for better organization.
- Suspend or relearn cards programmatically.
- Sync the local collection with AnkiWeb from a connected client.
FAQ from Anki MCP Server
What are the prerequisites?
You need Anki installed and running, the Anki-Connect add-on installed and listening on http://127.0.0.1:8765, Python (compatible version), and uv for environment management.
How do I run the server?
You can run it directly via uv run python main.py, in development mode with uv run mcp dev main.py, or install it for Claude Desktop using uv run mcp install main.py --name "Anki Bridge".
What is the first action I should take?
Call anki_request_permission first. If the client’s origin isn’t trusted, a confirmation popup will appear in Anki.
Can I change the Anki-Connect URL?
Yes. The server uses the ANKICONNECT_URL constant in main.py (default http://127.0.0.1:8765). You can modify this constant to use a different address or port.
How do I install it for Claude Desktop?
Run uv run mcp install main.py --name "Anki Bridge". This makes the Anki tools available within the Claude Desktop assistant.