Anki MCP lets you have a conversation with your flashcards
Configuration
View docs{
"mcpServers": {
"arielbk-anki-mcp": {
"url": "http://127.0.0.1:3000/mcp",
"headers": {
"ANKI_CONNECT_HOST": "localhost",
"ANKI_CONNECT_PORT": "8765"
}
}
}
}Expressly designed to bridge your Anki flashcards with AI tutors, this MCP server lets you chat with AI about your decks, generate content, and gain actionable study insights. It connects your Anki collection via AnkiConnect to enable natural conversations, smart analytics, and bulk operations with compatible MCP clients.
You connect an MCP client (for example Claude Desktop) to the Anki MCP server to talk with your flashcards. Start by ensuring Anki is running with AnkiConnect enabled, then configure your client to point at the local MCP endpoint. With this setup you can ask the AI to quiz you on decks, generate new cards, review analytics, and perform bulk updates across your collection. The server supports both local stdio connections and a local HTTP endpoint, so you can choose the transport that fits your workflow.
Prerequisites: you need Node.js (version 18 or newer) and PNPM installed on your system.
# Install the MCP package globally
npm install -g @arielbk/anki-mcp
# Alternatively, use the package via PNPM in a project workspace
pnpm add -D @arielbk/anki-mcpConfiguration details: AnkiConnect runs at localhost:8765 by default. Ensure Anki is open and AnkiConnect is installed before starting the MCP server. You may override host/port via environment variables when starting the server or configuring your MCP client.
Transport options and startup: You can run the MCP server in two primary ways. For a local stdio (command-line) setup, run the included CLI command. For a localhost HTTP transport, start the server so clients can connect over HTTP at the standard MCP endpoint.
{
"mcpServers": {
"anki": {
"type": "stdio",
"name": "anki",
"command": "anki-mcp",
"args": []
}
}
}
```
```json
{
"mcpServers": {
"anki_http": {
"type": "http",
"name": "anki_http",
"url": "http://127.0.0.1:3000/mcp",
"args": []
}
}
}Common issues include failing to connect to AnkiConnect or not seeing decks. Make sure Anki is running, AnkiConnect is installed and enabled, and the MCP server can reach localhost:8765 by default. If you modify host/port, align your client configuration accordingly.
Create, update, delete, and search flashcards for content creation, bulk updates, and organization.
Run interactive quizzes, manage scheduling, and track review needs.
Organize decks, move cards, and set deck-level options.
Access study statistics, review history, and learning patterns.
Customize note types, add fields, templates, and styling for cards.
Handle sync, media, imports/exports, and other utility tasks.
Retrieve media from your Anki collection for AI analysis.