Anki MCP Server
v2.0.0MCP server for integrating with Anki flashcards through conversational AI
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
manage_flashcards Manage flashcards
Create, search, inspect, edit, tag and delete Anki notes (flashcards) in the local collection via AnkiConnect. Use this for card content; use manage_decks for deck structure/limits, manage_models for note-type fields and templates, and manage_scheduling for review state (due cards, answering, suspend/unsuspend). For guidance on writing effective cards, use the "writing_good_flashcards" prompt. Operations (set `operation`, then the listed parameters): - create: add one note. Needs deckName, modelName, fields; optional tags, allowDuplicate, duplicateScope. Writes immediately. - create_batch: ad…
| Parameter | Type | Description |
|---|---|---|
operation * | string | Which operation to run; see the tool description for required parameters |
allowDuplicate | boolean | create/create_batch: add notes even if the first field duplicates an existing note (default false) |
cardIds | array | get_info: card IDs (max 50) |
chunkSize | integer | create_batch: notes per AnkiConnect request (default 10) |
deckName | string | create: target deck (required). create_batch: default deck for notes without their own deckName |
dryRun | boolean | create_batch: validate every note and report problems without writing anything. add_tags/remove_tags: report how many notes match (and sample IDs) without changing them. Rejected for other operations |
duplicateScope | string | create/create_batch: where to look for duplicates: "collection" (default) or only the target "deck" |
fields | object | create/update: field name -> value (HTML allowed). Names must match the note type, e.g. { "Front": "...", "Back": "..." } |
filePath | string | create_batch: absolute path to a .json (array of notes like `notes`), .csv or .tsv file. CSV/TSV: header row = field names, plus optional "tags" (space-separated), "deck" and "model" columns. Use inst… |
format | string | find: "lines" (default, one line per note/group) or compact single-line JSON |
groupBy | string | find: return counts per tag/deck/model ({notes, cards, new, seen}) or per scheduling state, over ALL matches, instead of a listing |
include | array | find: what each listed note carries (default ["fields"]; [] = IDs only). fields = field text (HTML stripped, truncated), tags, deck, model, state = per-card queue/interval/due/reps/lapses/ease, cards… |
includeDetails | boolean | find: shorthand for include: all of fields, tags, deck, model, state, cards |
limit | integer | find: max notes per page (default 50) |
maxFieldChars | integer | find: truncate each field to this many characters (default 120; 0 = no limit) |
modelName | string | create: note type (required), e.g. "Basic". create_batch: default note type for notes without their own. Use manage_models list for field names |
noteId | number | update: ID of the note to change |
noteIds | array | delete/add_tags/remove_tags: note IDs to act on (add_tags/remove_tags: or use query) |
notes | array | create_batch: notes to add (or use filePath instead) |
offset | integer | find: notes to skip, for paging (default 0); use the returned next offset |
query | string | find (and add_tags/remove_tags instead of noteIds): Anki search query, e.g. 'deck:"Spanish" tag:verbs', "is:new", "rated:2:1" (answered Again in the last 2 days), "prop:ivl>=21" |
tags | array | create: tags for the note. create_batch: added to every note. update: replaces the note's tags. add_tags/remove_tags: tags to add/remove |
manage_scheduling Manage scheduling and review state
Run a quiz and change review state (answer, suspend, unsuspend, reset, relearn, reposition new cards) in the local Anki collection. Use this to get due card IDs and act on them; use manage_decks get_stats for due counts, get_analytics for progress and history, and manage_flashcards to edit card content. Operations: - find_due: read-only; the IDs of matching cards due now, for running a quiz (not counts). Needs query (Anki search syntax, e.g. "deck:Spanish"). - check_status: read-only. Needs cardIds; returns due/suspended flags per card. - answer: records reviews, as if answered in Anki. Needs…
| Parameter | Type | Description |
|---|---|---|
operation * | string | Which operation to run; see the tool description for required parameters |
answers | array | answer: one entry per reviewed card |
cardIds | array | check_status (required), or suspend/unsuspend/forget/relearn/reposition instead of query: card IDs (not note IDs). For reposition, the order of this array is the new queue order |
dryRun | boolean | suspend/unsuspend/forget/relearn: report how many cards match (and sample IDs) without changing anything. reposition: list each card's planned position without writing. Rejected for other operations |
query | string | find_due (required), or suspend/unsuspend/forget/relearn/reposition instead of cardIds: Anki search query, e.g. 'deck:"Spanish"' or "tag:verbs is:due". The server finds the cards, so thousands of card… |
shift | boolean | reposition: push other new cards at or after start down so positions don't collide (like Anki's "Shift position of existing cards"). Default false: ties are broken by card ID |
start | integer | reposition: position of the first card. Default: the lowest position among new cards in the affected decks (the front of the queue) |
step | integer | reposition: gap between consecutive positions (default 1) |
manage_decks Manage decks
Create, list, inspect, configure, rename and delete Anki decks, and move cards between them. Use this for deck organization and per-deck daily limits; use manage_flashcards for card content. To suspend/unsuspend cards (e.g. pause a deck), use manage_scheduling. Operations: - list: read-only; all deck names and IDs. - create: needs deckName (use "Parent::Child" for subdecks). Optional newPerDay and/or reviewsPerDay give the new deck its own daily limits (see set_limits). Does nothing if the deck already exists. - set_limits: needs deckName plus newPerDay and/or reviewsPerDay. Changes daily lim…
| Parameter | Type | Description |
|---|---|---|
operation * | string | Which operation to run; see the tool description for required parameters |
cardIds | array | move_cards: card IDs to move (or use query) |
configId | number | set_config: ID of an existing options preset (see get_config) |
deckName | string | create/rename/set_limits/set_display_order/get_stats/get_config: deck name; use "Parent::Child" for subdecks |
deckNames | array | delete/set_config: deck names to act on. get_stats: several decks at once |
deleteCards | boolean | delete: must be true or omitted; AnkiConnect always deletes a deck together with its cards |
dryRun | boolean | move_cards only: report how many cards match, from which decks, without moving them. Rejected for other operations |
interdayLearningMix | string | set_display_order: when interday learning cards show relative to reviews |
newGatherOrder | string | set_display_order: which new cards are gathered for today |
newName | string | rename: the new deck name (subdecks follow) |
newPerDay | integer | create/set_limits: max new cards per day for this deck only |
newReviewMix | string | set_display_order: when new cards show relative to reviews |
newSortOrder | string | set_display_order: how gathered new cards are ordered |
query | string | move_cards: Anki search query selecting the cards to move instead of cardIds, e.g. 'deck:"Old" tag:verbs' |
raw | boolean | get_config: true returns the full preset JSON instead of the summary |
requireEmpty | boolean | delete: refuse (and delete nothing) if any of the decks has cards |
reviewOrder | string | set_display_order: order of review cards |
reviewsPerDay | integer | create/set_limits: max reviews per day for this deck only |
targetDeck | string | move_cards: destination deck (created if missing) |
get_analytics Study analytics
Read-only progress and review history from the local Anki collection ("how am I doing?", "what am I failing?", "how much have I studied?"), aggregated server-side into compact JSON or one line per row. For today's due counts per deck use manage_decks get_stats; for due card IDs, manage_scheduling find_due. To act on the findings, use manage_scheduling or manage_flashcards. Scopes (set `scope`, then the listed parameters). deckName always includes subdecks; where optional, omitting it means the whole collection: - deck_overview: progress and health of one deck ("how am I doing on this deck?").…
| Parameter | Type | Description |
|---|---|---|
scope * | string | Which statistics to read; see the tool description for required parameters |
cardIds | array | card_details: card IDs |
days | integer | collection_stats: forecast length (default 14, max 90); reviews_by_day: days back incl. today (default 30); deck_overview: stats window (default 30); trouble_cards: window (default 7) |
deckName | string | Deck (includes subdecks). Required for deck_overview, card_reviews; optional filter for collection_stats, reviews_by_day, trouble_cards (omit = whole collection) |
limit | integer | trouble_cards: worst cards listed (default 10); deck_overview: top tags (default 10); card_reviews: max rows before summarizing (default 300) |
since | string | reviews_by_day: start date YYYY-MM-DD (overrides days) |
startTimestamp | number | card_reviews: only reviews after this review ID (epoch milliseconds), e.g. Date.now() - 7 days |
wholeCollection | boolean | Deprecated and ignored; collection_stats uses deckName (omit for all decks) |
manage_models Manage note types
List and modify Anki note types (models): fields, card templates and CSS. Use list before creating notes to find a note type's exact field names (e.g. "Front"/"Back"); use manage_flashcards for note content. Operations: - list: read-only; every note type with its ID and ordered field names. - create: needs modelName, fields (ordered names) and templates ([{ Front, Back }]); optional css, isCloze. - add_field: needs modelName, fieldName, fieldIndex. - remove_field: needs modelName, fieldName. Deletes that field's content from every note of this type (destructive). - rename_field: needs modelNa…
| Parameter | Type | Description |
|---|---|---|
operation * | string | Which operation to run; see the tool description for required parameters |
css | string | create/update_styling: CSS for the card templates |
fieldIndex | number | add_field: 0-based position for the new field |
fieldName | string | add_field/remove_field/rename_field: field name (current name for rename) |
fields | array | create: field names in order |
isCloze | boolean | create: make a cloze deletion note type |
modelName | string | Note type name (all operations except list), e.g. "Basic" |
newFieldName | string | rename_field: new field name |
template | object | add_template: template to add, { Front, Back } HTML |
templateName | string | remove_template: template name, e.g. "Card 1" |
templates | array | create: card templates, e.g. [{ Front: "{{Front}}", Back: "{{FrontSide}}<hr id=answer>{{Back}}" }] |
manage_collection Manage collection: sync, packages, media
Collection maintenance for the Anki app: AnkiWeb sync, version check, .apkg import/export, profiles, and media files. Use this for maintenance tasks that are not about card content, decks, note types or reviews. To read a media file's contents (e.g. view an image), use get_media_file. Operations: - version: read-only; AnkiConnect version (also a quick "is Anki running?" check). - get_profiles: read-only; profile names. - sync: syncs the collection with AnkiWeb (network; may upload or download changes). - export_deck: needs deckName and filePath (.apkg path to write); optional includeSched. Wr…
| Parameter | Type | Description |
|---|---|---|
operation * | string | Which operation to run; see the tool description for required parameters |
deckName | string | export_deck: deck to export |
filePath | string | export_deck: .apkg path to write. import_package: .apkg path to read |
filename | string | store_media/retrieve_media/delete_media: media file name, e.g. "cat.png" |
includeSched | boolean | export_deck: include review history and scheduling (default false) |
mediaData | string | store_media: base64 file contents (or use mediaUrl) |
mediaUrl | string | store_media: URL Anki downloads the file from (or use mediaData) |
pattern | string | list_media: glob pattern, e.g. "*.png" or "*" |
get_media_file Get media file contents
Read one file from Anki's media folder and return it as base64; images are also returned as image content the model can look at. Read-only. Use this when you need a referenced image/audio file's actual contents; use manage_collection list_media to find file names and store_media/delete_media to change files. Pass the bare filename as it appears in the card (e.g. "diagram.png"); paths and ".." are rejected. Returns an error object if the file doesn't exist.
| Parameter | Type | Description |
|---|---|---|
filename * | string | Bare media file name as referenced in a card, e.g. "image.png" (no paths) |
control_gui Control the Anki app UI
Drive the Anki desktop application's user interface: open windows and dialogs (Card Browser, Add Cards, Edit Note, deck overview, import), run an on-screen review session, and read what the user currently has selected or on screen. Use this when the user wants to see or act on something inside the Anki app itself; use `manage_flashcards` (and the other non-GUI tools) for headless reads and writes, which are faster and do not disturb the user's windows. Side effects: every operation except `current_card` and `selected_notes` changes what is shown in Anki. `answer_card` records a review and res…
| Parameter | Type | Description |
|---|---|---|
operation * | string | The GUI action to perform. See the tool description for what each one does. |
cardId | integer | Card ID. Required for select_card. |
deckName | string | Deck name. Required for add_cards, deck_overview and deck_review. |
ease | integer | Review grade: 1 Again, 2 Hard, 3 Good, 4 Easy. Required for answer_card. |
fields | object | Field name to value map used to pre-fill the note, e.g. {"Front": "...", "Back": "..."}. Required for add_cards. |
filePath | string | Absolute path of the file to import (.apkg, .colpkg, .txt, .csv, ...). Required for import_file. |
modelName | string | Note type (model) name, e.g. "Basic". Required for add_cards. |
noteId | integer | Note ID. Required for edit_note; select_note passes it on as a card ID. |
query | string | Anki search query (https://docs.ankiweb.net/searching.html), e.g. "deck:Spanish is:due". Required for browse. |
reorderCards | object | Optional sort order for the Card Browser. Used by browse. |
tags | array | Tags to pre-fill. Optional for add_cards. |