Skip to main content
Glama

npm CI License Node



MCP server for AnkiWeb, gives an AI agents the shared-deck catalogue and the decks synced to your account, with no Anki desktop app running.

  • Search shared decks and read a listing: description, sample notes, reviews.

  • Download a shared deck's .apkg, and convert it to Markdown the assistant can read.

  • List the decks synced to your account, with due counts.

  • Share one of your decks publicly, only after you have seen a preview and said yes.

  • Reuse the AnkiWeb session already signed in to your browser.

It is not affiliated with AnkiWeb or Ankitects. AnkiWeb's terms do not allow third-party clients and say it can suspend access at its discretion; docs/ankiweb.md quotes the clause. AnkiWeb licenses shared decks for personal use only.

Why this project?

Most Anki MCP servers go through AnkiConnect, an add-on that exposes the collection of a running Anki desktop app. That is the right tool for editing your own cards. It cannot see the shared catalogue, which lives only on AnkiWeb.

AnkiConnect servers

anki-web-mcp

Needs Anki desktop running

yes

no

Search and download shared decks

no

yes

Share a deck publicly

no

yes

List your synced decks

yes

yes

Add, edit or review cards

yes

no

Related MCP server: anki-mcp

Install

Add the server to your MCP client's configuration:

{
  "mcpServers": {
    "anki-web": {
      "command": "npx",
      "args": ["anki-web-mcp@latest"]
    }
  }
}

The server answers its client in under half a second. With @latest, npx first asks the npm registry for the newest version, every time the client starts it, which can leave the server still connecting after the others have loaded. To skip that, run npm install -g anki-web-mcp and use "command": "anki-web-mcp" with no args, upgrading by hand.

Then download the Chromium build the server drives:

npx anki-web-mcp@latest --install-browser

Searching and downloading shared decks work from here, with no account.

Sign in

Listing your decks and sharing one need an AnkiWeb session. The first call that needs one looks for it in a local browser where you are signed in to AnkiWeb:

On macOS that shows one keychain prompt per browser it tries. If no browser has a session, sign in once in a window the server opens:

npx anki-web-mcp@latest --login

You type your password into AnkiWeb's own page, so it never passes through the server. The session stays in ~/.local/state/anki-web-mcp/ on Linux and in ~/.anki-web-mcp/ elsewhere, created 0700, and --logout deletes it. docs/cli.md lists every flag.

Tools

tool

does

search_shared_decks

searches the shared catalogue, with sorting and paging

get_shared_deck

one listing: description, tags, sample notes, reviews

download_shared_deck

saves a shared deck's .apkg, never overwriting a file

convert_deck_to_markdown

turns a local .apkg into Flashcard Markdown and images

list_my_decks

the decks synced to your account, with due counts

list_my_shared_decks

the decks you have shared, with downloads and ratings

share_deck

publishes one of your decks to the shared catalogue

unshare_deck

takes one of your listings off the shared catalogue

delete_deck

deletes one of your decks, and its subdecks and cards

server_status

version, data directory, and whether the session is valid

close_session

closes the headless browser until the next call needs it

convert_deck_to_markdown writes Flashcard Markdown through @ankimd/core, and reports what did not convert.

Changes ask first

share_deck publishes under your account, so it takes two calls. Without confirm: true it only returns a preview, and the assistant is told to show it to you and wait. Removing a listing with unshare_deck and deleting a deck with delete_deck ask the same way.

Confirming also makes AnkiWeb's declaration that you own the material or have a license to share it.

Read-only

Start the server with --read-only, or ANKI_WEB_MCP_READ_ONLY=1, and it lists no tool that changes anything on AnkiWeb, so share_deck, unshare_deck and delete_deck are not offered at all (docs/cli.md):

{ "command": "npx", "args": ["anki-web-mcp@latest", "--read-only"] }

Several accounts

One server can act as more than one AnkiWeb account. Sign each extra one in under a name of your choosing:

npx anki-web-mcp@latest --login --account work

Then ask for it by name ("list the decks on my work account"). Calls that name no account use the one signed in with plain --login, or the one --account gives the server. npx anki-web-mcp@latest --status checks them all.

How it works

AnkiWeb is a single-page app whose data comes from protobuf endpoints under /svc/. The server calls those endpoints directly and renders no pages.

flowchart LR
  A[MCP client] -- stdio --> S[anki-web-mcp]
  S -- "fetch, no cookies" --> P["/svc/shared/*<br>search, listings, downloads"]
  S -- "headless Chromium,<br>signed-in cookie jar" --> U["/svc/decks/*, your /svc/shared/*<br>your decks and listings:<br>list, share, remove, delete"]
  B[Local browser profile] -. "session import" .-> S
  • Shared-deck reads go out without cookies, cached for as long as AnkiWeb allows: ten minutes.

  • After a few anonymous downloads AnkiWeb asks for a login, and the download is retried with your session, from its stored cookie when that is enough.

  • Calls on your account go through one headless browser, one at a time, closed after five idle minutes.

  • Requests are spaced at least a second apart, since AnkiWeb answers 429 after about four searches a minute.

More

Available Tools

11 tools
close_sessionClose the browserA
Idempotent

Close the server's headless browser to free its memory, once any call in progress has finished: the one for account, or without it every one open. The AnkiWeb session stays stored, and the next call that needs the browser starts it again. A browser also closes by itself after five idle minutes.

Inputs: account. Returns: closed

convert_deck_to_markdownConvert a deck to MarkdownA

