Logo von Anki Connect MCP 服务器

Anki Connect MCP 服务器

Community
spacholski1225

A custom Model Context Protocol (MCP) implementation for Anki Web, enabling structured model interactions and improved context-aware note creation.

Herausgeberspacholski1225
Repositoryanki-connect-mcp
SpracheTypeScript
Forks
1
Sterne
24
Verfügbare Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Links
  • Tools mit KI-Workflows verbinden

    Anki Connect MCP 服务器 stellt MCP-Funktionen bereit, die kompatible KI-Clients und Agenten nutzen können.

  • Verfügbare Tools: 0

    Unten finden Sie die aufrufbaren Aktionen. Namen und Beschreibungen werden angezeigt, sofern der Server sie bereitstellt.

  • Konfiguration zum Kopieren

    Nutzen Sie die Installationsbeispiele, um diesen Server in Ihrem bevorzugten MCP-Client zu konfigurieren.

  • Open-Source-Kennzahlen

    Kennzahlen des verlinkten Repositorys: Sterne (24) und Forks (1).

Anki Connect MCP Server

A Model Context Protocol (MCP) server that provides seamless integration with Anki through the AnkiConnect add-on. This server enables AI assistants and other MCP clients to interact with your Anki flashcard collection programmatically.

Project

What is Anki Connect?

AnkiConnect is a powerful Anki add-on that exposes Anki's functionality through a REST API. It allows external applications to:

  • Create, modify, and delete flashcards
  • Manage decks and their configurations
  • Control Anki's GUI programmatically
  • Search and retrieve card information
  • Manage tags and note types
  • Perform bulk operations on cards and notes

What is MCP (Model Context Protocol)?

The Model Context Protocol is a standardized way for AI assistants to connect to external data sources and tools. This MCP server acts as a bridge between MCP clients (like Claude Desktop) and AnkiConnect, allowing AI assistants to help you manage your Anki flashcards naturally through conversation.

Features

This MCP server provides comprehensive access to AnkiConnect functionality through the following tools:

Flashcard Management

  • create_flashcard() - Create new flashcards with front and back content
  • add_note() - Add notes with custom fields and tags
  • add_notes() - Bulk add multiple notes
  • update_note_fields() - Update existing note fields
  • find_notes() - Search for notes using Anki's query syntax

Deck Management

  • deck_names() - Get all deck names
  • deck_names_and_ids() - Get deck names with their IDs
  • change_deck() - Move cards between decks
  • delete_decks() - Delete decks and optionally their cards
  • get_deck_config() - Retrieve deck configuration settings

Card Operations

  • find_cards() - Search for cards
  • cards_info() - Get detailed card information
  • suspend() / unsuspend() - Suspend/unsuspend cards
  • are_suspended() / are_due() - Check card status

GUI Control

  • gui_deck_browser() - Open deck browser
  • gui_deck_review() - Start deck review
  • gui_browse() - Open card browser with search
  • gui_add_cards() - Open add cards dialog

Utility Tools

  • version() - Get AnkiConnect version
  • get_tags() - Retrieve all tags
  • multi() - Execute multiple AnkiConnect requests in batch

Prerequisites

1. Install AnkiConnect Add-on

  1. Open Anki
  2. Go to Tools → Add-ons
  3. Click Get Add-ons...
  4. Enter the code: 2055492159
  5. Click OK and restart Anki

2. Configure AnkiConnect (Optional)

AnkiConnect works out of the box, but you can customize its settings:

  1. Go to Tools → Add-ons
  2. Select AnkiConnect and click Config
  3. Modify settings if needed (default port is 8765)
  4. Restart Anki after making changes

Installation

  1. Clone this repository:
bash
git clone https://github.com/spacholski1225/anki-connect-mcp.git
cd anki-connect-mcp
  1. Install dependencies:
bash
npm install
  1. Build the project:
bash
npm run build

MCP Client Configuration

Claude Desktop

To use this MCP server with Claude Desktop, add the following configuration to your MCP settings file:

Location of MCP configuration file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Configuration Options:

Option 1: Using Node.js (Local Installation)

json
{
  "mcpServers": {
    "anki-connect-mcp": {
      "command": "node",
      "args": [
        "dist/index.js"
      ],
      "env": {},
      "disabled": false,
      "alwaysAllow": [
        "deck_names",
        "cards_info",
        "deck_names_and_ids",
        "gui_deck_browser"
      ]
    }
  }
}

Option 2: Using npx (NPM Package)

Then configure your MCP client:

json
{
  "mcpServers": {
    "anki-connect": {
      "command": "npx",
      "args": [
        "@spacholski1225/anki-connect-mcp"
      ],
      "env": {},
      "disabled": false,
      "alwaysAllow": [
        "deck_names",
        "cards_info",
        "deck_names_and_ids",
        "gui_deck_browser"
      ]
    }
  }
}

Option 3: Using Docker

