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.
README
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'
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:
2055492159 - Restart Anki
Installation
-
Clone this repository:
git clone <repository-url> cd anki-mcp -
Install dependencies:
npm install -
Build the project:
npm run build
Usage
Running the Server
Start the MCP server:
npm start
For development with auto-reload:
npm run dev
Configuration 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 definitions
Troubleshooting
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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.