UA

ujisati/anki-mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

7 stars 5 forks 품질 60 트렌드 15MIT

the best 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. - Anki desktop application - AnkiConnect add-on installed and configured in Anki - Python 3.8+ - uv (for running and installing dependencies, optional but recommended) The server will start and listen for MCP requests, typically interfacing with AnkiConnect at http://127.0.0.1:8765. You can use the MCP Inspector to view the available tools: 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: This MCP server provides access to Anki functionality through tools grouped by services. The tool names correspond directly to AnkiConnect actions. - : Gets the complete list of deck names and their respective IDs. - : Gets the configuration group object for a given deck name.

README

원문 README의 일부입니다. 원문 보기.

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

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

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

Usage

To run the MCP server:

uv run anki-mcp

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:

npx @modelcontextprotocol/inspector uv run anki-mcp

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:

{
    "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"
            // ]
        }
    }
}

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.*)

GitHub에서 전체 README 보기

설치

npx @modelcontextprotocol/inspector uv run anki-mcp
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "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" // ] } } }