Labsco
captain-blue210 logo

Anki MCP Server

from captain-blue210

Connects to Anki via AnkiConnect to retrieve leech-tagged flashcards for use in Claude Desktop.

๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

Anki MCP Server

An MCP (Model Context Protocol) server for Claude Desktop that connects to Anki via AnkiConnect and retrieves leech-tagged cards.

Features

  • Connects to Anki via AnkiConnect API
  • Retrieves cards with "leech" tags
  • Adds date-stamped review tags to cards
  • Provides comprehensive card data for analysis by Claude
  • Can be used with Claude Desktop

Available Tools

get_leech_cards

Retrieves cards tagged as leeches from Anki.

Parameters:

  • detailed (optional, boolean, default: true): Whether to return comprehensive card data or just IDs
  • count (optional, number): Number of random cards to return (defaults to all cards)

tag_reviewed_cards

Adds a date-stamped "reviewed" tag to specified cards. This allows you to track which cards you've reviewed with Claude.

Parameters:

  • card_ids (required, array of numbers): Array of card IDs to tag as reviewed
  • custom_tag_prefix (optional, string, default: "่ฆ‹็›ดใ—"): Custom prefix for the tag

The tag will be in the format ่ฆ‹็›ดใ—::YYYYMMDD (or your custom prefix if specified).

Example usage in Claude:

I've reviewed these cards, please tag them as reviewed: [1234567890, 1234567891]

Testing Mode

For testing without affecting actual Anki data, you can use the mock mode:

  1. Set ANKI_MOCK_MODE=true in your .env file or use the provided .env.test file
  2. Run the server with npm run start:test

In mock mode, the server will simulate all Anki operations without actually connecting to Anki. This is useful for testing Claude integrations without risking data changes.

Development

To run the server in development mode with hot reloading:

npm run dev

For development with mock mode enabled:

npm run dev:test