Anki Connect MCP Server
Enables AI assistants to interact with Anki flashcard collections through the AnkiConnect add-on, allowing creation, modification, searching, and management of flashcards and decks.
README
Anki Connect MCP Server
A Model Context Protocol (MCP) server that provides seamless integration with Anki through the AnkiConnect add-on. This server enables AI assistants and other MCP clients to interact with your Anki flashcard collection programmatically.

What is Anki Connect?
AnkiConnect is a powerful Anki add-on that exposes Anki's functionality through a REST API. It allows external applications to:
- Create, modify, and delete flashcards
- Manage decks and their configurations
- Control Anki's GUI programmatically
- Search and retrieve card information
- Manage tags and note types
- Perform bulk operations on cards and notes
What is MCP (Model Context Protocol)?
The Model Context Protocol is a standardized way for AI assistants to connect to external data sources and tools. This MCP server acts as a bridge between MCP clients (like Claude Desktop) and AnkiConnect, allowing AI assistants to help you manage your Anki flashcards naturally through conversation.
Features
This MCP server provides comprehensive access to AnkiConnect functionality through the following tools:
Flashcard Management
create_flashcard()- Create new flashcards with front and back contentadd_note()- Add notes with custom fields and tagsadd_notes()- Bulk add multiple notesupdate_note_fields()- Update existing note fieldsfind_notes()- Search for notes using Anki's query syntax
Deck Management
deck_names()- Get all deck namesdeck_names_and_ids()- Get deck names with their IDschange_deck()- Move cards between decksdelete_decks()- Delete decks and optionally their cardsget_deck_config()- Retrieve deck configuration settings
Card Operations
find_cards()- Search for cardscards_info()- Get detailed card informationsuspend()/unsuspend()- Suspend/unsuspend cardsare_suspended()/are_due()- Check card status
GUI Control
gui_deck_browser()- Open deck browsergui_deck_review()- Start deck reviewgui_browse()- Open card browser with searchgui_add_cards()- Open add cards dialog
Utility Tools
version()- Get AnkiConnect versionget_tags()- Retrieve all tagsmulti()- Execute multiple AnkiConnect requests in batch
Prerequisites
1. Install AnkiConnect Add-on
- Open Anki
- Go to Tools → Add-ons
- Click Get Add-ons...
- Enter the code:
2055492159 - Click OK and restart Anki
2. Configure AnkiConnect (Optional)
AnkiConnect works out of the box, but you can customize its settings:
- Go to Tools → Add-ons
- Select AnkiConnect and click Config
- Modify settings if needed (default port is 8765)
- Restart Anki after making changes
Installation
- Clone this repository:
git clone https://github.com/spacholski1225/anki-connect-mcp.git
cd anki-connect-mcp
- Install dependencies:
npm install
- Build the project:
npm run build
MCP Client Configuration
Claude Desktop
To use this MCP server with Claude Desktop, add the following configuration to your MCP settings file:
Location of MCP configuration file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Configuration Options:
Option 1: Using Node.js (Local Installation)
{
"mcpServers": {
"anki-connect-mcp": {
"command": "node",
"args": [
"dist/index.js"
],
"env": {},
"disabled": false,
"alwaysAllow": [
"deck_names",
"cards_info",
"deck_names_and_ids",
"gui_deck_browser"
]
}
}
}
Option 2: Using npx (NPM Package)
Then configure your MCP client:
{
"mcpServers": {
"anki-connect": {
"command": "npx",
"args": [
"@spacholski1225/anki-connect-mcp"
],
"env": {},
"disabled": false,
"alwaysAllow": [
"deck_names",
"cards_info",
"deck_names_and_ids",
"gui_deck_browser"
]
}
}
}
Option 3: Using Docker
{
"mcpServers": {
"anki-connect": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--network=host",
"-e", "ANKI_CONNECT_URL=http://host.docker.internal:8765",
"spacholski/anki-connect-mcp:latest"
],
"env": {},
"disabled": false,
"alwaysAllow": [
"deck_names",
"cards_info",
"deck_names_and_ids",
"gui_deck_browser"
]
}
}
}
Docker-Specific AnkiConnect Configuration:
When using the Docker option, you must configure AnkiConnect with specific settings to allow Docker container access:
- Go to Tools → Add-ons in Anki
- Select AnkiConnect and click Config
- Update the configuration with the following settings:
{
"apiKey": null,
"apiLogPath": null,
"ignoreOriginList": [],
"webBindAddress": "0.0.0.0",
"webBindPort": 8765,
"webCorsOriginList": [
"http://localhost",
"http://host.docker.internal",
"http://host.docker.internal:3000"
]
}
Key Docker Configuration Points:
webBindAddress: "0.0.0.0"- Allows AnkiConnect to accept connections from any IP address (required for Docker containers)webCorsOriginList- Must include"http://host.docker.internal"and related origins to allow cross-origin requests from Docker containers- Restart Anki after making these configuration changes
Important Notes:
- For Node.js option: Replace the path in
argswith the actual path to your builtindex.jsfile - For npx option: Uses the published NPM package
@spacholski1225/anki-connect-mcp- no local installation required - For Docker option: Uses the pre-built Docker image
spacholski/anki-connect-mcp:latest - The
alwaysAllowarray contains tools that won't require confirmation each time - Make sure Anki is running with AnkiConnect enabled before using the MCP server
- For Docker option, the
--network=hostflag allows the container to access AnkiConnect on the host machine
Usage Examples
Once configured with an MCP client like Claude Desktop, you can interact with your Anki collection naturally:
- "Create a flashcard about the capital of France"
- "Show me all my deck names"
- "Find all cards tagged with 'vocabulary'"
- "Suspend all cards in the 'Difficult Words' deck"
- "Open the deck browser in Anki"
Troubleshooting
Common Issues
- Connection refused: Make sure Anki is running and AnkiConnect is installed
- Port conflicts: Check if port 8765 is available or configure AnkiConnect to use a different port
- Permission errors: Ensure the MCP server has proper file system permissions
- Tool not found: Verify the MCP client configuration and restart the client
Contributing
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
License
ISC License
References
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
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
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.