Skip to content

obviyus/anki-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

anki-mcp

A read-only Model Context Protocol server for Anki via AnkiConnect. Query your flashcard collection, track study progress, and get spaced repetition insights—all from Claude or any MCP-compatible client.

Prerequisites

  1. Anki DesktopDownload
  2. AnkiConnect Add-on — Install from Anki:
    • Tools → Add-ons → Get Add-ons...
    • Code: 2055492159
    • Restart Anki

Installation

bun install

Usage

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "anki": {
      "command": "bun",
      "args": ["run", "/path/to/anki-mcp/src/index.ts"]
    }
  }
}

Standalone

bun run src/index.ts

Tools

Decks

Tool Description
list_decks List all deck names
get_deck_stats Get statistics (cards due, new, learning, review counts)
get_deck_config Get deck configuration (new cards/day, review limit, lapse settings)

Cards

Tool Description
search_cards Search using Anki query syntax (deck:Default, tag:marked, is:due)
get_cards_info Get detailed info (fields, deck, lapses, reps, interval, ease)
get_card_ease_factors Get ease factors (2500 = 250%)
get_card_intervals Get current intervals (negative = seconds, positive = days)
check_cards_due Check if cards are due for review
check_cards_suspended Check if cards are suspended

Notes

Tool Description
search_notes Search for notes using Anki query syntax
get_notes_info Get detailed note info (fields, tags, model)
list_tags List all tags in the collection

Statistics

Tool Description
get_cards_reviewed_today Cards reviewed today
get_review_history Daily review counts over time
get_collection_stats_html Full collection statistics report (HTML)
get_card_reviews Review records for a deck (includes time spent)
get_reviews_of_cards Complete review history for specific cards
get_retention_trend Retention rate over time (daily/weekly)
get_deck_progress Deck breakdown (mature/young/unseen cards)
get_forecast Upcoming review workload forecast
get_time_stats Time spent studying with hour-of-day patterns

Models

Tool Description
list_models List all note types (models)
get_model_fields Get field names for a note type

Analysis

Tool Description
find_lapsed_cards Find cards with the most lapses (struggle cards)
find_low_ease_cards Find cards with low ease factor (difficult cards)
calculate_retention Calculate retention rate from review history
get_study_summary Comprehensive study summary for coaching

Examples

"What's my study streak?"

→ get_study_summary

"Show me cards I struggle with"

→ find_lapsed_cards { "deck": "Japanese", "minLapses": 3 }

"How's my retention trending?"

→ get_retention_trend { "deck": "Spanish", "days": 30, "granularity": "weekly" }

"What's my workload this week?"

→ get_forecast { "days": 7 }

About

CLI MCP for Anki using AnkiConnect

Resources

Stars

Watchers

Forks

Contributors