home / mcp / anki mcp elevenlabs server

Anki MCP ElevenLabs Server

FastMCP server for Anki with ElevenLabs TTS support, enabling deck management, audio generation, and bulk note operations.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "spencerf2-anki-mcp-elevenlabs": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/your/anki-mcp/",
        "run",
        "server.py"
      ],
      "env": {
        "GOOGLE_CLOUD_API_KEY": "YOUR_GOOGLE_CLOUD_API_KEY"
      }
    }
  }
}

You run an MCP server that connects Anki with ElevenLabs-powered text-to-speech and a suite of deck-management tools. It lets you create, read, update, and bulk-manage notes and media, with high-quality audio generation powered by Google Cloud TTS and seamless AnkiConnect integration for local decks.

How to use

To use this MCP server with your client, start the server and connect via the local MCP endpoint. You can list decks, inspect deck notes, generate audio, and bulk-create or update notes. Use the available tools to perform common tasks like extracting deck structures, adding audio, saving media to Anki, and searching for similar notes across your decks.

Practical workflows include: creating a new note in a deck, generating pronunciation audio for a card, bulk-adding multiple notes, and updating existing notes to attach audio while preserving other fields. When you generate audio, the system uses Google Cloud Text-to-Speech with a Chinese-optimized voice by default, and you can adjust language or voice as needed.

How to install

Prerequisites you need to have installed on your system before starting are Python, the uv utility, and Anki running with AnkiConnect enabled.

Step by step install and run flow:

# 1) Install the MCP runtime tooling
uv sync

# 2) Ensure Anki is running with AnkiConnect installed (Tools > Add-ons > Get Add-ons, then enter 2055492159 and restart Anki)

# 3) Set up API key for audio generation (optional, if using Google Cloud TTS)
export GOOGLE_CLOUD_API_KEY='your-google-cloud-api-key-here'

# 4) Start the MCP server
uv run server.py

Additional configuration and notes

Configuration includes wiring the server to use Google Cloud TTS for audio generation and enabling local AnkiConnect access. The server reads GOOGLE_CLOUD_API_KEY from your environment when generating audio.

Claude Desktop integration is supported. You configure Claude to launch the MCP server via a stdio process, passing the required directory and start commands, and you can supply the Google Cloud API key through the environment. The example below shows how Claude can be pointed at the MCP server.

{
  "mcpServers": {
    "anki_mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/your/anki-mcp/",
        "run",
        "server.py"
      ],
      "env": {
        "GOOGLE_CLOUD_API_KEY": "your-google-cloud-api-key-here"
      }
    }
  }
}

Available tools

list_decks

Lists all available Anki decks with their note counts.

get_deck_notes

Retrieves all notes from a specified deck with detailed field information.

get_deck_sample

Fetches a random sample of notes from a deck to inspect structure.

get_deck_note_types

Analyzes a deck to identify note types and their fields.

create_note

Creates a new note in a specified deck with given model and fields.

update_note

Updates specific fields of an existing note while preserving others.

create_deck_with_note_type

Creates a new deck and optionally a new note type with custom fields and templates.

list_note_types

Lists all available note types (models) with their fields and templates.

generate_audio

Generates base64-encoded MP3 audio from text using Google Cloud TTS.

save_media_file

Saves base64-encoded media data to Anki's media collection.

generate_and_save_audio

Generates audio from text and saves it directly to Anki's media collection.

create_notes_bulk

Creates multiple notes in a single batch with duplicate handling and detailed results.

update_notes_bulk

Updates multiple notes in a single batch with detailed results.

find_similar_notes

Finds notes containing any of the search terms, grouped by term, with local filtering.