json
{
  "mcpServers": {
    "anki-connect": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "--network=host",
        "-e", "ANKI_CONNECT_URL=http://host.docker.internal:8765",
        "spacholski/anki-connect-mcp:latest"
      ],
      "env": {},
      "disabled": false,
      "alwaysAllow": [
        "deck_names",
        "cards_info",
        "deck_names_and_ids",
        "gui_deck_browser"
      ]
    }
  }
}

Docker-Specific AnkiConnect Configuration:

When using the Docker option, you must configure AnkiConnect with specific settings to allow Docker container access:

  1. Go to Tools → Add-ons in Anki
  2. Select AnkiConnect and click Config
  3. Update the configuration with the following settings:
json
{
    "apiKey": null,
    "apiLogPath": null,
    "ignoreOriginList": [],
    "webBindAddress": "0.0.0.0",
    "webBindPort": 8765,
    "webCorsOriginList": [
        "http://localhost",
        "http://host.docker.internal",
        "http://host.docker.internal:3000"
    ]
}

Key Docker Configuration Points:

  • webBindAddress: "0.0.0.0" - Allows AnkiConnect to accept connections from any IP address (required for Docker containers)
  • webCorsOriginList - Must include "http://host.docker.internal" and related origins to allow cross-origin requests from Docker containers
  • Restart Anki after making these configuration changes

Important Notes:

  • For Node.js option: Replace the path in args with the actual path to your built index.js file
  • For npx option: Uses the published NPM package @spacholski1225/anki-connect-mcp - no local installation required
  • For Docker option: Uses the pre-built Docker image spacholski/anki-connect-mcp:latest
  • The alwaysAllow array contains tools that won't require confirmation each time
  • Make sure Anki is running with AnkiConnect enabled before using the MCP server
  • For Docker option, the --network=host flag allows the container to access AnkiConnect on the host machine

Usage Examples

Once configured with an MCP client like Claude Desktop, you can interact with your Anki collection naturally:

  • "Create a flashcard about the capital of France"
  • "Show me all my deck names"
  • "Find all cards tagged with 'vocabulary'"
  • "Suspend all cards in the 'Difficult Words' deck"
  • "Open the deck browser in Anki"

Troubleshooting

Common Issues

  1. Connection refused: Make sure Anki is running and AnkiConnect is installed
  2. Port conflicts: Check if port 8765 is available or configure AnkiConnect to use a different port
  3. Permission errors: Ensure the MCP server has proper file system permissions
  4. Tool not found: Verify the MCP client configuration and restart the client

Contributing

Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.

License

ISC License

References

Installation

TypingMind
Voraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "spacholski1225-anki-connect-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@spacholski1225/anki-connect-mcp"
      ]
    }
  }
}

Anki Connect MCP 服务器 MCP mit mehreren KI-Modellen nutzen

TypingMind bindet MCP-Tools auf Arbeitsbereichsebene ein. Sobald Anki Connect MCP 服务器 verbunden ist, können Sie die Integration mit verschiedenen KI-Modellen in TypingMind verwenden, statt sie für jedes Modell separat einzurichten. Diese MCP-Integration läuft lokal über den TypingMind-MCP-Konnektor auf Ihrem Gerät.

Einrichtungsanleitung für den lokalen Konnektor

Nutzen Sie diese Option, wenn der MCP-Server Zugriff auf lokale Dateien, Apps oder private Ressourcen auf Ihrem Computer benötigt.

1

MCP-Einstellungen öffnen

Gehen Sie in TypingMind zu „Einstellungen“, „Erweiterte Einstellungen“ und dann „Model Context Protocol“ und wählen Sie „Konnektor einrichten“.

  1. Öffnen Sie TypingMind in Ihrem Browser.
  2. Klicken Sie auf das Symbol „Einstellungen“.
  3. Gehen Sie zu „Erweiterte Einstellungen“.
  4. Öffnen Sie den Abschnitt „Model Context Protocol“.
  5. Klicken Sie auf „Konnektor einrichten“ und wählen Sie „Dieses Gerät“.
Einrichtungsbildschirm des TypingMind-MCP-Konnektors mit ausgewählter Option „Dieses Gerät“
2

Konnektor-Befehl ausführen

Wählen Sie „Dieses Gerät“, kopieren Sie den Befehl aus TypingMind und führen Sie ihn im Terminal aus. Lassen Sie den Prozess laufen, solange Sie MCP verwenden.

  1. Kopieren Sie den in TypingMind angezeigten Einrichtungsbefehl.
  2. Öffnen Sie „Terminal“ (macOS) bzw. „Windows Terminal“ (Windows).
  3. Fügen Sie den Befehl ein und führen Sie ihn aus.
  4. Bestätigen Sie die Paketinstallation, wenn Sie im Terminal zum Fortfahren aufgefordert werden.
  5. Lassen Sie das Terminalfenster geöffnet und den Prozess darin laufen, solange Sie MCP-Tools verwenden.
3

Anki Connect MCP 服务器 als Server hinzufügen