Convert a local .apkg, such as one download_shared_deck saved, to a Flashcard Markdown file the assistant can read. It goes in a new folder named after the package, with the images its cards use under .images/; nothing existing is replaced. Only basic front-and-back notes convert: cloze and other note types are counted in diagnostics, and review history is not kept.

Inputs: path (required), title, directory. Returns: cards, title, directory, mediaFiles, +3 more

delete_deckDelete a deckA
DestructiveIdempotent

Delete one of the signed-in user's decks, with its subdecks and every card in them, from their AnkiWeb collection. The deletion reaches every device on its next sync and cannot be undone.

Without confirm, nothing is deleted: the call finds the deck and returns a preview of what goes. Show that preview to the user and wait for their explicit go-ahead before calling again with confirm: true.

The confirmed call must name the deck by its numeric id, as the preview gives it, never by name.

With more than one AnkiWeb account stored, the preview names the one the deck belongs to, and the confirmed call must name it in account.

Needs an AnkiWeb session.

Inputs: deck (required), account, confirm. Returns: deck, status, account, listings, +1 more

download_shared_deckDownload a shared deckA

Download a shared deck's .apkg from AnkiWeb to disk and return where it was saved. An existing file is never replaced: the new one gets a numbered name. Works without an AnkiWeb session until AnkiWeb asks for one, which it does after a few downloads; then the signed-in session is used. via says which one the download went through. AnkiWeb licenses shared decks for personal use only.

Inputs: deck (required), account, directory. Returns: via, deck, path, bytes, +1 more

get_shared_deckGet a shared deckA
Read-only

Read a shared deck's AnkiWeb listing: description, tags, size, ratings, sample notes with their media, and reviews. Needs no AnkiWeb session. The notes, audio and images counts are AnkiWeb's own, and audio and images have been seen at 0 for a deck whose sample notes carry both.

Inputs: deck (required), reviews. Returns: id, url, kind, tags, +16 more

list_my_decksList my decksA
Read-only

List the decks synced to the signed-in AnkiWeb account, parents before their subdecks, with due counts and card totals. Needs an AnkiWeb session.

Inputs: account. Returns: decks, currentDeckId, mediaSizeBytes, collectionSizeBytes

list_my_shared_decksList my shared decksA
Read-only

List the decks the signed-in user has shared on AnkiWeb, with downloads and ratings. Needs an AnkiWeb session.

Inputs: account. Returns: items

search_shared_decksSearch shared decksA
Read-only

Search AnkiWeb's shared deck catalogue by title. AnkiWeb returns every match at once, so the results are sorted and paged here. Needs no AnkiWeb session. AnkiWeb rate-limits searches to about four a minute, and a refused address can stay refused for over an hour while get_shared_deck and download_shared_deck keep working; repeating a search within ten minutes is served from cache. The notes, audio and images counts are AnkiWeb's own, and audio and images have been seen at 0 for a deck whose sample notes carry both.

Inputs: query (required), page, sort, limit. Returns: page, query, total, hasMore, +1 more

server_statusServer statusA
Read-only

Report the server version, where sessions and downloads are kept, and whether an AnkiWeb session is stored for each account. With validate, also ask AnkiWeb whether each session, or the one for account, is still signed in.

Inputs: account, validate. Returns: dataDir, version, accounts, readOnly, +1 more

share_deckShare a deck publiclyA

Publish one of the signed-in user's decks to AnkiWeb's public shared-deck catalogue, under their account. Anyone can then find and download it.

Without confirm, nothing is published: the call checks the deck and the listing against AnkiWeb's limits and returns a preview. Show that preview to the user and get their explicit go-ahead before calling again with confirm: true.

Calling with confirm: true publishes the deck and makes AnkiWeb's declaration on the user's behalf: "I declare that the material I am sharing is entirely my own work, or I have obtained a license from the intellectual property holder(s) to share it here."

With more than one AnkiWeb account stored, the preview names the one it publishes from, and the confirmed call must name it in account.

A deck that is already shared is refused. Needs an AnkiWeb session.

Inputs: deck (required), tags, title, account, +3 more. Returns: url, deck, tags, title, +8 more

unshare_deckRemove a shared listingA
DestructiveIdempotent

Remove one of the signed-in user's listings from AnkiWeb's public shared-deck catalogue, with its ratings and reviews. It cannot be undone. The deck in the user's collection is not touched.

Without confirm, nothing is removed: the call finds the listing and returns a preview. Show that preview to the user and get their explicit go-ahead before calling again with confirm: true.

With more than one AnkiWeb account stored, the preview names the one the listing belongs to, and the confirmed call must name it in account.

Needs an AnkiWeb session.

Inputs: listing (required), account, confirm. Returns: status, account, listing

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool has a clear, distinct role: search/get/download shared decks are separate stages, list_my_decks and list_my_shared_decks are clearly differentiated, and share/unshare/delete are distinct account actions. Status, session cleanup, and local conversion do not overlap with the AnkiWeb catalogue tools.

    Naming Consistency4/5

    Names use consistent snake_case and mostly follow verb_noun patterns such as search_shared_decks, download_shared_deck, and delete_deck. The main exception is server_status, which is a noun phrase rather than an action verb.

    Tool Count5/5

    The set has 11 tools, which is well within a reasonable range and each tool corresponds to a meaningful AnkiWeb or deck-conversion operation. There is no obvious padding or missing category that would justify a different count.

    Completeness4/5

    The surface covers the shared-deck lifecycle well: search, inspect, download, share, unshare, and delete, plus account deck listings and local conversion. Minor gaps remain around account/session setup or deck update/import operations, but core workflows are covered.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers