home / mcp / anki mcp server

Anki MCP Server

Anki MCP lets you have a conversation with your flashcards

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

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-mcp

Additional sections

Configuration 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": []
    }
  }
}

Troubleshooting

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.

Available tools

Manage Flashcards

Create, update, delete, and search flashcards for content creation, bulk updates, and organization.

Study Sessions

Run interactive quizzes, manage scheduling, and track review needs.

Manage Decks

Organize decks, move cards, and set deck-level options.

Get Analytics

Access study statistics, review history, and learning patterns.

Manage Models

Customize note types, add fields, templates, and styling for cards.

Anki Operations

Handle sync, media, imports/exports, and other utility tasks.

Get Media File

Retrieve media from your Anki collection for AI analysis.