anki-connect-mcp is an MCP server that acts as a bridge between MCP clients (such as Claude Desktop) and the AnkiConnect plugin, enabling AI assistants to manage Anki flashcards through conversation.
Purpose: to let AI assistants create, modify, query, and delete Anki flashcards, decks, tags, and media files using natural language.
Main capabilities:
- Notes: add_note, add_notes, can_add_notes, update_note_fields, add_tags, remove_tags, find_notes, notes_info.
- Cards: find_cards, cards_info, cards_to_notes, suspend, unsuspend, are_suspended, are_due, get_intervals.
- Decks: deck_names, deck_names_and_ids, get_decks, change_deck, delete_decks, get_deck_config.
- Models: model_names, model_names_and_ids, model_field_names, model_fields_on_templates.
- Miscellaneous: version, get_tags.
- Media: store_media_file, get_media_files_names, retrieve_media_file, delete_media_file, get_media_dir_path.
Each tool has a description, title, and MCP annotations (readOnlyHint / destructiveHint); clients can automatically approve read-only tools and ask before destructive operations. On connection, the server sends instructions to the agent, including Anki search syntax, the difference between note IDs and card IDs, and the recommended workflow for adding cards. Errors are returned as tool errors (isError: true), for example when AnkiConnect rejects a request, cannot connect to AnkiConnect, or a parameter is invalid.
Usage:
- Install the AnkiConnect plugin in Anki (code 2055492159), and restart Anki.
- Optionally configure AnkiConnect (default port 8765).
- Clone the repository, install dependencies, and build the project.
- Add the server configuration to the MCP client configuration file (Node.js, npx, or Docker methods are supported).
- Make sure Anki is running and AnkiConnect is enabled.
Use cases: creating flashcards via natural language with an AI assistant, querying decks and tags, suspending cards in bulk, managing media files, and more.
Limitations: requires Node.js 20 or later; requires Anki to be running with AnkiConnect installed; the Docker method requires additional configuration of AnkiConnect's webBindAddress and webCorsOriginList; the clipboard image feature is Linux-only (wl-clipboard for Wayland, xclip for X11); retrieve_media_file only supports PNG, JPEG, GIF, and WebP images up to 5 MB; GUI tools are only available when ANKI_MCP_ENABLE_GUI=1 is set.