Anki MCP Server
Provides tools for managing Anki flashcards, including creating, searching, updating, and deleting cards; managing decks; studying due cards; and working with note types.
Click on "Deploy 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 Server Search for all cards in the Spanish deck"
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
A Model Context Protocol (MCP) server that integrates with Anki flashcard application, allowing LLM applications like Claude to interact with your Anki decks and cards.
Features
Card Management: Create, search, update, and delete flashcards
Deck Management: List, create, and get statistics for decks
Study Sessions: Get cards due for review and manage study sessions
Model Support: Work with different note types and their fields
Automatic Tagging: Cards created via MCP are automatically tagged with 'mcp-generated'
Related MCP server: Anki MCP Server
Prerequisites
Anki Desktop: Install Anki desktop application
AnkiConnect Plugin: Install the AnkiConnect plugin in Anki
Go to Tools → Add-ons → Get Add-ons
Enter code:
2055492159Restart Anki
Installation
Clone this repository:
git clone <repository-url> cd anki-mcpInstall dependencies:
npm installBuild the project:
npm run build
Usage
Running the Server
Start the MCP server:
npm startFor development with auto-reload:
npm run devConfiguration with Claude Desktop
Add the server to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"anki": {
"command": "node",
"args": ["/path/to/anki-mcp/dist/index.js"],
"env": {
"ANKI_HOST": "localhost",
"ANKI_PORT": "8765"
}
}
}
}Available Tools
Connection Management
test_connection: Test connection to AnkiConnect
Card Management
create_card: Create a new flashcard
search_cards: Search for cards using Anki query syntax
update_card: Update existing card fields and tags
delete_notes: Delete notes and their associated cards
Deck Management
list_decks: List all available decks
create_deck: Create a new deck
get_deck_stats: Get statistics for a specific deck
Study Features
get_cards_for_review: Get cards that are due for review
get_model_names: List available note types/models
get_model_fields: Get field names for a specific model
Example Usage in Claude
Once configured, you can use natural language commands in Claude:
"Create a flashcard in my Spanish deck with 'hola' on the front and 'hello' on the back"
"Search for all cards in the Spanish deck"
"Show me cards that are due for review"
"Create a new deck called 'French Vocabulary'"
"What are the available note types in Anki?"
Environment Variables
ANKI_HOST: AnkiConnect host (default: localhost)ANKI_PORT: AnkiConnect port (default: 8765)
Development
Scripts
npm run build: Build TypeScript to JavaScriptnpm run dev: Run in development mode with auto-reloadnpm run watch: Watch mode for developmentnpm test: Run testsnpm run lint: Run ESLint
Project Structure
src/
├── index.ts # Entry point
├── server.ts # Main MCP server implementation
├── anki-client.ts # AnkiConnect HTTP client
└── types/
└── anki.ts # TypeScript type definitionsTroubleshooting
Connection Issues
"Cannot connect to AnkiConnect":
Ensure Anki is running
Verify AnkiConnect plugin is installed
Check that AnkiConnect is listening on port 8765
"AnkiConnect error":
Check Anki error logs
Verify deck and model names exist
Ensure required fields are provided
Configuration Issues
Server not appearing in Claude:
Verify the path to the built JavaScript file is correct
Check Claude Desktop configuration syntax
Restart Claude Desktop after configuration changes
Permission Issues:
Ensure the Node.js process has permission to execute
Check file paths are absolute and correct
API Reference
The server implements the Model Context Protocol specification and provides tools for Anki integration. Each tool includes detailed input schemas and error handling.
License
MIT License - see LICENSE file for details.
Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests for new functionality
Submit a pull request
Available Tools
11 toolscreate_cardC
Create a new flashcard in Anki
Inputs: fields (required), deckName (required), modelName (required), tags.
create_deckC
Create a new deck in Anki
Inputs: deckName (required).
delete_notesB
Delete notes (and their cards) from Anki
Inputs: noteIds (required).
get_cards_for_reviewC
Get cards that are due for review
Inputs: deckName.
get_deck_statsC
Get statistics for a specific deck
Inputs: deckName (required).
get_model_fieldsC
Get field names for a specific note type/model
Inputs: modelName (required).
get_model_namesB
Get all available note types/models
Inputs: no named parameters.
list_decksB
List all available decks in Anki
Inputs: no named parameters.
search_cardsC
Search for cards in Anki using Anki query syntax
Inputs: query (required).
test_connectionB
Test connection to AnkiConnect
Inputs: no named parameters.
update_cardC
Update an existing card in Anki
Inputs: fields (required), noteId (required), tags.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool has a largely distinct purpose, but there is an entity inconsistency: create_card/update_card/search_cards operate on 'cards' while delete_notes operates on 'notes'—a distinction that matters in Anki (a note generates multiple cards) and could cause misselection. search_cards and get_cards_for_review are close but still distinguishable.
All 11 tools follow a clean verb_noun pattern (create_card, list_decks, get_deck_stats, get_model_fields, etc.) with consistent snake_case. No deviations or mixed conventions.
11 tools is well within the ideal 3-15 range and each earns its place across cards, decks, review, and model introspection. No bloat or redundancy.
Covers card lifecycle (create/search/update/review), deck management (list/create/stats), and model introspection, but there is no card-level delete (only delete_notes), no deck update/delete, and no note-level update, leaving minor gaps an agent must work around.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Related MCP Servers
- AlicenseAqualityBmaintenanceA Model Context Protocol server that enables LLMs to interact with Anki flashcard software through AnkiConnect, allowing for creation and management of flashcards, decks, and note types.16430 npm253MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that allows LLMs to interact with Anki flashcard software, enabling functions like creating decks, adding notes, searching cards, and managing flashcard content through natural language.430 npm1MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that bridges Claude AI with Anki flashcard app, allowing users to create and manage flashcards using natural language commands.10MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables interaction with Anki flashcards through AnkiConnect, providing organized tools for managing decks, notes, cards, models, and media files.407MIT