Wenn der Konnektorstatus „Bereit“ anzeigt, klicken Sie auf „Server bearbeiten“ und fügen Sie die MCP-Server-Konfiguration ein.

  1. Warten Sie, bis der Konnektorstatus „Bereit“ anzeigt.
  2. Klicken Sie auf „Server bearbeiten“.
  3. Fügen Sie die MCP-Server-Konfiguration für Anki Connect MCP 服务器 ein.
  4. Speichern Sie die Serverliste.
  5. Aktualisieren Sie die Ansicht, um bei Bedarf zu prüfen, ob der Konnektor weiterhin bereit ist.
MCP-Einstellungen in TypingMind mit aktivem Server und der Schaltfläche „Server bearbeiten“
{
  "mcpServers": {
    "spacholski1225-anki-connect-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@spacholski1225/anki-connect-mcp"
      ]
    }
  }
}
4

Verbindung modellübergreifend nutzen

Speichern Sie die Serverliste, öffnen Sie „Plugins“ und aktivieren Sie die MCP-Tools von Anki Connect MCP 服务器. Wählen Sie dann ein beliebiges unterstütztes KI-Modell in TypingMind und verwenden Sie die Tools im Chat oder weisen Sie sie einem KI-Agenten zu.

  1. Öffnen Sie die Seite „Plugins“ in TypingMind.
  2. Aktivieren Sie die MCP-Tools von Anki Connect MCP 服务器.
  3. Starten Sie einen Chat und wählen Sie das KI-Modell, das Sie verwenden möchten.
  4. Nutzen Sie die MCP-Tools im Chat oder weisen Sie sie einem KI-Agenten zu.
  5. Wechseln Sie bei Bedarf zu einem anderen KI-Modell, ohne die MCP-Verbindung erneut herzustellen.
TypingMind-Chat mit aktivierten MCP-Tools und einem ausgewählten KI-Modell
Können Sie mir mit Anki Connect MCP 服务器 bei dieser Aufgabe helfen?
Anki Connect MCP 服务器
Gerne. Ich habe es gelesen.
Das habe ich mit Anki Connect MCP 服务器 gefunden.

Häufig gestellte Fragen

Wofür wird der MCP-Server Anki Connect MCP 服务器 verwendet?

Anki Connect MCP 服务器 ist ein MCP-Server, über den kompatible KI-Clients auf externe Tools und Kontext zugreifen können. In TypingMind können Sie diesen MCP-Server einmal hinzufügen und seine Tools in Ihrem KI-Arbeitsbereich verfügbar machen.

Kann ich den MCP-Server Anki Connect MCP 服务器 mit mehreren KI-Modellen in TypingMind verwenden?

Ja. TypingMind bindet MCP-Tools auf Arbeitsbereichsebene ein. So können Sie Anki Connect MCP 服务器 mit verschiedenen KI-Modellen wie Claude, ChatGPT, Gemini oder anderen in TypingMind konfigurierten Modellen verwenden, ohne den MCP-Server für jedes Modell separat einzurichten.

Warum den MCP-Server Anki Connect MCP 服务器 mit TypingMind nutzen?

TypingMind ist eine der besten Oberflächen für LLM-Chats, da es mehrere KI-Modelle, Prompts, Plugins, KI-Agenten, API-Schlüssel und MCP-Tools in einem Arbeitsbereich vereint. Sobald Anki Connect MCP 服务器 verbunden ist, können Sie die zugehörigen MCP-Tools mit Ihren bevorzugten Modellen nutzen und Ihre Chat-Abläufe in TypingMind übersichtlich organisieren.

Wie verbinde ich den MCP-Server Anki Connect MCP 服务器 mit TypingMind?

Anki Connect MCP 服务器 wird über den lokalen MCP-Konnektor von TypingMind angebunden. Das ist die beste Wahl, wenn der MCP-Server auf lokale Dateien, Desktop-Apps, Befehlszeilentools oder private Ressourcen auf Ihrem Computer zugreifen muss.

Welche Tools stellt der MCP-Server Anki Connect MCP 服务器 in TypingMind bereit?

Anki Connect MCP 服务器 stellt MCP-Funktionen bereit, die Sie auf der Plugins-Seite in TypingMind aktivieren und im Chat verwenden oder KI-Agenten zuweisen können.

Muss ich meine API-Schlüssel mit TypingMind teilen, um den MCP-Server Anki Connect MCP 服务器 zu verwenden?

Nein. TypingMind arbeitet vorrangig lokal. Sie wählen Ihre Modellanbieter selbst und behalten die Kontrolle über Ihre API-Schlüssel, Prompts und MCP-Konfiguration. Falls Anki Connect MCP 服务器 eine Authentifizierung erfordert, fügen Sie beim Erstellen der Verbindung die erforderlichen Header, OAuth-Einstellungen oder die lokale Konfiguration für diesen MCP-Server hinzu.

Ähnliche MCP-Server

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