Anki MCP Server

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Enables interaction with Anki flashcard software through AnkiConnect, providing tools for managing decks, creating various types of flashcards (Basic and Cloze), searching notes, and manipulating note types.

Anki MCP サーバー

LLM が AnkiConnect を介して Anki フラッシュカード ソフトウェアと対話できるようにするモデル コンテキスト プロトコル (MCP) サーバー。

特徴

ツール

  • list_decks - 利用可能なすべての Anki デッキを一覧表示します
  • create_deck - 新しい Anki デッキを作成する
  • create_note - 新しいノートを作成する(Basic または Cloze)
  • batch_create_notes - 一度に複数のノートを作成する
  • search_notes - Ankiクエリ構文を使用してノートを検索する
  • get_note_info - ノートの詳細情報を取得する
  • update_note - 既存のメモを更新する
  • delete_note - メモを削除する
  • list_note_types - 利用可能なすべてのノートタイプを一覧表示する
  • create_note_type - 新しいノートタイプを作成する
  • get_note_type_info - ノートタイプの詳細な構造を取得する

リソース

  • anki://decks/all - 利用可能なデッキの完全なリスト
  • anki://note-types/all - 利用可能なすべてのノートタイプのリスト
  • anki://note-types/all-with-schemas - すべてのノートタイプの詳細な構造情報
  • anki://note-types/{modelName} - 特定のノートタイプの詳細な構造情報

前提条件

  1. システムにAnkiがインストールされています
  2. AnkiにAnkiConnectアドオンをインストールする

構成

Claude Desktopでの使用

claude_desktop_config.json にサーバーを追加します。

{ "mcpServers": { "anki": { "command": "npx", "args": ["--yes","anki-mcp-server"] } } }

Cline の構成

VSCode の設定cline_mcp_settings.json内の Cline MCP 設定ファイルにサーバーを追加します。

{ "mcpServers": { "anki": { "command": "npx", "args": ["--yes","anki-mcp-server"] } } }

発達

設定

  1. 依存関係をインストールします:
npm install
  1. サーバーを構築します。
npm run build
  1. 自動リビルドを使用した開発の場合:
npm run watch

テスト

テスト スイートを実行します。

npm test

これは次のテストを実行します:

  • サーバーの初期化
  • AnkiConnectコミュニケーション
  • メモ操作(作成/読み取り/更新/削除)
  • デッキ管理
  • エラー処理

デバッグ

MCP サーバーは stdio 経由で通信するため、 MCP Inspectorを使用することをお勧めします。

npm run inspector

これにより、次のブラウザベースのインターフェースが提供されます。

  • MCPメッセージの監視
  • テストツールの呼び出し
  • サーバーログの表示
  • 通信問題のデバッグ

使用例

  1. 新しいデッキを作成します:
Create a new Anki deck called "Programming"
  1. 基本カードを追加します:
Create an Anki card in the "Programming" deck with: Front: What is a closure in JavaScript? Back: A closure is the combination of a function and the lexical environment within which that function was declared.
  1. 穴埋め式削除カードを追加します:
Create a cloze card in the "Programming" deck with: Text: In JavaScript, {{c1::const}} declares a block-scoped variable that cannot be {{c2::reassigned}}.

貢献

  1. リポジトリをフォークする
  2. 機能ブランチを作成する
  3. テストを実行: npm test
  4. プルリクエストを送信する

クレジット

アイコンはmacOS Iconsより提供

ライセンス

MITライセンス - 詳細はLICENSEファイルを参照

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

LLM が AnkiConnect を介して Anki フラッシュカード ソフトウェアと対話できるようにし、フラッシュカード、デッキ、およびノート タイプの作成と管理を可能にするモデル コンテキスト プロトコル サーバー。

  1. Features
    1. Tools
    2. Resources
  2. Prerequisites
    1. Configuration
      1. Usage with Claude Desktop
      2. Configuration for Cline
    2. Development
      1. Setup
      2. Testing
      3. Debugging
    3. Example Usage
      1. Contributing
        1. Credits
          1. License
            ID: fpgag671vh