Anki

MCP server for anki
  • javascript

39

GitHub Stars

javascript

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": {
    "nietus-anki-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "github:nietus/anki-mcp"
      ],
      "env": {
        "AZURE_API_KEY": "YOUR_AZURE_API_KEY",
        "ANKI_MEDIA_DIR": "path/to/your/anki/collection.media"
      }
    }
  }
}

You can interact with Anki through MCP to manage flashcards, decks, and review workflows programmatically. This MCP server exposes a set of tools you can call from MCP clients to create, update, and query cards and decks inside Anki, including optional audio generation and media handling.

How to use

You run the Anki MCP server locally or connect to it via an MCP client. The server exposes a comprehensive set of tools for creating and updating notes, generating audio, querying due items, and managing decks and models. Use a compatible MCP client to call these tools and integrate Anki workflows into your automation or desktop apps.

Key usage patterns include: creating new flashcards with rich HTML content, adding audio to cards via the Azure TTS integration, updating existing notes or fields in bulk for efficiency, and retrieving cards due for review or newly seen cards. You can also manage decks and note models, including adding or removing fields, updating templates and styling, and creating new models when your card structure changes.

How to install

# Prerequisites
node -v
npm -v
# Ensure AnkiConnect is installed and running inside Anki

# Option 1: Run the MCP server locally via npx (no clone required)
# This starts a stdio MCP server that you can connect to from MCP clients
npx -y github:nietus/anki-mcp

# Option 2: Run locally from source (clone and start)
# Follow these steps to run from source

Additional setup and configuration

Audio features require an Azure Speech API key and access to your Anki media directory. Place these in a .env file in the project root as AZURE_API_KEY and ANKI_MEDIA_DIR. The ANKI_MEDIA_DIR should point to your Anki collection.media folder so generated audio files are stored where Anki can find them.

If you are running locally from source, you will need to install dependencies, build the project, and optionally package the server for specific clients. The key steps are below.

  • Install dependencies
  • Build the project
  • Provide environment values for audio features (AZURE_API_KEY and ANKI_MEDIA_DIR)

Commands to run locally from source

npm install
npm run build

After building, start the server as per your MCP client configuration


## Available tools

### update\_cards

Mark cards as answered and update their ease after a quiz session. Input is an array of { cardId, ease } items.

### add\_card

Create a NEW flashcard with HTML-formatted fields for a given model and deck. Use for new cards only.

### add\_card\_with\_audio

Create a NEW flashcard with auto-generated audio from Azure TTS. Specify the text field to source audio from and the field to store the audio.

### update\_card\_with\_audio

Update an EXISTING card by generating audio for a source field and storing it in an audio field. Requires the noteId.

### get\_due\_cards

Return a number of cards currently due for review.

### get\_new\_cards

Return a number of new, unseen cards.

### get\_deck\_names

 Retrieve the list of all Anki deck names.

### find\_cards

Find cards using a raw Anki search query and return detailed card information.

### update\_note\_fields

Update specific fields of an existing Anki note by noteId.

### create\_deck

Create a new Anki deck by name.

### bulk\_update\_notes

Update fields for multiple existing notes in a single operation for efficiency.

### get\_model\_names

List all available Anki note types (models).

### get\_model\_details

Retrieve fields, templates, and CSS for a specified model.

### get\_deck\_model\_info

Get information about the models used within a specific deck.

### add\_note\_type\_field

Add a new field to a note type.

### remove\_note\_type\_field

Remove an existing field from a note type.

### rename\_note\_type\_field

Rename a field in a note type.

### reposition\_note\_type\_field

Change the order/index of a field within a note type.

### update\_note\_type\_templates

Update HTML templates for a note type’s cards.

### update\_note\_type\_styling

Update the CSS styling for a note type.

### create\_model

Create a new Anki note type (model) with fields, templates, and optional CSS.

### add\_bulk

Add multiple NEW flashcards in a single operation with HTML content.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational