The anki-mcp server provides an interface to interact with Anki flashcards via the AnkiConnect add-on, exposing these actions as MCP tools organized into logical services:
- Deck Management: Create, delete, rename decks, retrieve deck information, move cards between decks, and manage deck configuration
- Note Management: Add, update, delete notes, manage tags, find notes by search query, and batch operations
- Card Management: Retrieve card information, suspend/unsuspend cards, check modification times, and modify card properties
- Model Management: Create and update note types (models), manage fields, templates, and styling
- Media Management: Store, retrieve, and delete media files in Anki's collection
Provides tools for interacting with Anki flashcards via the AnkiConnect add-on, enabling management of decks, notes, cards, models (note types), and media files within the Anki application.
anki-mcp
A Model Context Protocol (MCP) server for interacting with Anki flashcards via the AnkiConnect add-on. This server exposes AnkiConnect actions as MCP tools, organized into logical services.
Prerequisites
- Anki desktop application
- AnkiConnect add-on installed and configured in Anki
- Python 3.8+
uv
(for running and installing dependencies, optional but recommended)
Installation
Usage
To run the MCP server:
The server will start and listen for MCP requests, typically interfacing with AnkiConnect at http://127.0.0.1:8765
.
Inspecting the Server
You can use the MCP Inspector to view the available tools:
Configuration for MCP Clients
If you're integrating this with an MCP client (like an AI assistant framework), you'll need to configure it to find this server. Here's an example configuration snippet:
Available MCP Tools
This MCP server provides access to Anki functionality through tools grouped by services. The tool names correspond directly to AnkiConnect actions.
Deck Service (deck.*
)
deck.deckNamesAndIds
: Gets the complete list of deck names and their respective IDs.deck.getDeckConfig
: Gets the configuration group object for a given deck name.deck.deckNames
: Gets the complete list of deck names for the current user.deck.createDeck
: Creates a new empty deck.deck.deleteDecks
: Deletes specified decks.deck.changeDeck
: Moves cards to a different deck.deck.saveDeckConfig
: Saves a deck configuration group.
Note Service (note.*
)
note.findNotes
: Returns note IDs for a given Anki search query.note.notesInfo
: Returns information for specified note IDs.note.getNoteTags
: Gets the tags for a specific note ID.note.addNote
: Creates a new note.note.updateNoteFields
: Modifies the fields of an existing note.note.deleteNotes
: Deletes specified notes.note.addNotes
: Creates multiple notes.note.addTags
: Adds tags to specified notes.note.removeTags
: Removes tags from specified notes.note.updateNote
: Modifies the fields and/or tags of an existing note.
Card Service (card.*
)
card.findCards
: Returns card IDs for a given Anki search query.card.cardsInfo
: Returns information for specified card IDs.card.cardsToNotes
: Returns note IDs for given card IDs.card.areSuspended
: Checks if specified cards are suspended.card.cardsModTime
: Returns modification time for specified card IDs.card.suspended
: Checks if a single card is suspended.card.suspend
: Suspends specified cards.card.unsuspend
: Unsuspends specified cards.card.setSpecificValueOfCard
: Sets specific values of a single card (use with caution).
Model Service (model.*
) (Note Types)
model.modelNamesAndIds
: Gets the complete list of model (note type) names and their IDs.model.findModelsByName
: Gets model definitions for provided model names.model.modelFieldNames
: Gets field names for a given model name.model.modelTemplates
: Gets template content for each card of a specified model.model.modelStyling
: Gets CSS styling for a given model name.model.createModel
: Creates a new model (note type).model.updateModelTemplates
: Modifies templates of an existing model.model.updateModelStyling
: Modifies CSS styling of an existing model.model.modelFieldAdd
: Adds a new field to an existing model.model.modelFieldRemove
: Removes a field from an existing model.
Media Service (media.*
)
media.retrieveMediaFile
: Retrieves the base64-encoded contents of a media file.media.getMediaFilesNames
: Gets names of media files matching a glob pattern.media.storeMediaFile
: Stores a media file (from base64, path, or URL).media.deleteMediaFile
: Deletes a specified media file.
Development
To set up for development:
Running Tests
Todo
- Finish adding all AnkiConnect tools
You must be authenticated.
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
A Model Context Protocol server that enables interaction with Anki flashcards through AnkiConnect, providing organized tools for managing decks, notes, cards, models, and media files.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA server implementation that connects to a locally running Anki, enabling card review and creation through the Model Context Protocol.Last updated -440JavaScriptMIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that enables LLMs to interact with Anki flashcard software through AnkiConnect, allowing for creation and management of flashcards, decks, and note types.Last updated -1020630TypeScript
Rember MCPofficial
-securityAlicense-qualityA Model Context Protocol server that allows Claude to create flashcards for Rember, helping users study and remember information through spaced repetition reviews.Last updated -8816TypeScriptMIT License- -securityAlicense-qualityA Model Context Protocol server that allows LLMs to interact with Anki flashcard software, enabling functions like creating decks, adding notes, searching cards, and managing flashcard content through natural language.Last updated -2061JavaScriptMIT License