Anki Connect MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| ANKI_CONNECT_URL | No | The URL of the AnkiConnect server (default: http://localhost:8765) | http://localhost:8765 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| versionA | Returns the AnkiConnect API version number (e.g. 6). Cheap way to check that Anki is running and reachable. |
| get_tagsA | Returns every tag used in the collection, as an array of strings. |
| deck_namesA | Returns the names of all decks, including subdecks written as "Parent::Child". Use it to get exact deck names before adding notes or searching with deck:. |
| deck_names_and_idsA | Returns an object mapping every deck name to its deck ID. |
| get_decksA | Takes card IDs (not note IDs) and returns an object mapping each deck name to the given card IDs that are in it. |
| change_deckA | Moves cards (card IDs, not note IDs) to the given deck; the deck is created if it does not exist. The cards leave their current decks, so the previous placement is lost. Returns null on success. |
| delete_decksA | Deletes decks by name. WARNING: with cardsToo=true every card in those decks is permanently deleted as well; recent AnkiConnect versions require cardsToo=true and refuse otherwise. Cannot be undone through this API. Confirm with the user before calling. Returns null on success. |
| get_deck_configA | Returns the options group (configuration) used by the given deck: new card and review limits, learning steps, lapse settings and its config |
| model_namesA | Returns the names of all models (note types), e.g. "Basic", "Basic (and reversed card)", "Cloze". |
| model_names_and_idsA | Returns an object mapping every model (note type) name to its model ID. |
| model_field_namesA | Returns the field names of the given model in order, e.g. ["Front", "Back"]. Use these exact names as keys of |
| model_fields_on_templatesA | Returns, for each card template of the model, which fields appear on the front and back side: {"Card 1": [["Front"], ["Back"]], ...}. |
| add_noteA | Creates one note in the given deck using the given model (note type) and field values. Anki then generates one or more cards from it. Returns the new note ID. Fails (tool error) if the deck or model does not exist, a field name is wrong, the first field is empty, or the note is a duplicate. Tip: check with can_add_notes first; for several notes prefer add_notes. Attach images/audio/video with |
| add_notesA | Creates several notes in one call. Returns an array of new note IDs in the same order as the input; an entry is null if that note could not be created (e.g. duplicate or empty first field). Run can_add_notes first to find out which notes will fail. If any attached file cannot be stored, no note is created and the error names the note (e.g. notes[2].picture[0]). |
| can_add_notesA | Dry run for add_notes: returns an array of booleans (same order as input) telling whether each note could be created. false usually means a duplicate, an empty first field, or an unknown deck/model. Does not change anything. |
| update_note_fieldsA | Overwrites the given fields of an existing note (takes a note ID, not a card ID). Fields not listed are left unchanged. The previous values are lost, so read the note with notes_info first if you need them. Returns null on success. Media in |
| add_tagsA | Adds tags to notes (takes note IDs, not card IDs). |
| remove_tagsA | Removes tags from notes (takes note IDs, not card IDs). |
| find_notesA | Searches notes with Anki search syntax and returns NOTE IDs (use find_cards for card IDs). Returns {"ids": number[], "total": number, "truncated": boolean}: at most |
| notes_infoA | Returns details for the given note IDs: noteId, modelName, tags, fields (value and order per field) and |
| store_media_fileA | Stores a file in Anki's media folder and returns the name Anki stored it under, which can differ from the requested name. Always use the returned NAME: put |
| get_media_files_namesA | Lists file names in Anki's media folder matching |
| retrieve_media_fileA | Returns a file from Anki's media folder. PNG, JPEG, GIF and WebP images up to 5 MB come back as an image you can see; anything else (audio, video, SVG, larger images) returns {"filename", "bytes"}. Fails if the file does not exist. |
| delete_media_fileA | Moves a file from Anki's media folder to the trash. Cards that still reference it show a broken image or play nothing. Confirm with the user before deleting a file that notes may use. Returns null. |
| get_media_dir_pathA | Returns the absolute path of Anki's media folder (collection.media) on the computer running Anki. |
| find_cardsA | Searches cards with Anki search syntax and returns CARD IDs (use find_notes for note IDs). Returns {"ids": number[], "total": number, "truncated": boolean}: at most |
| cards_infoA | Returns details for the given card IDs: cardId, note (note ID), deckName, modelName, fields, rendered question and answer HTML (CSS removed), interval, due, queue, type, reps, lapses and more. Unknown IDs yield empty objects. Keep the ID list short; the output is large. |
| cards_to_notesA | Returns the unique note IDs that the given cards belong to (one note can have several cards). Use it before note tools such as add_tags or update_note_fields when you only have card IDs. |
| suspendA | Suspends cards so they are not shown in reviews (reversible with unsuspend). Returns true if at least one card was not already suspended, false otherwise. |
| unsuspendA | Unsuspends cards so they return to reviews. Returns true if at least one card was suspended before, false otherwise. |
| are_suspendedA | Returns an array of booleans (same order as input) telling whether each card is suspended; null for unknown card IDs. |
| are_dueA | Returns an array of booleans (same order as input) telling whether each card is due for review now. Learning cards with an interval over 20 minutes count as not due until that time has passed. |
| get_intervalsA | Returns review intervals per card (same order as input). Negative values are in seconds, positive values in days. With complete=true returns the full interval history per card as arrays; otherwise only the most recent interval. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 33 tools
The notes-vs-cards split is explicitly flagged in nearly every relevant description (find_notes/find_cards, notes_info/cards_info, cards_to_notes), which heads off the biggest confusion risk. A few near-duplicate pairs remain (deck_names vs deck_names_and_ids, model_names vs model_names_and_ids), and get_decks misleadingly takes card IDs rather than returning decks, but descriptions disambiguate them.
Conventions are mixed: verb_noun (get_tags, add_note, delete_decks, find_cards), bare noun phrases (deck_names, model_names, version, notes_info, cards_info), and bare verbs (suspend, unsuspend). The get_ prefix is applied inconsistently (get_tags but not deck_names) and get_decks is semantically misleading, though all names stay snake_case and readable.
33 tools is heavy; the domain is genuinely broad (decks, note types, notes, cards, media, scheduling), but several slots are consolitable duplicates such as deck_names/deck_names_and_ids and model_names/model_names_and_ids that could be one parameterized call. It sits at the upper edge of practical for an agent to scan.
Strong read/create/update coverage for notes, tags, cards, media and decks, but there is no note deletion tool and no way to grade/answer a card or set due dates, so the review lifecycle and cleanup are dead ends. Deck config is readable but not writable, and deck creation only happens implicitly via change_deck.