Skip to main content

Connect Claude conversations with AnkiConnect via MCP to make spaced repetition as easy as "Help me remember this"

Project description

mcp-ankiconnect MCP server

Connect Claude conversations with AnkiConnect via MCP to make spaced repetition as easy as "Let's go through today's flashcards" or "Make flashcards for this"

Components

Tools

The server implements three tools:

  • num_cards_due_today: Get the number of cards due today

    • Optional deck argument to filter by specific deck
    • Returns count of due cards across all decks or specified deck
  • get_due_cards: Get cards that are due for review

    • Optional limit argument (default: 5) to control number of cards
    • Optional deck argument to filter by specific deck
    • Optional today_only argument (default: true) to show only today's cards
    • Returns cards in XML format with questions and answers
  • submit_reviews: Submit answers for reviewed cards

    • Takes list of reviews with card_id and rating
    • Ratings: "wrong", "hard", "good", "easy"
    • Returns confirmation of submitted reviews

Configuration

Prerequisites

  • Anki must be running with AnkiConnect plugin installed (plugin id 2055492159) AnkiConnect can be slow on Macs due to the AppSleep feature, so disable it for Anki. To do so run the following in your terminal.
    defaults write net.ankiweb.dtop NSAppSleepDisabled -bool true
    defaults write net.ichi2.anki NSAppSleepDisabled -bool true
    defaults write org.qt-project.Qt.QtWebEngineCore NSAppSleepDisabled -bool true
    

Installation

Quickstart

  1. Install the AnkiConnect plugin in Anki:

    • Tools > Add-ons > Get Add-ons...
    • Enter code: 2055492159
    • Restart Anki
  2. Configure Claude Desktop:

    On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

    Add this configuration:

    {
      "mcpServers": {
        "mcp-ankiconnect": {
          "command": "uv",
          "args": ["run", "--with", "mcp-ankiconnect==0.3.1", "--with", "mcp[cli]==1.2.0rc1", "mcp-ankiconnect"]
        }
      }
    }
    
  3. Restart Anki and Claude desktop

Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector. First, clone the repository and install the dependencies:

git clone https://github.com/samefarrar/mcp-ankiconnect.git
cd mcp-ankiconnect
uv sync

You can launch the MCP Inspector via the mcp CLI:

uv run mcp dev mcp_ankiconnect/server.py

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_ankiconnect-0.3.2.tar.gz (75.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_ankiconnect-0.3.2-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file mcp_ankiconnect-0.3.2.tar.gz.

File metadata

  • Download URL: mcp_ankiconnect-0.3.2.tar.gz
  • Upload date:
  • Size: 75.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for mcp_ankiconnect-0.3.2.tar.gz
Algorithm Hash digest
SHA256 3aeb2fe9e90d227bc135a13a5ba20cdcf169633bb5a1c9fe2a25cce25bf91dff
MD5 037fe5e8f7d10336986fa44cd1e5df06
BLAKE2b-256 d347a366d5abaaa85760618b4faa22cf760f2877bef24c31e2ebf0a894f5f8c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_ankiconnect-0.3.2.tar.gz:

Publisher: python-publish.yml on samefarrar/mcp-ankiconnect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_ankiconnect-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_ankiconnect-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 31a43e34b98ee3e94f2aa21ef6f20ee02526e40e682200ddcd3dfd275490ad41
MD5 a5c63dd8898a09867a6ba9f4af31988d
BLAKE2b-256 fb5fdd5bcb9c26233da805842d81e8db2c6acc68c6f7346441c5400d1c2d1b3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_ankiconnect-0.3.2-py3-none-any.whl:

Publisher: python-publish.yml on samefarrar/mcp-ankiconnect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page