Anki

the best anki mcp
  • python

6

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ujisati-anki-mcp": {
      "command": "uv",
      "args": [
        "run",
        "anki-mcp"
      ]
    }
  }
}

You run an MCP server that exposes AnkiConnect actions as MCP tools, allowing you to manage decks, notes, cards, models, and media from MCP-enabled clients. This server integrates with the AnkiConnect add-on and routes requests through a single, consistent MCP interface.

How to use

Start the MCP server from your development environment and connect your MCP client to it to perform actions like listing decks, creating notes, or updating templates. The server typically interfaces with AnkiConnect at http://127.0.0.1:8765 and exposes a set of tool endpoints organized by services such as deck, note, card, model, and media.

How to install

Prerequisites include the Anki desktop application with the AnkiConnect add-on installed and configured, Python 3.8+ and uv for running the server.

Configuration and usage notes

To run the MCP server locally, use the following command from your project root or wherever the server is located:

Additional setup and example configuration

# Clone the project
git clone https://github.com/ujisati/anki-mcp.git
cd anki-mcp

# Install dependencies (using uv)
uv pip install -e .

# Run the MCP server
uv run anki-mcp

The server will start listening for MCP requests. You can inspect available tools with the inspector command:

npx @modelcontextprotocol/inspector uv run anki-mcp

To configure an MCP client to connect to this server, you can specify the server entry like this snippet:

{
  "mcpServers": {
    "anki": {
      "command": "uv",
      "args": [
        "run", // uv will find anki-mcp if run from project root
        "anki-mcp"
      ],
      // If running from outside the project directory, specify the path:
      // "args": [
      //     "--directory",
      //     "/ABSOLUTE/PATH/TO/anki-mcp", // Replace with actual path
      //     "run",
      //     "anki-mcp"
      // ]
    }
  }
}

This configuration example shows how to expose the local MCP server to a client using uvx as the runtime launcher.

## Security and best practices

Ensure AnkiConnect is accessible only from trusted hosts, especially when running MCP clients that issue edits to cards, notes, or decks. Use network access controls and, if possible, run the MCP server in a controlled environment or behind a proxy that enforces authentication and authorization.

## Troubleshooting

If the MCP server fails to start, verify that Anki and AnkiConnect are running, that Python 3.8+ is installed, and that uv is available. Check that the server URL used by an MCP client matches the AnkiConnect endpoint (default http://127.0.0.1:8765). Review logs emitted by the uv run command for any dependency or runtime errors.

## Available tools

### deck.deckNamesAndIds

Retrieves all deck names with their associated IDs from Anki.

### deck.getDeckConfig

Fetches the configuration group for a specific deck name.

### deck.deckNames

Returns the complete list of deck names for the current user.

### deck.createDeck

Creates a new empty deck with the given name.

### deck.deleteDecks

Deletes the specified decks from the collection.

### deck.changeDeck

Moves cards from one deck to another.

### deck.saveDeckConfig

Saves a deck configuration group to storage.

### note.findNotes

Returns note IDs that match a given Anki search query.

### note.notesInfo

Fetches information for the specified note IDs.

### note.getNoteTags

Retrieves tags associated with a specific note ID.

### note.addNote

Creates a new note with the provided fields and model.

### note.updateNoteFields

Updates the fields of an existing note.

### note.deleteNotes

Deletes the specified notes from the collection.

### note.addNotes

Creates multiple notes in a single operation.

### note.addTags

Adds tags to the specified notes.

### note.removeTags

Removes tags from the specified notes.

### note.updateNote

Modifies fields and/or tags of an existing note.

### card.findCards

Finds cards that match the given search query and returns their IDs.

### card.cardsInfo

Fetches information for the specified card IDs.

### card.cardsToNotes

Returns the note IDs corresponding to the given card IDs.

### card.areSuspended

Checks whether the specified cards are suspended.

### card.cardsModTime

Retrieves the modification time for the specified cards.

### card.suspended

Checks if a single card is suspended.

### card.suspend

Suspends the specified cards.

### card.unsuspend

Unsuspends the specified cards.

### card.setSpecificValueOfCard

Sets a specific value on a single card (use with caution).

### model.modelNamesAndIds

Gets all model (note type) names and their IDs.

### model.findModelsByName

Fetches model definitions for the provided model names.

### model.modelFieldNames

Retrieves the field names for a given model.

### model.modelTemplates

Gets template content for each card of a specified model.

### model.modelStyling

Fetches CSS styling for a given model.

### model.createModel

Creates a new model (note type) in Anki.

### model.updateModelTemplates

Updates templates for an existing model.

### model.updateModelStyling

Updates CSS styling for an existing model.

### model.modelFieldAdd

Adds a new field to an existing model.

### model.modelFieldRemove

Removes a field from an existing model.

### 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.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational