Skip to main content
Glama

anki-mcp

License: MIT Python 3.13+ CI

MCP server for Anki via AnkiConnect — create, search, and manage flashcards directly from Claude Code or any MCP client.

Features

  • Card CRUD — create (bulk with duplicate detection), search, update, delete

  • Deck management — list, create (supports :: hierarchy)

  • Archive & sync — export/import .apkg files, trigger AnkiWeb sync

  • Progress analytics — deck maturity, Interest Heat Score (which topics you retain best), study streak

  • Conversation extraction — /anki extract scans a conversation for learnable moments and proposes cards

  • Daily progress script — cron-friendly report generator that reads Anki's SQLite directly

  • Claude Code skill — interactive card creation via /anki slash command

Related MCP server: TalkToAnki

Requirements

Installation

git clone https://github.com/chaosisnotrandomitisrhythmic/anki-mcp.git
cd anki-mcp
uv sync

Usage

Add to your MCP config (~/.claude/settings.json, project .mcp.json, or Claude Desktop config):

{
  "mcpServers": {
    "anki": {
      "command": "uv",
      "args": ["--directory", "/path/to/anki-mcp", "run", "anki-mcp"]
    }
  }
}

Tools

Tool

Description

add_notes

Create flashcards (bulk, with duplicate detection)

search_notes

Find cards using Anki query syntax

update_note

Edit a card's fields or tags

delete_notes

Remove cards by ID

list_decks

All decks with card counts (new/learn/review)

create_deck

Create a deck (supports :: hierarchy)

export_deck

Export deck to .apkg (optionally archive + delete)

import_deck

Restore .apkg from archive

sync

Trigger AnkiWeb sync

progress

Learning report with Interest Heat Score

health

Check AnkiConnect connectivity

Configuration

All configuration is via environment variables with sensible defaults:

Variable

Description

Default

ANKI_MCP_ARCHIVE_DIR

Directory for .apkg exports/imports

~/.local/share/anki-mcp/archive

ANKI_DB_PATH

Path to Anki's collection.anki2

Platform-aware (macOS: ~/Library/Application Support/Anki2/User 1/collection.anki2, Linux: ~/.local/share/Anki2/User 1/collection.anki2)

ANKI_MCP_OUTPUT_DIR

Directory for daily progress reports

~/Anki Progress

Daily Progress Script

A standalone script that reads Anki's SQLite database and generates a Markdown progress report. Works even when Anki is running (read-only via WAL mode).

# Run manually
cd /path/to/anki-mcp && uv run python scripts/daily_progress.py

# Cron example (daily at 7:03 AM)
3 7 * * * cd /path/to/anki-mcp && uv run python scripts/daily_progress.py

The report includes deck overview, Interest Heat Score, and study streak.

Claude Code Skill

The skills/SKILL.md file provides a Claude Code skill for interactive card creation. It supports:

  • /anki — manual card creation

  • /anki extract — scan conversation for extractable knowledge and create cards

  • /anki progress — show learning progress

Uninstallation

  1. Remove the anki entry from mcpServers in your MCP config

  2. Optionally remove the skill: rm -rf ~/.claude/skills/anki/

  3. Optionally delete the archive directory (~/.local/share/anki-mcp/ by default)

  4. Remove the repo: rm -rf /path/to/anki-mcp

Your Anki cards are stored in Anki itself — nothing is lost by removing this server.

Contributing

See CONTRIBUTING.md.

Security

See SECURITY.md.

License

MIT

Available Tools

11 tools
add_notesA

Create flashcards in Anki. Handles bulk creation with duplicate detection.

Args: notes: List of notes, each with front, back, tags, deck, model

Returns: Count of added/skipped cards and any errors

Inputs: notes (required). Returns: result

create_deckA

Create a new deck. Supports :: for nested hierarchy (e.g. 'AWS::IAM').

Args: name: Deck name (use :: for sub-decks)

Returns: Deck ID of the created deck

Inputs: name (required). Returns: result

delete_notesC

Delete cards by their note IDs.

Args: note_ids: List of note IDs to delete

Returns: Confirmation of deletion

Inputs: note_ids (required). Returns: result

export_deckA

Export a deck to .apkg file in the configured archive directory.

Args: deck: Deck name to export archive: If true, also delete the deck from Anki after export

Returns: Path to the exported .apkg file

Inputs: deck (required), archive. Returns: result

healthA
Read-only

Check if AnkiConnect is reachable and get Anki version.

Returns: Connection status and Anki version info

Inputs: no named parameters. Returns: result

import_deckA

Import/restore a .apkg file from the archive directory.

Args: filename: Name of the .apkg file in the configured archive directory

Returns: Confirmation of import

Inputs: filename (required). Returns: result

list_decksA
Read-only

List all Anki decks with card counts.

Returns: All decks with new/learn/review counts and total cards

Inputs: no named parameters. Returns: result

progressA
Read-only

Show learning progress: deck maturity, Interest Heat Score, study consistency.

Interest Heat Score ranks tags by how well knowledge consolidates — high scores reveal where genuine interest lives (effortless retention).

Syncs with AnkiWeb first to include mobile reviews.

Args: deck: Optional deck name to scope the report (default: all decks) top_n: Number of top tags to show in heat ranking (default: 15)

Returns: Markdown report with deck overview, interest heat, and study streak

Inputs: deck, top_n. Returns: result

search_notesA
Read-only

Search for existing cards using Anki query syntax.

Examples: 'deck:Default', 'tag:python', 'front:terraform', 'added:7' (last 7 days), 'deck:AWS tag:iam'

Args: query: Anki search query string limit: Max results to return (default 20)

Returns: Matching notes with their fields, tags, and IDs

Inputs: query (required), limit. Returns: result

syncA

Trigger AnkiWeb sync.

Returns: Confirmation that sync completed

Inputs: no named parameters. Returns: result

update_noteA

Edit an existing card's fields or tags.

Args: note_id: The note ID (from search_notes results) front: New front field content (optional) back: New back field content (optional) tags: New tag list — replaces all existing tags (optional)

Returns: Confirmation of update

Inputs: note_id (required), back, tags, front. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool targets a distinct operation (note CRUD, deck management, import/export, sync, progress, health) with no overlapping purposes. Even similar operations like add_notes and update_note are clearly differentiated by their descriptions.

    Naming Consistency4/5

    The dominant pattern is verb_noun (add_notes, search_notes, list_decks, export_deck), but a few single-word tools (sync, progress, health) deviate. These are still unambiguous and readable, so only a minor inconsistency exists.

    Tool Count5/5

    11 tools are well-scoped for an Anki MCP server, covering note management, deck operations, backup/restore, sync, and analytics without unnecessary bloat. Count falls comfortably in the ideal range.

    Completeness4/5

    Core CRUD for notes is complete (add, search, update, delete). Deck management lacks a direct delete_deck tool, though export_deck's archive option provides an indirect workaround. Sync and progress round out the lifecycle, leaving only minor gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      An MCP server that enables AI assistants like Claude to interact with Anki flashcard decks, allowing users to create, manage, and update flashcards through natural language conversations.
      9
      45
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that enables AI assistants to seamlessly manage Anki flashcards, decks, and templates through the AnkiConnect API. It supports intelligent querying, batch note creation, and detailed study progress analysis using natural language.
      4
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      An MCP server that enables Claude Code to create, manage, and search Anki flashcards directly from the terminal. It supports batch card creation, deck statistics retrieval, and synchronization with AnkiWeb for cross-platform review.
      8
      -