SuperAPI AI Directory

anki-mcp-desktop

Anki integration for managing notes and decks through natural language.

Open website

About this tool

Anki MCP Server is a Model Context Protocol (MCP) server used to let AI assistants interact with the spaced-repetition flashcard application Anki. It is officially described as an experience similar to a "personal tutor": the AI assistant can not only present questions and answers, but also explain concepts, provide context, adapt to learning styles, and create and edit notes on the fly during the learning process.

Purpose

The main purpose of this project is to connect Anki's learning workflow to an AI assistant, so that users can manage decks and notes and conduct reviews using natural language. The representative use cases officially provided include: asking the assistant to help review a Spanish deck (sync AnkiWeb, get due cards, present them one by one, record ratings); create 10 Arabic vocabulary cards with RTL styling (list note types, create a custom RTL model, batch-create cards); import a local image into the front of the selected note (upload the local file, read the currently selected note, update the field to an <img> tag).

Main capabilities (available tools)

The server exposes 53 MCP tools, divided into 42 everyday core tools and 11 GUI tools that drive the Anki desktop interface.

The core tools cover:

  • Sync and review: sync (sync with AnkiWeb), get_due_cards (get due cards, filterable by deck), get_cards (flexibly filter cards by status and deck), present_card (present the front of a card), rate_card (rate as Again/Hard/Good/Easy and schedule the next review), forgetCards (reset cards to new), setDueDate (reschedule the due date), areSuspended / suspend / unsuspend (query and adjust suspended status).
  • Deck management: listDecks (list decks and study queue statistics), deckStats (detailed statistics for a single deck), createDeck (create a deck, supporting Parent::Child up to two levels), changeDeck (move cards to another deck).
  • Note management: addNote (create a single note), addNotes (batch-create up to 100 notes), findNotes (search using Anki query syntax), notesInfo (get detailed noteinformation), updateNoteFields (update note fields, supporting HTML), deleteNotes (delete notes and their cards; destructive operations require confirmation).
  • Tag management: getTags, addTags, removeTags, replaceTags, clearUnusedTags.
  • Media files: getMediaFilesNames, retrieveMediaFile, storeMediaFile (supports base64, absolute file paths, or URLs), deleteMediaFile. Officially, it is recommended to prefer file paths or URLs for images and avoid base64 (extremely slow and token-consuming).
  • Note types and templates: modelNames, modelFieldNames, modelStyling, modelTemplates, createModel, updateModelStyling, updateModelTemplates, addModelField, removeModelField, renameModelField, repositionModelField.
  • Statistics: collection_stats (aggregate statistics across decks), review_stats (review history analysis, including time patterns, retention rate, and study streaks).

The GUI tools are used to drive the Anki desktop interface and are aimed at note editing/creation and deck management workflows, rather than review sessions, including: guiBrowse, guiSelectCard, guiSelectedNotes, guiAddCards, guiEditNote, guiDeckOverview, guiDeckBrowser, guiCurrentCard, guiShowQuestion, guiShowAnswer, guiUndo.

How to use

Prerequisites: Anki is installed and the AnkiConnect add-on is installed; Node.js 22.12.0+.

Installation methods:

  1. npm: can be installed globally for clients running the ankimcp command, or run on demand via npx without installation.
  2. MCPB Bundle (officially recommended for Claude Desktop): from ReleaDownload the latest .mcpb package from the ses page, install it in Claude Desktop by drag-and-drop via "Settings → Extensions", or select the file via "Settings → Developer → Extensions → Install Extension"; if necessary, configure the AnkiConnect URL (default http://localhost:8765);重启 Claude Desktop.
  3. Install from source (for development): Running the test suite requires Node.js 24.9+, while the runtime requirement remains 22.12.0+.

Connect an AI client:

  • Local: The server and the AI client are on the same machine. Desktop MCP clients (Claude Desktop, Cursor, Cline, Zed, opencode, etc.) use STDIO transport; local web tools use HTTP. For Claude Desktop, the MCPB package is recommended; for other clients, use the npm package configured with the --stdio flag. Configuration locations include: ~/.cursor/mcp.json for Cursor IDE (%USERPROFILE%.cursor\mcp.json on Windows); Cline via the VS Code settings interface; Zed via the extension marketplace; opencode using opencode.json in the project root or the global ~/.config/opencode/opencode.json.
  • Remote: Cloud-hosted AI (such as ChatGPT or Claude.ai) cannot directly access localhost. The official recommendation is to use a hosted tunnel (login via the OAuth 2.0 device flow is required; the endpoint is not open to the public), or use ngrok as a lighter-weight unauthenticated alternative.

HTTP mode runs as a local web server, using the MCP Streamable HTTP protocol, and by default binds only to localhost. If you use --host 0.0.0.0 or a reverse proxy, for DNS rebinding protection the server by default only accepts loopback Host headers, and you need to set ALLOWED_HOSTS to the hostname used by the client.

Additional Notes

The official guidance is that for most configurations, the AnkiMCP add-on (install code 124672614) is more recommended; it runs the MCP server directly inside Anki, with no need to install Node.js, no need to configure AnkiConnect, and no need to keep a separate process running; this repository is more suitable only when STDIO transport, one-click MCPB installation, or a web client is needed. This repository and the add-on both belong to the ankimcp.ai project and will continue to be maintained and released. More complete documentation, examplesand step-by-step tutorials can be found at ankimcp.ai and in the repository's docs/ directory.