背景图片

anki-mcp-server

Research And Data

Description

An MCP server for Claude Desktop that connects to Anki via AnkiConnect and retrieves leech-tagged cards for analysis.

Author

captain-blue210

Created Date

2024-12-01

Tutorial

Learn how to use this MCP server

Step 1: Prerequisites

  • Install Anki and ensure it is running.
  • Install the AnkiConnect add-on in Anki.
  • Install Node.js and npm.

Step 2: Installation

  1. Clone the repository:

git clone https://github.com/yourusername/anki-mcp-server.git cd anki-mcp-server

  1. Install dependencies:

npm install

  1. Build the project:

npm run build

Step 3: Configuration

  1. Copy the example configuration file:

cp .env.example .env

  1. Edit the .env file to customize settings like ANKI_CONNECT_URL and ANKI_CONNECT_VERSION.

Step 4: Running the Server

  1. Ensure Anki is running with AnkiConnect installed.
  2. Run the MCP server:

npm start

Step 5: Configuring Claude Desktop

  1. Open Claude Desktop.

  2. Edit the configuration file located at:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  3. Add the following configuration to the mcpServers section:

    { "mcpServers": { "anki": { "command": "node", "args": ["path/to/anki-mcp-server/dist/index.js"] } } }

    Replace "path/to/anki-mcp-server" with the actual path to the cloned repository.

Step 6: Using MCP Tools in Claude

You can now use tools like get_leech_cards and tag_reviewed_cards in Claude to analyze and manage your Anki cards.