Anki MCP
v0.1.2Manage local Anki notes, cards, decks, note types, media, and deck packages via AnkiConnect.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list-decks List decks
Lists all Anki decks with their IDs and hierarchy metadata.
create-deck Create deck
Creates a deck or returns the existing deck with the same name. Use "::" to create nested decks.
| Parameter | Type | Description |
|---|---|---|
name * | string | Full deck name. Use "::" between parent and child deck names, for example "Languages::German". |
rename-deck Rename or move a deck
Previews a native Anki deck rename or move under an existing parent. Preserves deck and card identity, reviews descendant paths, and requires the impact hash and explicit confirmation before applying. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
name * | string | Exact current full deck path |
newName * | string | New full path; the destination parent must already exist |
confirmRename | boolean | |
dryRun | boolean | |
expectedImpactHash | string | Impact hash from the reviewed rename preview |
list-deck-presets List deck presets
Lists Anki deck presets and how many normal decks use each one. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
offset | integer |
get-deck-preset Get deck preset
Reads a deck preset's settings and the decks that use it. Pass a preset ID or a normal deck ID. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
deckId | integer | Resolve the preset currently assigned to this normal deck |
presetId | integer |
create-deck-preset Create deck preset
Creates an unassigned deck preset from native defaults or an existing preset. Does not replace or assign a preset. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
cloneFromPresetId | integer | Copy an existing preset instead of using Anki defaults |
update-deck-preset Update deck preset
Previews a preset rename or a patch to learning, display order, or audio options, showing every deck using it. Requires an impact hash and explicit confirmation to apply. Does not request full FSRS rescheduling. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
presetId * | integer | |
confirmChanges | boolean | |
dryRun | boolean | |
expectedImpactHash | string | |
name | string | |
settings | object |
assign-deck-preset Assign deck preset
Previews assigning a preset to explicitly selected normal decks, without adding descendants or requesting full FSRS rescheduling. Requires an impact hash and explicit confirmation. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
deckIds * | array | Explicit normal deck IDs; descendants are not automatically included |
presetId * | integer | |
confirmChanges | boolean | |
dryRun | boolean | |
expectedImpactHash | string |
delete-deck-preset Delete unused deck preset
Previews deletion of one unused, non-Default deck preset. Never reassigns decks automatically. Requires an impact hash and explicit confirmation. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
presetId * | integer | |
confirmDeletion | boolean | |
dryRun | boolean | |
expectedImpactHash | string |
get-deck-stats Get deck statistics
Returns scheduler counts for selected decks, or for all decks when no names are provided. Fails if a requested deck does not exist.
| Parameter | Type | Description |
|---|---|---|
names | array | Decks to inspect. Omit to return statistics for every deck. |
get-card-decks Get card decks
Groups the specified card IDs by their current deck.
| Parameter | Type | Description |
|---|---|---|
cardIds * | array | IDs of cards whose deck assignments should be returned |
move-cards-to-deck Move cards to deck
Moves cards to another deck. Creates the target deck if it does not exist and removes the cards from filtered decks before moving them.
| Parameter | Type | Description |
|---|---|---|
cardIds * | array | IDs of cards to move |
targetDeck * | string | Destination deck. It will be created if it does not exist. |
delete-deck-and-cards Delete deck and cards
Previews deletion of one normal deck and all descendants. Applying requires dryRun: false, the reviewed impactHash as expectedImpactHash, and confirmDeletion: true. Changed deck identities, Card placement, or Note data block deletion. Default/filtered decks, borrowed-out Cards, incomplete data, and excessive impact are blocked. Surviving sibling Cards in other decks are preserved and verified. No backup or rollback is created.
| Parameter | Type | Description |
|---|---|---|
name * | string | Exact root deck name; its descendants are included in deletion |
confirmDeletion | boolean | Must be true after user approval when applying destructive deck/Card loss |
dryRun | boolean | |
expectedImpactHash | string | impactHash from a complete reviewed preview; required when applying |
search-cards Search cards
Searches cards with Anki's native query syntax. In v1 mode, defaults to a native cursor page. Request pagination: offset for an exact total or a numeric position.
| Parameter | Type | Description |
|---|---|---|
query * | string | Native Anki search query, for example "deck:French is:due", "tag:verb", or "prop:lapses>3". An empty query searches all cards. |
cursor | string | Use the previous nextCursor with the same query and limit. Omit it on the first cursor page. |
limit | integer | |
offset | integer | Supplying an offset, even 0, selects offset mode unless pagination is explicit. |
pagination | string | Defaults to cursor when v1 is enabled and no offset is supplied. Use offset for an exact total or a numeric position. |
get-card-details Get card details
Returns note fields and normalized scheduling information for specific cards. Reports missing IDs separately.
| Parameter | Type | Description |
|---|---|---|
cardIds * | array | One to 20 card IDs whose fields and scheduling details should be returned |
includeRenderedContent | boolean | Include rendered question and answer HTML, which may contain Anki's embedded styles. No separate CSS field is returned; use get-card-preview for HTML/CSS documents. |
get-card-review-history Get card review history
Returns the most recent review events for up to 20 cards, with ratings and intervals converted into readable values.
| Parameter | Type | Description |
|---|---|---|
cardIds * | array | One to 20 card IDs whose review history should be returned |
limitPerCard | integer |
get-card-preview Get card preview
Returns Anki-rendered HTML, shared CSS, and standalone static HTML documents for one existing card. Supports front/back and light/dark inspection without changing Anki. Not a screenshot: JavaScript, navigation, media, and external resources are disabled in documents. Raw source is untrusted.
| Parameter | Type | Description |
|---|---|---|
cardId * | integer | Anki card ID |
side | string | Which existing card side to inspect; Anki resolves fields and template filters |
theme | string | Document color scheme; dark adds Anki's nightMode and night_mode classes |
predict-card-intervals Predict card intervals
Read-only scheduler predictions for Again, Hard, Good, and Easy on one card. Returns Anki's labels and interval amounts, not an exact due time or eligibility to review. Does not answer the card, change scheduling, or use custom states from the GUI reviewer. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
cardId * | integer | One existing card ID, for example from search-cards. |
get-card-due-status Get card due status
Checks one card's due time and per-card scheduling eligibility in Anki, optionally including learn-ahead. New cards can be available without being due. Does not account for daily deck limits, promise the card will be shown next, or change Anki. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
cardId * | integer | One existing card ID, for example from search-cards. |
includeLearnAhead | boolean | Treat cards within Anki's learn-ahead window as available, without marking them due. |
set-card-suspension Set card suspension
Suspends or unsuspends existing cards and verifies their saved suspension state. Missing Cards block the whole selection. Suspended cards do not appear during normal reviews.
| Parameter | Type | Description |
|---|---|---|
cardIds * | array | One to 100 Anki card IDs |
suspended * | boolean | True to suspend the cards, false to unsuspend them |
set-card-flag Set card flag
Applies one of Anki's supported flag colors and verifies saved flags without exposing arbitrary internal card fields. Missing Cards block the whole selection; a write error stops later writes and may leave partial progress.
| Parameter | Type | Description |
|---|---|---|
cardIds * | array | One to 100 Anki card IDs |
flag * | string | Anki flag color to apply, or none to remove the current flag |
reschedule-cards Reschedule cards
Changes due dates and verifies the saved review state and requested date range using Anki's native search. Missing Cards block the whole selection. New cards become review cards, and ranges choose a random due date; never blindly retry after an error.
| Parameter | Type | Description |
|---|---|---|
cardIds * | array | One to 100 Anki card IDs |
due * | string | Anki Set Due Date value: "0" means today, "1!" requests tomorrow with an interval reset under the current scheduler, and "3-7" chooses a random day in that range |
reset-cards-to-new Reset cards to new
Resets scheduling and verifies the saved New state. Missing Cards block the whole selection. Anki may log the reset; review history and repetition counts are not promised to be erased. Never blindly retry after an error.
| Parameter | Type | Description |
|---|---|---|
cardIds * | array | One to 100 Anki card IDs |
start-card-relearning Start card relearning
Starts relearning for active Review cards and verifies the result. Current AnkiConnect may implement this as an Again answer, adding review history and changing repetitions/lapses. Cards may return directly to Review or be suspended by leech settings. Missing/non-Review Cards block the whole selection. Not idempotent; never blindly retry.
| Parameter | Type | Description |
|---|---|---|
cardIds * | array | One to 100 Anki card IDs |
list-note-types List note types
Lists the Anki note types available for creating notes, including their model IDs.
get-note-type-schema Get note type schema
Returns ordered fields, the Browser sort field (v1), card-template field usage, and a field-order revision hash for one Anki note type. Use this before creating notes or changing fields.
| Parameter | Type | Description |
|---|---|---|
modelName * | string | Anki note type name. AnkiConnect calls note types "models" in its API. |
get-note-type-design Get note type design
Returns the editable front/back HTML, shared CSS, fields, and revision hash for one Anki note type. Use this before proposing design changes.
| Parameter | Type | Description |
|---|---|---|
modelName * | string | Anki note type name. AnkiConnect calls note types "models" in its API. |
clone-note-type Clone note type
Creates an independent note type with the source's ordered fields, card template HTML, and shared CSS. In AnkiConnect v1 it preserves the Browser sort field and requires the reviewed clone hash before applying. Does not copy notes or cards.
| Parameter | Type | Description |
|---|---|---|
sourceModelName * | string | Existing note type whose ordered fields, templates, CSS, and v1 sort field should be copied |
targetModelName * | string | Unique name for the new independent note type |
dryRun | boolean | When true, validate and preview the clone without creating a note type |
expectedCloneHash | string | Hash returned by the reviewed clone preview; required for apply in v1. |
expectedSourceDesignHash | string | Source design hash required for legacy apply; v1 apply requires expectedCloneHash. |
isCloze | boolean | Optional normal/Cloze override. By default the tool detects {{cloze:...}} filters in the source templates. |
create-note-type Create note type
Creates a new Normal or Cloze note type from ordered fields, complete card templates, and shared CSS. Optionally selects its Browser sort field in AnkiConnect v1. Defaults to dry-run mode and does not create notes or cards.
| Parameter | Type | Description |
|---|---|---|
fields * | array | Field names in their desired order. The first field is used for duplicate checks. |
modelName * | string | Unique name for the new Anki note type |
templates * | array | |
css | string | Shared CSS for every card generated from the note type |
dryRun | boolean | When true, validate and preview the note type without creating it |
isCloze | boolean | Whether to create an Anki Cloze note type |
sortField | string | Exact name from fields. Requires AnkiConnect v1. Omit to use Anki's default first field. |
rename-note-type Rename note type
Previews renaming an existing Note Type by ID. Changes only the type name, not fields, templates, Notes, or Cards. Applying requires the reviewed impact hash and explicit confirmation. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
newName * | string | |
noteTypeId * | integer | Stable ID from list-note-types |
confirmRename | boolean | |
dryRun | boolean | Preview without modifying Anki |
expectedImpactHash | string | Hash returned by the reviewed rename preview |
set-note-type-sort-field Set note type sort field
Previews changing which field supplies the Anki Browser's Sort Field column for an existing Note Type. Does not reorder fields, edit templates, or change review scheduling. Applying requires the reviewed impact hash and explicit confirmation. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
noteTypeId * | integer | Stable ID from list-note-types or get-note-type-schema |
sortField * | string | Exact existing field name from get-note-type-schema |
confirmChange | boolean | |
dryRun | boolean | Preview without modifying Anki |
expectedImpactHash | string | Hash from the reviewed sort-field preview |
delete-unused-note-type Delete unused note type
Previews deleting one explicitly selected Note Type. Refuses if any Note uses the type, even without Cards, or if it is the last Note Type. Requires the reviewed impact hash and explicit confirmation to apply. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
noteTypeId * | integer | Explicit stable ID from list-note-types |
confirmDeletion | boolean | |
dryRun | boolean | Preview without modifying Anki |
expectedImpactHash | string | Hash from the reviewed deletion preview |
add-note-type-field Add note type field
Adds an empty field to every note of one note type. Defaults to dry-run mode and does not add the field to card templates.
| Parameter | Type | Description |
|---|---|---|
fieldName * | string | New field name. Anki special field names such as Tags, Type, Deck, Card, and FrontSide are not allowed. |
modelName * | string | Anki note type name. AnkiConnect calls note types "models" in its API. |
dryRun | boolean | When true, validate and preview the field without modifying Anki |
expectedSchemaHash | string | Hash returned by get-note-type-schema; required when dryRun is false and blocks stale writes |
order | integer | Optional zero-based field order. Use 0 for the first field; omit to append. |
rename-note-type-field Rename note type field
Renames a field across every note of one note type while preserving its values. Anki updates template references to the renamed field.
| Parameter | Type | Description |
|---|---|---|
modelName * | string | Anki note type name. AnkiConnect calls note types "models" in its API. |
newFieldName * | string | New field name. Anki special field names such as Tags, Type, Deck, Card, and FrontSide are not allowed. |
oldFieldName * | string | Existing Anki note-type field name |
dryRun | boolean | When true, validate and preview the rename without modifying Anki |
expectedSchemaHash | string | Hash returned by get-note-type-schema; required when dryRun is false and blocks stale writes |
reposition-note-type-field Reposition note type field
Moves a note-type field to a new zero-based order while preserving all note values. Defaults to dry-run mode.
| Parameter | Type | Description |
|---|---|---|
fieldName * | string | Existing Anki note-type field name |
modelName * | string | Anki note type name. AnkiConnect calls note types "models" in its API. |
newOrder * | integer | Zero-based field order. Use 0 to make this the first field. |
dryRun | boolean | When true, validate and preview the new order without modifying Anki |
expectedSchemaHash | string | Hash returned by get-note-type-schema; required when dryRun is false and blocks stale writes |
delete-note-type-field Delete note type field
Permanently deletes one field and all of its values from every note of a note type. Requires a dry-run impact review, current schema hash, unchanged non-empty note count, and explicit data-loss confirmation.
| Parameter | Type | Description |
|---|---|---|
fieldName * | string | Existing Anki note-type field name |
modelName * | string | Anki note type name. AnkiConnect calls note types "models" in its API. |
confirmDataLoss | boolean | Must be true when dryRun is false to confirm permanent deletion of this field's values |
dryRun | boolean | When true, report the permanent data impact without modifying Anki |
expectedNonEmptyNoteCount | integer | Non-empty note count returned by the dry run; required when dryRun is false and blocks applying changed impact |
expectedSchemaHash | string | Hash returned by get-note-type-schema; required when dryRun is false and blocks stale writes |
add-note-type-template Add note type template
Adds a new card template to a Normal note type. Defaults to dry-run mode and reports how many existing notes may generate a new card.
| Parameter | Type | Description |
|---|---|---|
back * | string | Complete HTML for the new back side |
front * | string | Complete HTML for the new front side |
modelName * | string | Anki note type name. AnkiConnect calls note types "models" in its API. |
templateName * | string | Anki card template name |
confirmCardCreation | boolean | Must be true when dryRun is false to confirm that Anki may generate a new card for each existing note |
dryRun | boolean | When true, validate and preview the template without modifying Anki |
expectedDesignHash | string | Hash returned by get-note-type-design; required when dryRun is false and blocks stale writes |
expectedNoteCount | integer | Existing note count returned by the dry run; required when dryRun is false and blocks applying changed impact |
rename-note-type-template Rename note type template
Renames one card template without changing its order, HTML, generated cards, or review history. Defaults to dry-run mode.
| Parameter | Type | Description |
|---|---|---|
modelName * | string | Anki note type name. AnkiConnect calls note types "models" in its API. |
newTemplateName * | string | Anki card template name |
oldTemplateName * | string | Anki card template name |
dryRun | boolean | When true, validate and preview the rename without modifying Anki |
expectedDesignHash | string | Hash returned by get-note-type-design; required when dryRun is false and blocks stale writes |
reposition-note-type-template Reposition note type template
Moves one card template to a new zero-based order while preserving its HTML and existing card history. Defaults to dry-run mode.
| Parameter | Type | Description |
|---|---|---|
modelName * | string | Anki note type name. AnkiConnect calls note types "models" in its API. |
newOrder * | integer | Zero-based card template order. Use 0 to make it the first template. |
templateName * | string | Anki card template name |
dryRun | boolean | When true, validate and preview the new order without modifying Anki |
expectedDesignHash | string | Hash returned by get-note-type-design; required when dryRun is false and blocks stale writes |
delete-note-type-template Delete note type template
Permanently deletes one card template and every card generated from it. Reports notes that may lose their last card and requires explicit impact confirmation.
| Parameter | Type | Description |
|---|---|---|
modelName * | string | Anki note type name. AnkiConnect calls note types "models" in its API. |
templateName * | string | Anki card template name |
confirmCardDeletion | boolean | Must be true when dryRun is false to confirm permanent deletion of generated cards and their review history |
confirmNoteDeletion | boolean | Must be true when affected notes would lose their last card and dryRun is false |
dryRun | boolean | When true, report the permanent card impact without modifying Anki |
expectedCardCount | integer | Affected card count returned by the dry run; required when dryRun is false and blocks applying changed impact |
expectedDesignHash | string | Hash returned by get-note-type-design; required when dryRun is false and blocks stale writes |
expectedNotesLosingLastCardCount | integer | Count returned by the dry run for notes that would lose their last card; required when dryRun is false |
update-note-type-styling Update note type styling
Validates and replaces the CSS shared by every card of one note type. Defaults to dry-run mode; applying requires expectedDesignHash. Reports applied only after reading back the exact CSS and confirming the Note Type identity and unchanged templates. A write/readback error may follow an applied change; do not blindly retry.
| Parameter | Type | Description |
|---|---|---|
css * | string | Complete replacement CSS for the note type |
modelName * | string | Anki note type name. AnkiConnect calls note types "models" in its API. |
dryRun | boolean | When true, validate and report the proposed change without modifying Anki |
expectedDesignHash | string | Hash returned by get-note-type-design; required when dryRun is false and blocks stale writes |
update-note-type-templates Update note type templates
Validates and replaces selected front/back HTML templates for one note type. Defaults to dry-run mode and applies all requested sides in one Anki undo step.
| Parameter | Type | Description |
|---|---|---|
modelName * | string | Anki note type name. AnkiConnect calls note types "models" in its API. |
templates * | array | |
dryRun | boolean | When true, validate and report the proposed changes without modifying Anki |
expectedDesignHash | string | Hash returned by get-note-type-design; required when dryRun is false and blocks stale writes |
replace-note-type-text Replace literal text in Anki note type designs
Previews and validates a case-sensitive literal replacement in explicitly selected Note Types' front HTML, back HTML, and/or CSS. Does not replace Note field values. Applying requires AnkiConnect v1, a current impact hash, and explicit confirmation.
| Parameter | Type | Description |
|---|---|---|
find * | string | Literal case-sensitive search text, not a regular expression. |
noteTypeIds * | array | Explicit selection of up to 20 Note Type IDs from list-note-types. |
replace * | string | Literal replacement text. An empty string removes the matches. |
targets * | array | Choose question (front HTML), answer (back HTML), and/or css. |
confirmReplacement | boolean | |
dryRun | boolean | Preview without changing Anki. |
expectedImpactHash | string | Hash from the reviewed replacement preview. |
search-notes Search notes
Searches notes with Anki's native query syntax. In v1 mode, defaults to a native page with a continuation cursor. Request pagination: offset for an exact total or a numeric position.
| Parameter | Type | Description |
|---|---|---|
query * | string | Native Anki search query, for example "deck:German tag:A1", "note:Basic", or "Front:*Hund*". An empty query searches all notes. |
cursor | string | Use the previous nextCursor with the same query and limit. Omit it on the first cursor page. |
limit | integer | |
offset | integer | Supplying an offset, even 0, selects offset mode unless pagination is explicit. |
pagination | string | Defaults to cursor when v1 is enabled and no offset is supplied. Use offset for an exact total or a numeric position. |
find-empty-notes Find empty notes
Read-only AnkiConnect v1 scan for Notes with no Cards, empty fields, or empty questions. Returns one page of candidates for review. This tool never deletes anything.
| Parameter | Type | Description |
|---|---|---|
criterion * | string | allFieldsEmpty checks all fields using Anki's HTML-aware emptiness; noCards finds Notes with no Cards; allQuestionsEmpty finds Notes whose possible Card questions all render empty in Anki. |
cursor | string | Reuse nextCursor with the same criterion, query, and limit. |
limit | integer | Maximum candidates per page. This does not limit the initial scan. |
query | string | Optional native Anki search to restrict the scan, e.g. tag:inbox. An empty query scans all Notes. |
get-note-details Get note details
Returns complete ordered fields with per-field hashes, tags, note type, modification time, and generated card IDs. Use fields[name].hash as expectedFieldHashes[name] when updating fields.
| Parameter | Type | Description |
|---|---|---|
noteIds * | array | One to 20 note IDs whose complete fields and metadata should be returned |
validate-note-drafts Validate note drafts
Checks candidate notes without creating them. Validates decks, note types, field names, existing media references, empty-card rules, and Anki duplicate rules.
| Parameter | Type | Description |
|---|---|---|
notes * | array | Candidate notes to validate without creating them |
create-notes Create notes
Validates the complete batch before creating Notes, optionally merging existing media references. Returns a status for every input and preserves acknowledged IDs if readback fails. A null createdNoteCount means an unknown creation outcome; null cardIds means unverified readback. Partial/unknown outcomes are errors with structured results. Never blindly resend the whole batch; duplicate checks are not idempotency. No automatic retry or rollback.
| Parameter | Type | Description |
|---|---|---|
notes * | array | One or more notes to validate and create as one batch |
update-note-fields Update note fields
Previews partial field patches by default. To apply, set dryRun to false and provide expectedFieldHashes for every submitted field from get-note-details or a dry run. Validates the complete batch before writing and verifies saved values. Each submitted field replaces its complete value, including HTML.
| Parameter | Type | Description |
|---|---|---|
updates * | array | |
dryRun | boolean | Preview bounded raw HTML changes and full-value hashes without modifying Anki. Set false to apply with expectedFieldHashes. |
convert-notes-to-note-type Convert notes to another Note Type
Previews moving explicit existing Notes to another Normal Note Type. Review target-to-source field and template maps, preserved/removed Card IDs, and possible new Cards. Apply only with the reviewed hash and confirmations. Does not duplicate Notes. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
noteIds * | array | Explicit Note IDs belonging to the same source Note Type |
targetNoteTypeId * | integer | Existing destination Note Type ID from list-note-types |
confirmCardCreation | boolean | Required when native generation could create new Cards |
confirmConversion | boolean | |
confirmDataLoss | boolean | Required when nonempty fields or existing Cards would be discarded |
dryRun | boolean | |
expectedImpactHash | string | Hash from a reviewed preview of this exact selection and mapping |
fields | array | One mapping per target field; null source leaves it empty. Omit to use Anki's suggested mapping. |
templates | array | One mapping per target template; null source does not preserve an old Card in that slot. Omit to use Anki's suggestion. |
edit-note-tags Edit note tags
Adds and removes selected tags on existing notes without replacing their complete tag lists.
| Parameter | Type | Description |
|---|---|---|
noteIds * | array | One to 100 Anki note IDs |
add | array | Tags to add while preserving every other existing tag |
remove | array | Tags to remove while preserving every other existing tag |
replace-note-tag Replace a tag on selected notes
Previews replacing one whole tag on explicit Note IDs. Notes without the source tag are skipped. Does not recursively rename child tags, change unrelated tags, or apply to the whole collection. Requires AnkiConnect v1 and explicit confirmation of the reviewed preview to write.
| Parameter | Type | Description |
|---|---|---|
from * | string | Full existing tag name to replace. Not a prefix or search query. |
noteIds * | array | Explicit selection of up to 100 Note IDs. No collection-wide option. |
to * | string | One replacement tag name. Anki may reuse registered casing. |
confirmReplacement | boolean | |
dryRun | boolean | Preview without modifying Anki |
expectedImpactHash | string | Hash from the reviewed replacement preview |
list-tags List tags
Lists a bounded page of tags from the current Anki collection, optionally filtered by prefix.
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
offset | integer | |
prefix | string | Optional case-insensitive tag prefix filter |
delete-unused-tags Delete unused Anki tags
Previews and removes tag registrations that no Note uses in the active collection. Does not remove tags from Notes or delete Notes or Cards. Requires AnkiConnect v1 and confirmation of the reviewed preview.
| Parameter | Type | Description |
|---|---|---|
confirmDeletion | boolean | Confirm cleanup of unused tags across the active collection. |
dryRun | boolean | Preview without modifying Anki. |
expectedImpactHash | string | Hash from the reviewed tag cleanup preview. |
delete-notes-and-cards Delete notes and cards
Previews deletion of explicit Note IDs and all their generated Cards. Defaults to dryRun. Applying requires the reviewed impactHash as expectedImpactHash and confirmDeletion: true. Missing Notes or changed profile, Note content, tags, or Card IDs block the entire batch. Successful deletion is verified with native searches. No backup or rollback is created.
| Parameter | Type | Description |
|---|---|---|
noteIds * | array | Explicit Note IDs; duplicates are ignored. Search queries are not accepted. |
confirmDeletion | boolean | Must be true when applying, after the user approves permanent Note/Card data loss |
dryRun | boolean | Preview Notes and generated Cards without deleting anything |
expectedImpactHash | string | impactHash returned by a complete preview; required when dryRun is false |
search-media-files Search media files
Returns a bounded, sorted page of filenames from Anki's current collection.media folder.
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
offset | integer | |
pattern | string | AnkiConnect glob pattern such as "*.mp3", "_logo*", or "gehen*" |
get-media-file Get media file
Returns verified metadata for one exact Anki media file and can include a bounded image or audio preview.
| Parameter | Type | Description |
|---|---|---|
filename * | string | Portable filename inside Anki's flat collection.media folder |
includeContent | boolean | Return supported image or audio bytes as a native MCP content block when the file is small enough |
store-media-file Store media file
Safely imports bounded media bytes into Anki from base64, a public HTTPS URL, or an explicitly allowed local directory. Existing files are never overwritten.
| Parameter | Type | Description |
|---|---|---|
filename * | string | Portable filename inside Anki's flat collection.media folder |
source * | ||
collisionPolicy | string | rename lets Anki choose a non-conflicting filename; reject makes an existing filename an error |
usage | string | Static template assets must start with an underscore so Anki's media checker preserves them |
find-media-references Find media references
Scans note fields, Card Template HTML, and note-type CSS for exact references to one Anki media filename. Complete scans return a fingerprint for safe deletion. CSS parsing failures are reported separately and make counts incomplete; no fingerprint is issued.
| Parameter | Type | Description |
|---|---|---|
filename * | string | Portable filename inside Anki's flat collection.media folder |
attach-media-to-notes Attach media to notes
Safely appends or prepends references to existing Anki media without replacing unrelated note-field HTML. Defaults to dry-run mode.
| Parameter | Type | Description |
|---|---|---|
attachments * | array | |
dryRun | boolean | Preview exact field hashes and references without modifying Anki |
detach-media-from-notes Detach media from notes
Removes exact image or sound references from selected note fields without deleting the media file. Defaults to dry-run mode.
| Parameter | Type | Description |
|---|---|---|
detachments * | array | |
dryRun | boolean |
delete-media-file Delete media file
Previews exact Note, Card Template, and CSS references before moving one media file to Anki's media trash. Applying requires the reviewed file hash, reference count, reference fingerprint, and explicit confirmation. Incomplete Note or CSS scans block deletion even with confirmations enabled.
| Parameter | Type | Description |
|---|---|---|
filename * | string | Portable filename inside Anki's flat collection.media folder |
confirmBrokenReferences | boolean | Must be true when applying deletion while Notes, Card Templates, or CSS still reference the file |
confirmDeletion | boolean | Must be true when applying media deletion |
dryRun | boolean | Inspect exact bytes and all detectable references without deleting the file |
expectedReferenceCount | integer | Reference count returned by the dry run; required when applying |
expectedReferenceFingerprint | string | usage.referenceFingerprint returned by a complete dry run; required when applying, even if the reference count is unchanged |
expectedSha256 | string | File hash returned by the dry run; required when applying |
get-study-stats Get study statistics
Reads collection-wide review counts for Anki's current study day and recent days with reviews. Does not change data or include per-deck counts.
| Parameter | Type | Description |
|---|---|---|
limitDays | integer | Maximum number of recent days with reviews. Days without reviews are omitted. |
get-study-summary Get study summary
Read-only structured Anki totals for the whole collection or one deck including its subdecks. Returns card and linked-note counts, recorded answers and time across available history, and current card categories. For today's workload use get-deck-stats. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
deckId | integer | Deck ID from list-decks. Includes child decks. Omit for the whole collection. |
export-deck-package Export Anki deck package
Previews a local .apkg export of one normal deck and its subdecks. Media is included; scheduling is opt-in. On confirmation, writes a new file under the configured export directory without overwriting existing files. Requires local AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
deckId * | integer | ID of one normal deck from list-decks; its subdecks are in scope. |
confirmExport | boolean | |
dryRun | boolean | Preview without exporting a file or importing into Anki. |
expectedImpactHash | string | Hash from the reviewed preview. |
fileName | string | File name only. Defaults to deck-<id>.apkg. |
includeScheduling | boolean | Include learning progress and review history. |
import-deck-package Import Anki deck package
Previews a trusted local .apkg file and imports its reviewed bytes into the active Anki collection. Anki can update existing Notes and merge Note Types; it imports scheduling and deck presets when present. Preview does not calculate a collection diff. Requires local AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
localPath * | string | Absolute path to a trusted .apkg inside ANKI_PACKAGE_IMPORT_DIR. |
confirmImport | boolean | Accept the import, including possible updates and learning progress. |
dryRun | boolean | Preview without exporting a file or importing into Anki. |
expectedImpactHash | string | Hash from the reviewed preview. |
get-collection-info Get active Anki collection information
Read the active profile, scheduler, and opaque collection session. Does not read Notes or Cards. Requires AnkiConnect v1.
refresh-collection Refresh Anki collection windows
Refresh open Anki windows, optionally clearing the supported Note Type cache first. Does not reopen the collection, sync, or repair data. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
target | string | Refresh windows, or invalidate the supported note type cache first. |
sync-collection Synchronize the active Anki collection
Preview or explicitly confirm a sync with Anki's configured server. A full sync may require the user to choose Upload or Download in Anki. Returns an operation ID, not completion. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
confirm | boolean | Set true only after the user approves the reviewed collection operation. |
confirmationToken | string | Short-lived, one-use token returned by this tool's preview. |
dryRun | boolean | Review the active profile and proposal without running the operation. |
includeMedia | boolean | Request media sync, if enabled in the active profile. |
check-collection-integrity Check and repair the active Anki database
Preview or explicitly confirm Anki's native Check Database operation. It can repair data and clear the Undo history; the preview does not check the database. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
confirm | boolean | Set true only after the user approves the reviewed collection operation. |
confirmationToken | string | Short-lived, one-use token returned by this tool's preview. |
dryRun | boolean | Review the active profile and proposal without running the operation. |
undo-collection-action Undo Anki's current undoable action
Preview or explicitly confirm a single native Undo. AnkiConnect cannot preview or select the undo entry; Undo can revert a manual action, not necessarily a change made through MCP. Never use it as automatic rollback. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
confirm | boolean | Set true only after the user approves the reviewed collection operation. |
confirmationToken | string | Short-lived, one-use token returned by this tool's preview. |
dryRun | boolean | Review the active profile and proposal without running the operation. |
get-collection-operation Get Anki collection operation status
Check a submitted sync, database check, or Undo without starting another. If waitingForUser, use Anki's UI and check the same operation ID again. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
operationId * | string | Operation ID returned by a collection tool on this MCP server. |
cancel-collection-operation Request cancellation of an Anki collection operation
When the user asks to stop a sync, database check, or Undo, request cancellation of its operation ID from this running MCP server. Anki may refuse to stop a running operation. Acknowledgement is not completion or rollback; check get-collection-operation. Requires AnkiConnect v1.
| Parameter | Type | Description |
|---|---|---|
operationId * | string | Operation ID returned by a collection tool on this MCP server. |