# Anki [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/nietus/anki-mcp  
**GitHub Stars:** 40  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/anki

## Description
Study and manage Anki flashcards via AnkiConnect: quizzes, stats, leeches, bulk edits.

## Tools
Capabilities this server exposes over MCP:

- **get_study_overview** — Today's new/learning/review counts per deck, cards reviewed today, streak, 7/30-day totals.
- **get_due_cards** — num` cards to study (optionally from one `deckName`), with the interval each button would give.
- **answer_cards** — Record answers (`cardId`, `ease` 1-4) and get each card's new interval. *(Previously `update_cards`.)*
- **find_leeches** — Weakest cards (leech tag / many lapses), ranked by lapses and ease.
- **get_card_history** — Full review log of up to 20 cards.
- **get_retention_stats** — True retention (young/mature), reviews per day and time spent for a deck over N days.
- **undo** — Undo the last action in Anki.
- **find_cards** — Paginated search (`query`, `limit`, `offset`); pick the sections to return with `include`: `question`, `answer`, `fields`, `stats`.
- **suspend_cards** — Deactivate/reactivate cards, e.g. all cards with tag X in deck Y. Scheduling is preserved. Pass a `label` when suspending (notes get the tag `paused::<label>`) and `unsuspend_cards { label }` later resumes exactly that group, leaving cards suspended for other reasons alone.
- **move_cards** — Move cards to `targetDeck` (created if missing).
- **reschedule_cards** — set_due_date` (`days`: `0`, `1!`, `3-7`), `forget` (reset to new) or `relearn`.
- **add_card** — Create one note.
- **add_bulk** — Create many notes; duplicates/invalid notes are skipped and reported with the reason.
- **add_cloze_cards** — Create cloze notes from text plus `terms` to hide, or text with `{{c1::...}}` markup.
- **update_note_fields** — Edit fields of existing notes.
- **find_and_replace** — Plain or regex replace across notes, optionally limited to some `fields`.
- **manage_tags** — list` (with a filter: tag counts), `add`, `remove`, `rename`, `clear_unused`.
- **add_image** — Add an image to a field from a `url`, local `path` or base64 `data`.
- **delete_notes** — Two-step delete: the first call previews and returns a `confirmToken`, the second call (with the token) deletes.
- **add_card_with_audio** — Create a note with audio generated from `sourceField` into `audioField`.
- **update_card_with_audio** — Generate audio for one existing note.
- **bulk_generate_audio** — Generate audio for many notes (by default only those with an empty audio field), `limit` per call.
- **get_deck_names** — List or create decks.
- **get_deck_model_info** — Which note types a deck uses (call before adding cards to it).
- **get_model_names** — List note types / fields, templates and CSS of one.
- **edit_note_type_field** — add`, `remove`, `rename` or `reposition` a field.
- **update_note_type_templates** — Replace templates or CSS.
- **create_model** — Create a note type.
- **sync** — Sync with AnkiWeb.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "anki": {
    "command": "npx",
    "args": ["-y","github:nietus/anki-mcp"]
  }
}
```

## Documentation

## What the Anki MCP server does

The Anki MCP server lets an MCP-compatible client work with an Anki collection through AnkiConnect. It supports both study workflows and collection maintenance. An agent can inspect today's workload, retrieve cards due for review, record answers, examine review history, identify leeches, and calculate retention metrics for a deck over a selected period.

Collection-management tools cover card selection, scheduling, suspension, deck moves, note creation, field updates, tag operations, image insertion, and deletion. Bulk operations can target a deck, matching tags, an Anki search query, or explicit card and note IDs. Bulk writes can be previewed with a dry-run option, and note deletion uses a preview followed by a confirmation token.

## How it works

The server communicates with Anki through the AnkiConnect add-on. Anki must be running for requests to reach the collection; connection errors are returned as readable tool results rather than being silently ignored. The default connection uses `http://127.0.0.1` on port `8765`, with an optional API key if AnkiConnect has been configured to require one.

Study interactions can be handled conversationally. The client can retrieve due cards, present questions, submit ease values from 1 through 4, and receive the resulting intervals. Named suspension labels add a `paused::<label>` tag, allowing a later unsuspend operation to restore that particular group without reactivating cards suspended for another reason.

## Setup and configuration

Install Node.js 18 or newer, Anki, and the AnkiConnect add-on using code `2055492159`. In Claude Code, the repository can be registered with `npx -y github:nietus/anki-mcp`. Other MCP clients can use a stdio configuration that launches the same command. The project can also be cloned, installed with npm, built, and started from its generated `build/client.js` entry point.

The Anki MCP server has no mandatory environment variables. `ANKI_CONNECT_HOST`, `ANKI_CONNECT_PORT`, and `ANKI_CONNECT_KEY` adjust the AnkiConnect connection. Audio features additionally use `AZURE_API_KEY`; `AZURE_REGION` selects the Azure Speech region and defaults to `eastus`. Without the Azure key, the regular study and collection tools remain available, but audio generation is not enabled.

## Tools and capabilities

- Review study totals, streaks, due cards, retention, review history, and leeches.
- Search cards with pagination and choose whether to return questions, answers, fields, or statistics.
- Add individual, bulk, and cloze notes while reporting skipped duplicates or invalid entries.
- Move, reschedule, suspend, unsuspend, edit, tag, and delete cards or notes.
- Create decks and note types, inspect models, change fields, and replace templates or CSS.
- Add images from URLs, local paths, or base64 data.
- Generate audio for new or existing notes through Azure Text-to-Speech, including bulk generation with a per-call limit.
- Undo the most recent Anki action and synchronize with AnkiWeb.

## Limitations and notes

The server depends on Anki and AnkiConnect being available locally or at the configured host and port. Audio generation is a separate capability that depends on Azure credentials. Before adding cards, inspect the destination deck's model information so the note type and fields match the intended content. Scheduling changes, bulk edits, and deletion affect the connected collection, so previews, labels, and the deletion confirmation step should be used where appropriate.

_Full upstream README: https://allmcps.com/mcp/anki/readme_

