Skip to main content
Glama
anki-connect-mcp
by SolarianGG

PyAnkiConnectMCP

MCP Server for anki connect

The anki-connect-mcp package is an MCP server for the Anki-Connect API v1 (JSON-RPC 2.0, POST http://127.0.0.1:8765/api/v1).

Each of the 95 API methods is exposed as a separate MCP tool: decks.create → decks_create, advanced.cards.update → advanced_cards_update, and so on. Tool input schemas are generated from the official machine-readable contract api-v1.schema.json (bundled with the package), so parameters, required fields and constraints match the documentation exactly.

Requirements

  • Python 3.11+

  • Anki 26.08+ with the Anki-Connect add-on (a version providing API v1) installed and enabled

Related MCP server: Anki MCP Server

Installation

python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e .

Connecting a client

The server speaks MCP over stdio. The examples below use /path/to/PyAnkiConnectMCP for the directory you cloned the repository into. The executable is .venv/bin/anki-connect-mcp on Linux/macOS and .venv\Scripts\anki-connect-mcp.exe on Windows; python -m anki_connect_mcp from the virtual environment works as well.

Claude Code

claude mcp add anki -- /path/to/PyAnkiConnectMCP/.venv/bin/anki-connect-mcp

Claude Desktop and other clients

Add the server to mcpServers in the client config:

{
  "mcpServers": {
    "anki": {
      "command": "/path/to/PyAnkiConnectMCP/.venv/bin/anki-connect-mcp",
      "env": { "ANKICONNECT_API_KEY": "" }
    }
  }
}

LangGraph

LangChain agents are LangGraph graphs, and LangChain loads MCP tools through langchain.mcp (langchain[mcp]>=1.4.0). Install it in your agent's environment:

pip install "langchain[mcp]" "langchain[anthropic]"

Then connect the server and hand its tools to an agent:

import asyncio

from langchain.agents import create_agent
from langchain.mcp import MCPAdapter

CONFIG = {
    "mcpServers": {
        "anki": {
            "command": "/path/to/PyAnkiConnectMCP/.venv/bin/anki-connect-mcp",
            # Any CLI flag from the Configuration table can be passed here.
            "args": ["--include", "decks.*,notes.*,cards.*"],
        },
    }
}


async def main():
    async with MCPAdapter(CONFIG) as adapter:
        tools = await adapter.list_tools()
        agent = create_agent("claude-sonnet-5-5", tools)
        result = await agent.ainvoke(
            {"messages": [{"role": "user", "content": "Create a deck called Vocabulary."}]}
        )
        print(result["messages"][-1].content)


asyncio.run(main())

Notes:

  • With a single server the tool names are unchanged (decks_create); when the config lists several servers, LangChain prefixes them with the config key (anki_decks_create).

  • langchain.mcp is in beta and emits a LangChainBetaWarning on import.

  • The server process lives as long as the async with block; run the agent inside it.

  • Pass the API key with "args": ["--api-key", "..."] if Anki-Connect requires one.

  • create_agent returns a compiled LangGraph graph, so the agent can also be used as a node in your own StateGraph.

  • On LangChain versions before 1.4.0, use MultiServerMCPClient from the langchain-mcp-adapters package with {"anki": {"command": ..., "args": [...], "transport": "stdio"}} and await client.get_tools() instead.

Configuration

Environment variable

Flag

Default

Purpose

ANKICONNECT_URL

--url

http://127.0.0.1:8765/api/v1

API v1 endpoint

ANKICONNECT_API_KEY

--api-key

—

apiKey from the add-on settings (sent as Authorization: Bearer)

ANKICONNECT_TIMEOUT

--timeout

60

HTTP timeout per request, seconds

ANKI_MCP_READ_ONLY

--read-only

off

Expose only read methods (plus operations_get)

ANKI_MCP_INCLUDE

--include

all

Comma-separated method patterns, e.g. decks.*,notes.*

ANKI_MCP_EXCLUDE

--exclude

—

Hide methods, e.g. application.exit,advanced.*

ANKI_MCP_LOG_LEVEL

—

WARNING

Log level (logs go to stderr)

If your client struggles with a large number of tools, narrow the set with --include.

How it works

  • Errors. JSON-RPC errors are returned as a tool result with isError: true and the fields code, type (notFound, validationFailed, staleSession, …), message and data. HTTP rejections (401/403/405/413) and an unreachable Anki are also turned into clear errors.

  • Long-running operations. Methods with Completion: operation (collection.sync, packages.import, browser.open, api.execute, …) return a handle. The server polls operations.get itself and returns the final result. These tools accept two extra arguments that are not sent to Anki:

    • waitForCompletion (default true) — false returns the handle immediately;

    • timeoutSeconds (default 300) — when it expires, the pending operation record is returned; the work in Anki is not cancelled.

  • Annotations. readOnlyHint is set for methods with effect: read, and destructiveHint for methods that delete or overwrite data. Clients use these hints to ask for confirmation.

  • Write requests are never retried automatically (the documentation states explicitly that a request ID is not an idempotency key).

Updating the schema

When a new API version is released, replace src/anki_connect_mcp/api-v1.schema.json with api-v1.schema.json from the Anki-Connect repository — new methods will appear automatically.

Tests

.\.venv\Scripts\python.exe -m pip install -e ".[test]"
.\.venv\Scripts\python.exe -m pytest

Available Tools

95 tools
access_requestPermissionaccess.requestPermissionB

Ask for access using the transport-supplied origin.

Never accept origin or allowed from parameters. Authentication exemption matches legacy permission discovery.

Anki-Connect method access.requestPermission. Scope: application. Effect: permission. Completion: completed. Undo: none.

Possible errors: internalError, invalidParams.

Inputs: no named parameters.

advanced_cards_updateadvanced.cards.updateA
Destructive

Edit validated expert scheduling metadata through native card persistence.

No id/noteId/deckId/template/queue/type/due/mod/usn writes. Moves, due changes and transitions use domain commands. Reject inconsistent coupled-state edits instead of inferring omitted state. Capability detection may restrict writable properties.

Anki-Connect method advanced.cards.update. Scope: collection. Effect: advancedWrite. Completion: completed. Undo: single.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession, unsupportedCapability, validationFailed.

Inputs: patch (required), cardId (required), session.

advanced_reviews_importadvanced.reviews.importA
Destructive

Import historical revlog records, not live answers.

Validate all records; reject duplicate IDs both internally and against collection. Derive answeredAt from ID, set usn=-1 locally. Bound SQL in one database transaction; no schema interpolation. Do not change card scheduling/counters or claim a live answer. FSRS memory remains current stored state; later recomputation may consume imported history. Expose only when transactional import and post-write notifications are verified.

Anki-Connect method advanced.reviews.import. Scope: collection. Effect: advancedWrite. Completion: operation. Undo: clears.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: collectionUnavailable, conflict, editorConflict, internalError, invalidParams, notFound, staleSession, unsupportedCapability, validationFailed.

Inputs: reviews (required), session, timeoutSeconds, waitForCompletion.

api_describeapi.describeB
Read-only

Discover methods, schemas, limits and runtime capabilities.

Anki-Connect method api.describe. Scope: application. Effect: read. Completion: completed. Undo: none.

Possible errors: internalError, invalidParams.

Inputs: no named parameters.

api_executeapi.executeA

Execute commands sequentially with completion barriers and independent results.

Continue after errors. No nested api.execute, application.exit or profiles.switch commands. Pin the active collection session for collection-scoped commands; a session change fails remaining such commands. Validate each command with its named method schema. Never an atomic transaction.

Anki-Connect method api.execute. Scope: application. Effect: batch. Completion: operation. Undo: perCommand.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: internalError, invalidParams.

Inputs: commands (required), timeoutSeconds, waitForCompletion.

application_exitapplication.exitA
Destructive

Acknowledge a close request, then initiate normal application close after sending the response.

Accepted means the request was scheduled, not that Anki has exited. Native close/save/sync dialogs may cancel it. Retain timer/callback ownership; process exit prevents polling a final operation result.

Anki-Connect method application.exit. Scope: application. Effect: lifecycle. Completion: completed. Undo: none.

Possible errors: internalError, invalidParams.

Inputs: no named parameters.

application_importFileapplication.importFileA
Destructive

Run the interactive import workflow, including file choice when omitted.

Anki-Connect method application.importFile. Scope: collection. Effect: write. Completion: operation. Undo: clears.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: cancelled, collectionUnavailable, editorConflict, internalError, invalidParams, ioError, notFound, staleSession.

Inputs: path, session, timeoutSeconds, waitForCompletion.

application_navigateapplication.navigateA

Navigate the main window to a requested view.

deck is required for deckOverview/review and prohibited for deckBrowser.

Anki-Connect method application.navigate. Scope: collection. Effect: gui. Completion: operation. Undo: none.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: collectionUnavailable, internalError, invalidParams, invalidState, notFound, staleSession.

Inputs: view (required), deck, session, timeoutSeconds, +1 more.

browser_getSelectionbrowser.getSelectionA
Read-only

Read browser selection; closed browser returns open=false and empty arrays.

Anki-Connect method browser.getSelection. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, staleSession.

Inputs: session.

browser_openbrowser.openA

Open the browser and finish after the requested search/sort completes.

Omitted query preserves existing browser search. Explicit direction is applied regardless of previous/default column order.

Anki-Connect method browser.open. Scope: collection. Effect: gui. Completion: operation. Undo: none.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: collectionUnavailable, internalError, invalidParams, invalidSearch, invalidState, staleSession.

Inputs: sort, query, session, timeoutSeconds, +1 more.

browser_selectbrowser.selectA

Replace selection in an already open browser.

Exactly one selector. Note IDs select their cards in card mode; card IDs select their notes in note mode. This method does not open a closed browser.

Anki-Connect method browser.select. Scope: collection. Effect: gui. Completion: operation. Undo: none.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: collectionUnavailable, internalError, invalidParams, invalidState, notFound, staleSession.

Inputs: cardIds, noteIds, session, timeoutSeconds, +1 more.

cards_getcards.getA
Read-only

Read stored card state without rendering or predicting answers.

Anki-Connect method cards.get. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: id (required), session.

cards_getManycards.getManyA
Read-only

Get cards in input order.

Anki-Connect method cards.getMany. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: ids (required), session.

cards_movecards.moveA

Move cards with Collection.set_deck and target-preset invariants.

Target must already exist and be normal. Moving out of a filtered deck restores native state first through the native move operation.

Anki-Connect method cards.move. Scope: collection. Effect: write. Completion: completed. Undo: perItem.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, invalidState, notFound, staleSession.

Inputs: ids (required), deck (required), session.

cards_rendercards.renderB
Read-only

Render a stored card with Anki rendering.

Anki-Connect method cards.render. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: id (required), session.

cards_setFlagscards.setFlagsA

Set the user flag through Anki native flag persistence.

Zero clears the user flag; preserve other backend flag bits.

Anki-Connect method cards.setFlags. Scope: collection. Effect: write. Completion: completed. Undo: perItem.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession.

Inputs: ids (required), flag (required), session.

cards_setSuspendedcards.setSuspendedA

Suspend or restore cards idempotently.

changed=false means already in requested state. Process repeated mutation IDs once and repeat their result.

Anki-Connect method cards.setSuspended. Scope: collection. Effect: write. Completion: completed. Undo: perItem.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession.

Inputs: ids (required), suspended (required), session.

collection_checkIntegritycollection.checkIntegrityA

Run Anki database checks and repairs with normal UI completion.

Anki-Connect method collection.checkIntegrity. Scope: collection. Effect: write. Completion: operation. Undo: clears.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: cancelled, collectionUnavailable, editorConflict, internalError, invalidParams, staleSession.

Inputs: session, timeoutSeconds, waitForCompletion.

collection_getcollection.getB
Read-only

Inspect the active collection and its session.

Anki-Connect method collection.get. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, staleSession.

Inputs: session.

collection_refreshcollection.refreshA

Refresh windows, optionally invalidating supported collection caches first.

Does not close/reopen the collection and does not repair invalid scheduling state.

Anki-Connect method collection.refresh. Scope: collection. Effect: refresh. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, staleSession.

Inputs: target, session.

collection_synccollection.syncA
Destructive

Run one coordinated GUI/background sync.

Full sync choices are waitingForUser; never launch a second sync. includeMedia is intersected with profile media-sync settings.

Anki-Connect method collection.sync. Scope: collection. Effect: lifecycle. Completion: operation. Undo: none.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: authenticationRequired, busy, cancelled, collectionUnavailable, editorConflict, internalError, invalidParams, ioError, staleSession.

Inputs: session, includeMedia, timeoutSeconds, waitForCompletion.

collection_undocollection.undoA
Destructive

Undo the current Anki undo entry.

Anki-Connect method collection.undo. Scope: collection. Effect: write. Completion: operation. Undo: undo.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, invalidState, staleSession.

Inputs: session, timeoutSeconds, waitForCompletion.

deckPresets_assigndeckPresets.assignA

Assign a preset and execute native dependent-card updates.

Anki-Connect method deckPresets.assign. Scope: collection. Effect: write. Completion: operation. Undo: perItem.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, invalidState, notFound, staleSession.

Inputs: decks (required), preset (required), session, rescheduleFsrs, +2 more.

deckPresets_createdeckPresets.createA

Create a preset by cloning a specified preset or native defaults.

Anki-Connect method deckPresets.create. Scope: collection. Effect: write. Completion: completed. Undo: single.

Possible errors: collectionUnavailable, conflict, editorConflict, internalError, invalidParams, notFound, staleSession.

Inputs: name (required), session, cloneFrom.

deckPresets_deletedeckPresets.deleteA
Destructive

Delete a preset, explicitly reassigning dependent decks first.

replacement is required when in use. Reject Default preset deletion. No changes occur on failed preflight; do not promise atomicity across multiple native backend operations.

Anki-Connect method deckPresets.delete. Scope: collection. Effect: write. Completion: operation. Undo: grouped.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: collectionUnavailable, conflict, editorConflict, internalError, invalidParams, notFound, staleSession.

Inputs: preset (required), session, replacement, timeoutSeconds, +1 more.

deckPresets_getdeckPresets.getA
Read-only

Read a typed preset.

Anki-Connect method deckPresets.get. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: preset (required), session.

deckPresets_listdeckPresets.listA
Read-only

List available deck presets.

Anki-Connect method deckPresets.list. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, staleSession.

Inputs: session.

deckPresets_updatedeckPresets.updateA

Update a preset and all dependent cards through the coordinated backend request.

Require name or settings. Preserve current target deck, collection settings, overrides and custom scheduler in the update request. rescheduleFsrs explicitly controls optional full rescheduling; mandatory native memory/step updates still run.

Anki-Connect method deckPresets.update. Scope: collection. Effect: write. Completion: operation. Undo: single.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession, validationFailed.

Inputs: preset (required), name, session, settings, +3 more.

decks_createdecks.createA

Create a normal deck, returning the existing deck for an exact existing name.

Anki-Connect method decks.create. Scope: collection. Effect: write. Completion: completed. Undo: single.

Possible errors: collectionUnavailable, conflict, editorConflict, internalError, invalidParams, staleSession.

Inputs: name (required), session.

decks_deletedecks.deleteA
Destructive

Delete decks and their cards with explicit acknowledgement.

Includes native child-deck deletion and removal of resulting cardless notes; deleting Default follows native behavior.

Anki-Connect method decks.delete. Scope: collection. Effect: write. Completion: completed. Undo: perItem.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, invalidState, notFound, staleSession.

Inputs: decks (required), deleteCards (required), session.

decks_getdecks.getA
Read-only

Resolve a deck without creating it or falling back to Default.

Anki-Connect method decks.get. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: deck (required), session.

decks_getCountsdecks.getCountsB
Read-only

Get native due-tree counts and total cards.

Anki-Connect method decks.getCounts. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: deck (required), session, includeChildren.

decks_listdecks.listA
Read-only

List decks in case-sensitive name order.

Anki-Connect method decks.list. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, staleSession.

Inputs: session.

decks_updatedecks.updateA

Rename a deck using native hierarchy handling.

Anki-Connect method decks.update. Scope: collection. Effect: write. Completion: completed. Undo: single.

Possible errors: collectionUnavailable, conflict, editorConflict, internalError, invalidParams, notFound, staleSession.

Inputs: deck (required), name (required), session.

editors_openAddeditors.openAddA

Open or activate the configured Add editor and optionally populate a draft.

Use the active legacy/Svelte variant. Do not run duplicate/empty-field eligibility checks on an unfinished draft. Return noteId=null until persisted; do not claim ID 0 identifies a future note.

Anki-Connect method editors.openAdd. Scope: collection. Effect: gui. Completion: operation. Undo: none.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession.

Inputs: note, session, timeoutSeconds, waitForCompletion.

editors_openNoteeditors.openNoteA

Open the custom note editor and finish once it is ready.

Anki-Connect method editors.openNote. Scope: collection. Effect: gui. Completion: operation. Undo: none.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession.

Inputs: noteId (required), session, timeoutSeconds, waitForCompletion.

editors_updateDrafteditors.updateDraftA

Update an Add draft through coordinated dialog setters.

Set note type before explicit deck. replace changes only supplied fields/tags. append concatenates supplied field strings and unions tags; deck/type still replace. Reject invalid fields before altering the draft.

Anki-Connect method editors.updateDraft. Scope: collection. Effect: gui. Completion: operation. Undo: none.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession.

Inputs: patch (required), editorId (required), mode, session, +2 more.

media_deletemedia.deleteA
Destructive

Move media to Anki trash without deleting notes.

Anki-Connect method media.delete. Scope: collection. Effect: media. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: filename (required), session.

media_getmedia.getA
Read-only

Read media bytes as base64.

A basename is required; no filesystem traversal or arbitrary paths.

Anki-Connect method media.get. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: filename (required), session.

media_getDirectorymedia.getDirectoryA
Read-only

Return the local active collection media directory.

Anki-Connect method media.getDirectory. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, staleSession.

Inputs: session.

media_listmedia.listA
Read-only

List normalized media basenames matching a basename glob.

Anki-Connect method media.list. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, staleSession.

Inputs: pattern, session.

media_storemedia.storeA

Acquire and store media using Anki filename normalization.

Reject traversal and path separators in filename. Validate strict base64 and source types before acquisition. Skip comparison is against incoming bytes and never deletes an existing file. Replacement is explicit and not collection-undoable.

Anki-Connect method media.store. Scope: collection. Effect: media. Completion: operation. Undo: none.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: collectionUnavailable, conflict, internalError, invalidParams, ioError, notFound, staleSession.

Inputs: source (required), filename (required), session, collision, +3 more.

notes_convertnotes.convertA
Destructive

Convert same-type notes through Anki note-type conversion.

Mappings are complete target-name to source-name/null lists. Reject duplicate source mappings, mixed source note types and stale tokens. Removed source templates lose their cards/history as defined by Anki; cloze mappings use native supported rules, never raw mid assignment.

Anki-Connect method notes.convert. Scope: collection. Effect: write. Completion: completed. Undo: single.

Possible errors: collectionUnavailable, conflict, editorConflict, internalError, invalidParams, notFound, staleSession, unsupportedCapability.

Inputs: ids (required), fields (required), target (required), planToken (required), +2 more.

notes_createnotes.createB

Create a note and return its actual generated cards.

Anki-Connect method notes.create. Scope: collection. Effect: write. Completion: completed. Undo: single.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession, validationFailed.

Inputs: deck (required), fields (required), noteType (required), tags, +3 more.

notes_createManynotes.createManyA

Create notes independently, or as one native atomic collection batch.

atomic=true validates the full set including within-batch duplicates, then uses Collection.add_notes. Any failure is a top-level error with indexed issues and no collection changes. Success keeps the same items result shape. Empty input is a no-op.

Anki-Connect method notes.createMany. Scope: collection. Effect: write. Completion: completed. Undo: perItemOrAtomic.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession, validationFailed.

Inputs: notes (required), atomic, session.

notes_deletenotes.deleteA
Destructive

Delete notes and their cards; missing IDs are item errors.

Anki-Connect method notes.delete. Scope: collection. Effect: write. Completion: completed. Undo: perItem.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession.

Inputs: ids (required), session.

notes_findEmptynotes.findEmptyA
Read-only

Find cleanup candidates by an explicit criterion.

No deletion. allFieldsEmpty uses native HTML-aware emptiness; allQuestionsEmpty uses native empty-card generation. Return all matching IDs through normal cursor pagination.

Anki-Connect method notes.findEmpty. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, invalidSearch, staleSession.

Inputs: criterion (required), limit, query, cursor, +1 more.

notes_getnotes.getA
Read-only

Get a note, including an empty cardIds array for cardless notes.

Anki-Connect method notes.get. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: id (required), session.

notes_getManynotes.getManyA
Read-only

Get notes in input order, preserving repeated IDs.

Anki-Connect method notes.getMany. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: ids (required), session.

notes_planConversionnotes.planConversionB
Read-only

Get native suggested field/template mappings and a schema token.

Anki-Connect method notes.planConversion. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: source (required), target (required), session.

notes_updatenotes.updateA

Apply fields and tags together in one native note update.

Anki-Connect method notes.update. Scope: collection. Effect: write. Completion: completed. Undo: single.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession, validationFailed.

Inputs: id (required), patch (required), session.

notes_validatenotes.validateA
Read-only

Validate note content and duplicate scope without acquiring media.

Semantic content failures return valid=false and issues; bad references or parameter types are RPC errors.

Anki-Connect method notes.validate. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: note (required), session.

notes_validateManynotes.validateManyA
Read-only

Validate each note independently without side effects.

Anki-Connect method notes.validateMany. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, staleSession.

Inputs: notes (required), session.

noteTypes_createnoteTypes.createA

Create a normal or cloze note type.

Anki-Connect method noteTypes.create. Scope: collection. Effect: write. Completion: completed. Undo: single.

Possible errors: collectionUnavailable, conflict, editorConflict, internalError, invalidParams, staleSession, validationFailed.

Inputs: name (required), fields (required), templates (required), css, +6 more.

noteTypes_deleteUnusednoteTypes.deleteUnusedA
Destructive

Delete only explicitly selected note types whose use count is zero.

Anki-Connect method noteTypes.deleteUnused. Scope: collection. Effect: write. Completion: completed. Undo: perItem.

Possible errors: collectionUnavailable, conflict, editorConflict, internalError, invalidParams, notFound, staleSession.

Inputs: noteTypes (required), session.

noteTypes_editStructurenoteTypes.editStructureA

Apply ordered structural edits and persist once using native note-type updates.

Carry original field/template ordinals to preserve card identity. Added entries have no original ordinal. Validate all edits on a copy before saving; reject last field/template removal and invalid cloze structures.

Anki-Connect method noteTypes.editStructure. Scope: collection. Effect: write. Completion: completed. Undo: single.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession, validationFailed.

Inputs: edits (required), noteType (required), session.

noteTypes_getnoteTypes.getB
Read-only

Read ordered fields/templates and styling.

Anki-Connect method noteTypes.get. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: noteType (required), session.

noteTypes_getTemplateUsagenoteTypes.getTemplateUsageA
Read-only

Inspect question/answer template field references.

Python adapter mirrors native token rules because the parsed tree is not exposed to Python. Includes conditional fields and filtered replacements, ignores HTML comments and special fields, supports legacy alternate delimiters, and returns real fields once in first-reference order.

Anki-Connect method noteTypes.getTemplateUsage. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession, validationFailed.

Inputs: noteType (required), session.

noteTypes_listnoteTypes.listA
Read-only

List note types in name order.

Anki-Connect method noteTypes.list. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, staleSession.

Inputs: session.

noteTypes_replaceTextnoteTypes.replaceTextA
Destructive

Replace literal text in explicit note types or all note types.

Exactly one selector: noteTypes or allNoteTypes=true. Count changed types, not occurrences.

Anki-Connect method noteTypes.replaceText. Scope: collection. Effect: write. Completion: completed. Undo: grouped.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, staleSession.

Inputs: find (required), replace (required), session, targets, +2 more.

noteTypes_updatenoteTypes.updateA

Update nonstructural note-type settings.

Anki-Connect method noteTypes.update. Scope: collection. Effect: write. Completion: completed. Undo: single.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession, validationFailed.

Inputs: patch (required), noteType (required), session.

operations_canceloperations.cancelA
Destructive

Request supported cancellation without claiming rollback.

Already terminal returns requested=false. Queued operations can cancel; running operations use native cancellation only. A cancellation request may lose a race with success.

Anki-Connect method operations.cancel. Scope: application. Effect: lifecycle. Completion: completed. Undo: none.

Possible errors: internalError, invalidParams, notFound, unsupportedCapability.

Inputs: operationId (required).

operations_getoperations.getA
Read-only

Poll operation status and its eventual typed result/error.

Anki-Connect method operations.get. Scope: application. Effect: read. Completion: completed. Undo: none.

Possible errors: internalError, invalidParams, notFound.

Inputs: operationId (required).

packages_exportpackages.exportA

Export the specified deck package.

Anki-Connect method packages.export. Scope: collection. Effect: filesystem. Completion: operation. Undo: none.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: cancelled, collectionUnavailable, internalError, invalidParams, ioError, notFound, staleSession.

Inputs: deck (required), path (required), session, timeoutSeconds, +2 more.

packages_importpackages.importA
Destructive

Import an Anki package with normal collection completion.

Anki-Connect method packages.import. Scope: collection. Effect: write. Completion: operation. Undo: clears.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: cancelled, collectionUnavailable, editorConflict, internalError, invalidParams, ioError, notFound, staleSession.

Inputs: path (required), session, timeoutSeconds, waitForCompletion.

profiles_getActiveprofiles.getActiveA
Read-only

Return the active profile or null.

Anki-Connect method profiles.getActive. Scope: application. Effect: read. Completion: completed. Undo: none.

Possible errors: internalError, invalidParams.

Inputs: no named parameters.

profiles_listprofiles.listA
Read-only

List existing profiles.

Anki-Connect method profiles.list. Scope: application. Effect: read. Completion: completed. Undo: none.

Possible errors: internalError, invalidParams.

Inputs: no named parameters.

profiles_switchprofiles.switchA
Destructive

Switch profiles and finish when the destination collection is ready.

Anki-Connect method profiles.switch. Scope: application. Effect: lifecycle. Completion: operation. Undo: none.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: busy, cancelled, internalError, invalidParams, notFound.

Inputs: name (required), timeoutSeconds, waitForCompletion.

reviewer_answerreviewer.answerA

Answer the active card using reviewer-retained states and await actual completion.

Requires answer side and an offered rating. Do not resolve success until backend completion and UI notifications; reviewer hook veto returns vetoed.

Anki-Connect method reviewer.answer. Scope: collection. Effect: write. Completion: operation. Undo: single.

Long-running operation: by default the server waits for the final result (see waitForCompletion / timeoutSeconds).

Possible errors: collectionUnavailable, conflict, editorConflict, internalError, invalidParams, invalidState, staleSession, vetoed.

Inputs: rating (required), stateToken (required), session, timeoutSeconds, +1 more.

reviewer_getreviewer.getA
Read-only

Read active reviewer state and retained custom scheduling predictions.

Inactive reviewer returns null card/rendered/token, side=none and empty answers.

Anki-Connect method reviewer.get. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, staleSession.

Inputs: session.

reviewer_playAudioreviewer.playAudioA

Replay audio for the current side.

Anki-Connect method reviewer.playAudio. Scope: collection. Effect: gui. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, conflict, internalError, invalidParams, invalidState, staleSession.

Inputs: stateToken (required), session.

reviewer_showAnswerreviewer.showAnswerA

Show the answer for the active reviewer card.

Anki-Connect method reviewer.showAnswer. Scope: collection. Effect: gui. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, conflict, internalError, invalidParams, invalidState, staleSession.

Inputs: stateToken (required), session.

reviewer_showQuestionreviewer.showQuestionA

Show the question for the active reviewer card.

Anki-Connect method reviewer.showQuestion. Scope: collection. Effect: gui. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, conflict, internalError, invalidParams, invalidState, staleSession.

Inputs: stateToken (required), session.

reviewer_startTimerreviewer.startTimerA

Restart the active reviewer card timer.

Anki-Connect method reviewer.startTimer. Scope: collection. Effect: gui. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, conflict, internalError, invalidParams, invalidState, staleSession.

Inputs: stateToken (required), session.

reviews_getLatestIdreviews.getLatestIdB
Read-only

Return the latest matching history ID or null.

Anki-Connect method reviews.getLatestId. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: deck, cardIds, session, membership.

reviews_listreviews.listA
Read-only

Read review history ordered by ascending review ID.

cardIds and deck are mutually exclusive. No selector means all history. afterId is exclusive. Current/home membership is explicit for filtered cards.

Anki-Connect method reviews.list. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleCursor, staleSession.

Inputs: deck, limit, cursor, afterId, +5 more.

scheduling_answerscheduling.answerA

Answer using native states matching the supplied prediction token.

Reject suspended/buried and filtered-preview cards. For the active GUI card use reviewer.answer. Native elapsed-time capping applies. No client-supplied historical answer timestamp.

Anki-Connect method scheduling.answer. Scope: collection. Effect: write. Completion: completed. Undo: single.

Possible errors: collectionUnavailable, conflict, editorConflict, internalError, invalidParams, invalidState, notFound, staleSession.

Inputs: cardId (required), rating (required), stateToken (required), session, +1 more.

scheduling_answerManyscheduling.answerManyA

Answer cards independently in input order.

Anki-Connect method scheduling.answerMany. Scope: collection. Effect: write. Completion: completed. Undo: perItem.

Possible errors: collectionUnavailable, conflict, editorConflict, internalError, invalidParams, invalidState, notFound, staleSession.

Inputs: answers (required), session.

scheduling_getscheduling.getB
Read-only

Read authoritative current scheduling state.

Anki-Connect method scheduling.get. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: cardId (required), session.

scheduling_getDuescheduling.getDueA
Read-only

Inspect queue-aware due eligibility without requiring history.

dueNow excludes learn-ahead and suspended/buried queues. New cards are available but have no timed due obligation. available ignores daily deck limits; includeLearnAhead expands learning availability only.

Anki-Connect method scheduling.getDue. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: cardId (required), session, includeLearnAhead.

scheduling_getQueuescheduling.getQueueA
Read-only

Read cards in native scheduler order with remaining counts.

Uses Anki's currently selected deck and respects native limits, mixing and scheduler order. Reading the queue is idempotent; subsequent scheduling changes can change the snapshot.

Anki-Connect method scheduling.getQueue. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, staleSession.

Inputs: session, fetchLimit.

scheduling_predictscheduling.predictA
Read-only

Predict native answers and issue a session-scoped state token.

Does not represent custom states held by the GUI reviewer. Tokens are invalidated by relevant writes, undo, profile change and scheduler-day rollover.

Anki-Connect method scheduling.predict. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, invalidState, notFound, staleSession.

Inputs: cardId (required), session.

scheduling_resetscheduling.resetA
Destructive

Reset cards as new using the native scheduler.

Anki-Connect method scheduling.reset. Scope: collection. Effect: write. Completion: completed. Undo: perItem.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession.

Inputs: cardIds (required), log, session, resetCounts, +1 more.

scheduling_setDueDatescheduling.setDueDateA

Set due dates using Anki native days/range syntax.

Anki-Connect method scheduling.setDueDate. Scope: collection. Effect: write. Completion: completed. Undo: perItem.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession, validationFailed.

Inputs: days (required), cardIds (required), session.

statistics_getHtmlstatistics.getHtmlB
Read-only

Return the supported legacy HTML report, labelled as such.

Anki-Connect method statistics.getHtml. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: deck, session.

statistics_getReviewDaysstatistics.getReviewDaysA
Read-only

Return all nonempty historical review days in descending date order using native graph day conventions.

Anki-Connect method statistics.getReviewDays. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, staleSession.

Inputs: session.

statistics_getSummarystatistics.getSummaryA
Read-only

Get structured collection statistics or an explicit deck including children.

Anki-Connect method statistics.getSummary. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, notFound, staleSession.

Inputs: deck, session.

statistics_getTodaystatistics.getTodayA
Read-only

Count actual reviews in Anki current scheduler day, excluding manual/rescheduled entries.

Anki-Connect method statistics.getToday. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, staleSession.

Inputs: session.

tags_addtags.addB

Add tags on selected notes.

Anki-Connect method tags.add. Scope: collection. Effect: write. Completion: completed. Undo: perItem.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession.

Inputs: tags (required), noteIds (required), session.

tags_deleteUnusedtags.deleteUnusedA
Destructive

Remove unused tag registrations.

Anki-Connect method tags.deleteUnused. Scope: collection. Effect: write. Completion: completed. Undo: single.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, staleSession.

Inputs: session.

tags_listtags.listA
Read-only

List registered tags.

Anki-Connect method tags.list. Scope: collection. Effect: read. Completion: completed. Undo: none.

Possible errors: collectionUnavailable, internalError, invalidParams, staleSession.

Inputs: session.

tags_removetags.removeA

Remove tags on selected notes.

Anki-Connect method tags.remove. Scope: collection. Effect: write. Completion: completed. Undo: perItem.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, notFound, staleSession.

Inputs: tags (required), noteIds (required), session.

tags_replacetags.replaceA
Destructive

Replace a tag on explicit notes or all notes.

Exactly one selector: noteIds or allNotes=true. Never interpret an omitted selector as all notes.

Anki-Connect method tags.replace. Scope: collection. Effect: write. Completion: completed. Undo: single.

Possible errors: collectionUnavailable, editorConflict, internalError, invalidParams, staleSession.

Inputs: to (required), from (required), noteIds, session, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 95 tools

    Disambiguation4/5

    Tools are organized by resource namespace and most actions are explicitly scoped, but with 95 operations there are many near-neighbors such as get vs getMany, validate vs validateMany, scheduling.answer vs reviewer.answer, and media.get vs media.list. The detailed descriptions usually resolve these boundaries, so an agent can distinguish them, though not effortlessly.

    Naming Consistency5/5

    Every tool follows a predictable resource_action convention, with the resource namespace followed by a camelCase action such as notes_create, cards_setSuspended, deckPresets_list, and advanced_cards_update. Suffix variants like getMany or deleteUnused remain systematic and consistent.

    Tool Count1/5

    95 tools is far beyond an appropriate MCP surface for agent selection; even for a full Anki desktop integration, many granular and long-tail operations are exposed as separate tools. This forces agents to navigate an extremely large toolset rather than a well-scoped set of workflows.

    Completeness5/5

    The surface comprehensively covers collection, notes, cards, decks, note types, deck presets, tags, media, scheduling, reviews, statistics, GUI/browser/editor actions, profiles, packages, operations, and advanced maintenance. There are no obvious domain lifecycle gaps.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      A
      maintenance
      Exposes Anki flashcard collections to AI assistants via MCP, enabling AI-powered study sessions, card creation, deck management, and review workflows. Supports comprehensive collection operations including search, media management, and note type customization.
      102
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides programmatic access to Anki flashcard operations through the AnkiConnect API, allowing users to list and create decks and cards. It enables seamless management of flashcards directly from MCP-compatible clients like Claude Desktop.
      -
    • A
      license
      B
      quality
      C
      maintenance
      Enables AI assistants to manage Anki flashcards, decks, note types, tags, and media via AnkiConnect. Supports operations like adding, editing, finding, and syncing cards through a local MCP server.
      100
      MIT