# Anki [Health: Active]

**Category:** 🎓 Education  
**Repository:** https://github.com/nietus/anki-mcp  
**GitHub Stars:** 44  
**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_deck_names** — List all deck names.
- **create_deck** — Create a deck (use '::' for subdecks, e.g. 'Japanese::Verbs').
- **get_deck_model_info** — Which note types a deck uses. Call before adding cards to an existing deck to pick the right modelName and fields.
- **get_study_overview** — Today's study plan: new/learning/review counts per deck, cards reviewed today, streak, and 7/30-day review totals. A good first call for a study session.
- **get_retention_stats** — Learning analytics for a deck (subdecks included) over the last N days: true retention (young/mature), reviews per day, average seconds per review.
- **sync** — Sync the collection with AnkiWeb (user must be logged in inside Anki).
- **get_due_cards** — Get cards due for review now (learning cards first, then oldest due). Each card includes the interval every button would give (nextIntervals).
- **get_new_cards** — Get new, never-studied cards (suspended cards excluded).
- **answer_cards** — Record the user's answers to cards you quizzed them on (1=Again, 2=Hard, 3=Good, 4=Easy). Returns each card's new interval.
- **undo** — Undo the most recent action in Anki (a review, a field edit, a suspend...). One action per call.
- **find_cards** — Search cards with an Anki query and return a page of results. Choose the sections you need to keep output small; use 'fields' when you plan to edit notes.
- **suspend_cards** — Deactivate (suspend) cards so they stop appearing in reviews until unsuspend_cards is called. Scheduling (interval, ease, due date) is kept intact. Pass a label when the user will want to resume this exact group later.
- **unsuspend_cards** — Reactivate (unsuspend) cards with their original scheduling. With a label, resumes exactly the cards paused under it (cards suspended for other reasons stay suspended); list groups with manage_tags { action: 'list', prefix: 'paused' }.
- **move_cards** — Move cards to another deck (created automatically if it doesn't exist).
- **reschedule_cards** — Change card scheduling: set a due date (e.g. vacation backlog), forget (reset to new) or relearn. Reversible only via undo, so preview with dryRun on broad filters.
- **find_leeches** — Find the user's weakest cards (leech tag or many lapses), ranked by lapses and ease. Good for focused drills or rewriting confusing cards.
- **get_card_history** — Full review log of specific cards (date, button, interval change, time spent), to explain why a card keeps being forgotten.
- **add_card** — Create ONE new note. For several notes use add_bulk; to change existing notes use update_note_fields.
- **add_bulk** — Create many new notes in one call. Duplicates and invalid notes are skipped and reported with the reason. Use dryRun to check before adding.
- **add_cloze_cards** — Create cloze notes from text. Either pass 'terms' to hide (each becomes {{c1::}}, {{c2::}}...) or text that already has {{c1::...}} markup.
- **update_note_fields** — Update fields of ONE existing note. For many notes use bulk_update_notes.
- **bulk_update_notes** — Update fields of many existing notes in one call.
- **find_and_replace** — Find and replace text across notes (plain text or regex), optionally only in some fields. Returns before/after samples; use dryRun to preview.
- **delete_notes** — Permanently delete notes (and all their cards). Two steps: call without confirmToken to preview and get a token, show the preview to the user, then call again with the token after they confirm.
- **manage_tags** — Tag management: list tags (with a deck/filter it returns tag counts for those notes), add/remove tags on notes, rename a tag, or clear unused tags.
- **add_image** — Attach an image to a note field from a URL, a local file path, or base64 data. The image is stored in Anki's media folder.
- **add_card_with_audio** — Create ONE new note with Azure TTS audio generated from one of its fields.
- **update_card_with_audio** — Generate audio for ONE existing note from one of its fields.
- **bulk_generate_audio** — Generate audio for many notes at once (e.g. a whole deck). By default only notes whose audio field is empty are processed.
- **get_model_names** — List all note type (model) names.
- **get_model_details** — Fields, card templates and CSS of a note type.
- **edit_note_type_field** — Add, remove, rename or reposition a field of a note type. 'remove' deletes that field's content from every note of the type.
- **update_note_type_templates** — Replace the Front/Back HTML of card templates of a note type.
- **update_note_type_styling** — Replace the CSS of a note type.
- **create_model** — Create a new note type.

## 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_

