anki-mcp

mybuddymichael/anki-mcp

3.2

If you are the rightful owner of anki-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

Anki-MCP is a Model Context Protocol server that allows seamless interaction between LLMs and Anki flashcard collections, enabling tasks like deck management, note searching, and field updating.

Tools
5
Resources
0
Prompts
0

anki-mcp

A Model Context Protocol (MCP) server that enables LLMs to interact with your Anki flashcard collection. Read decks, search notes, view card contents, and update fields directly from your LLM tool of choice.

Features

  • Deck Management: List all available Anki decks
  • Note Search: Search notes using Anki's powerful search syntax
  • Note Viewing: View note contents and field values
  • Note Editing: Update note fields programmatically

Setup

Prerequisites

  1. Anki - Desktop application must be installed and running
  2. AnkiConnect - Add-on for API access (code: 2055492159)
  3. Bun 1.2.16 or later

Installation

# Install AnkiConnect in Anki
# Go to Tools → Add-ons → Get Add-ons... → Enter: 2055492159

# Clone and setup this project
git clone git@github.com:mybuddymichael/anki-mcp.git
cd anki-mcp
bun install

Usage

With Claude Desktop

Add to your Claude Desktop configuration file:

{
  "mcpServers": {
    "anki": {
      "command": "bun",
      "args": ["run", "/path/to/anki-mcp/index.ts"]
    }
  }
}

With Other MCP Clients

This server works with any MCP-compatible client. Look up the respective documentation for how to configure it.

Available tools

ToolDescriptionParameters
get-decksLists all available Anki decksNone
search-notesSearch notes using Anki syntaxquery (string)
get-note-fieldsGet note field contentsnoteIds (number[])
get-model-namesList note types/modelsNone
get-model-field-namesGet field names for a modelmodelName (string)
update-note-fieldsUpdate note field contentsnoteId (number), fields (object)
add-notesAdd new notes to decksnotes (array)
list-media-filesList all media filesNone
check-media-existsCheck if media file existsfilename (string)
store-mediaStore media file to Anki media collectionfilePath (string)

Usage examples

Adding new cards

"Add a card with 'bonjour' on the front and 'hello' on the back to my French deck"

"Create a flashcard for the Spanish word 'biblioteca' meaning 'library' with the tag 'places'"

"Add these vocabulary words to my German deck: Haus (house), Auto (car), Buch (book)"

Finding cards

"Search for all cards in my Biology deck, then show me their contents"

First: Search returns note IDs → Second: Get field contents for those IDs

"Find my Spanish vocabulary cards tagged with 'food', then show me what they contain"

Updating cards

"Update the back of card #1234567890 to include pronunciation: 'biblioteca [bee-blee-oh-TEH-kah]'"

"Fix the typo on the front of that card - change 'recieve' to 'receive'"

Deck info

"What decks do I have available?"

"What note types exist in my Anki collection?"

"Show me the field names for my Cloze note type"

Related Links

License

MIT