Skip to main content
Glama
chadlis

anki-mcp

by chadlis

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
extensions
{
  "io.modelcontextprotocol/ui": {}
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
anki_check_connectionA

Check that Anki is running and AnkiConnect is reachable.

Call this first when any other Anki tool fails — it distinguishes "Anki is closed" from "the request itself was wrong".

Returns the AnkiConnect API version (6) on success.

anki_syncA

Sync the local collection with AnkiWeb.

Requires AnkiWeb credentials already configured in Anki — this cannot log in for you. The action returns nothing on success; a sync conflict opens a modal dialog in Anki, which blocks AnkiConnect until you resolve it (the call will then time out).

anki_list_decksA

List every deck in the collection.

Nested decks are returned with :: as the separator, e.g. "Python::Asyncio" is the "Asyncio" subdeck of "Python".

anki_create_deckA

Create a deck, if it does not already exist.

anki_list_modelsA

List every note type (model) in the collection.

Typical built-ins: "Basic", "Basic (and reversed card)", "Cloze". Use anki_get_model_fields next to learn a model's field names before adding a note with it.

anki_get_model_fieldsA

List a note type's field names, in template order.

These are the exact keys anki_add_note expects in its fields dict — they are case-sensitive and space-sensitive ("Back Extra", not "back_extra").

anki_add_noteA

Add a single note to a deck.

Field values are HTML and are sent verbatim — do not escape them. Write the markup you want rendered on the card:

fields={
    "Text": 'The GIL is released during <b>I/O</b>, so '
            '{{c1::threads}} still help for network-bound work.',
    "Back Extra": '<pre><code>'
                  '<span class="hljs-keyword">async def</span> '
                  '<span class="hljs-title">main</span>(): ...'
                  '</code></pre>',
}

Cloze deletions use {{c1::hidden text}} and require the "Cloze" model (or another cloze-type note type) — the syntax is inert on "Basic".

anki_add_notesA

Add several notes at once, sharing one deck and note type.

Field values are HTML and are sent verbatim — do not escape them. See anki_add_note for the field/cloze conventions; they apply per item.

anki_find_notesA

Find note ids matching an Anki search query.

Uses Anki's own search syntax, the same one as the browser's search bar:

deck:Python                  notes in a deck (and its subdecks)
deck:Python::Asyncio         a specific subdeck
tag:python::asyncio          by tag ("tag:none" = untagged)
note:Cloze                   by note type
"front:*GIL*"                wildcard match on a named field
added:7                      added in the last 7 days
is:due -is:suspended         combine terms; "-" negates

Quote any term containing spaces. Returns ids only — pass them to anki_get_notes_info to see the actual content.

anki_get_notes_infoA

Fetch full details for the given note ids.

Returns each note's model, tags, field contents (as stored — i.e. HTML), and the ids of the cards generated from it. Unknown ids come back as empty entries rather than an error.

Markdown output truncates field values for readability; use response_format="json" to get the untouched HTML.

anki_update_note_fieldsA

Overwrite fields of an existing note.

Field values are HTML and are sent verbatim — do not escape them. Each named field is replaced wholesale, not merged; fields left out of fields keep their current content. Fetch the current values with anki_get_notes_info (response_format="json") before a partial edit.

⚠️ This silently does nothing if the note is open in Anki's Browse window. Anki refuses the edit to avoid clobbering what you are typing, but AnkiConnect still reports success — no error is raised, and the fields are simply unchanged. If an update seems to have no effect, close the Browse window (or click away from that note) and run it again.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chadlis/anki-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server