Anki MCP Server
Anki MCP サーバー
AnkiConnect を介して Anki に接続し、リーチタグ付きカードを取得する、Claude Desktop 用の MCP (Model Context Protocol) サーバー。
特徴
AnkiConnect API経由でAnkiに接続します
「リーチ」タグが付いたカードを取得します
カードに日付スタンプ付きのレビュータグを追加します
クロードによる分析のための包括的なカードデータを提供する
Claude Desktopで使用可能
Related MCP server: mcp-ankiconnect
前提条件
Ankiをインストールして実行中
AnkiにAnkiConnectアドオンをインストールする
Node.jsとnpm
インストール
このリポジトリをクローンします:
git clone https://github.com/yourusername/anki-mcp-server.git cd anki-mcp-server依存関係をインストールします:
npm installプロジェクトをビルドします。
npm run build
構成
サーバーは環境変数を使用して設定できます。提供されているサンプルファイルをコピーして、独自の設定を作成してください。
cp .env.example .env次に、 .envファイルを編集して設定をカスタマイズします。
環境変数 | 説明 | デフォルト値 |
| Anki Connect APIのURL |
|
| 使用するAnki Connect APIのバージョン |
|
| テスト用にモックモードを有効にする (true/false) |
|
環境変数が設定されていない場合、サーバーはデフォルト値を使用します。
AnkiConnect のローカル IP アドレスを見つける
localhostへの接続がうまくいかない場合は、代わりにコンピューターのローカル IP アドレスを使用する必要があります.envファイルを次のように設定してください。
ANKI_CONNECT_URL=http://YOUR_LOCAL_IP:8765ローカル IP アドレスを見つけるには:
macOS : ターミナルを開き、
ifconfigまたはipconfig getifaddr en0(WiFi の場合) を実行します。Windows : コマンドプロンプトを開き、
ipconfigを実行します。Linux : ターミナルを開き、
ip addr showまたはhostname -Iを実行します。
出力で192.168.xxや10.xxxなどの IPv4 アドレスを探します。
テスト構成
テスト用に、別の構成ファイル.env.testが提供されています。
cp .env.example .env.testテスト固有の値を設定するには、 .env.testを編集します。
ANKI_CONNECT_URL=http://localhost:8765
ANKI_CONNECT_VERSION=6
ANKI_MOCK_MODE=trueテストモードで実行するには:
npm run start:test使用法
AnkiConnectがインストールされた状態でAnkiが動作していることを確認してください
MCP サーバーを実行します。
npm start
Claudeデスクトップの設定
この MCP サーバーを Claude Desktop で使用するには:
クロードデスクトップを開く
次の場所にある Claude Desktop 構成ファイルを編集します。
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
mcpServersセクションに次の構成を追加します。
{
"mcpServers": {
"anki": {
"command": "node",
"args": ["path/to/anki-mcp-server/dist/index.js"]
}
}
}"path/to/anki-mcp-server"このリポジトリをクローンした実際のパスに置き換えます。
MCPツールの使用
設定が完了すると、Claude で次のツールを使用できるようになります。
使用例
Could you analyze my Anki leech cards and suggest ways to improve my study?クロードは MCP サーバーを使用してリーチ カードを取得し、分析します。
利用可能なツール
リーチカードを取得する
Anki からリーチとしてタグ付けされたカードを取得します。
パラメータ:
detailed(オプション、ブール値、デフォルト:true):包括的なカードデータを返すか、IDのみを返すかcount(オプション、数値): 返されるランダムカードの数 (デフォルトはすべてのカード)
タグレビュー済みカード
指定したカードに日付入りの「レビュー済み」タグを追加します。これにより、Claude でレビューしたカードを追跡できます。
パラメータ:
card_ids(必須、数字の配列): レビュー済みとしてタグ付けするカードIDの配列custom_tag_prefix(オプション、文字列、デフォルト: "レビュー"): タグのカスタム プレフィックス
タグの形式は見直し_YYYYMMDD (または指定されている場合はカスタムプレフィックス) になります。
Claude での使用例:
I've reviewed these cards, please tag them as reviewed: [1234567890, 1234567891]トラブルシューティング
「Ankiに接続できませんでした」 - Ankiが実行中であり、AnkiConnectが正しくインストールされていることを確認してください
「リーチカードが見つかりません」 - Ankiに「リーチ」タグの付いたカードがありません
localhost との接続の問題-
localhostを使用して接続できない場合:構成セクションの説明に従ってローカルIPアドレスを見つけます
ANKI_CONNECT_URL=http://YOUR_LOCAL_IP:8765使用するように.envファイルを更新します。AnkiConnectがあなたのIPアドレスからの接続を許可するように設定されていることを確認してください
これらの変更を行った後、MCPサーバーを再起動します。
タグが表示されない-
tag_reviewed_cardsツールに有効なカード ID を指定していることを確認してください
テストモード
実際の Anki データに影響を与えずにテストするには、モック モードを使用できます。
.envファイルでANKI_MOCK_MODE=trueを設定するか、提供されている.env.testファイルを使用します。npm run start:testでサーバーを実行します。
モックモードでは、サーバーはAnkiに実際に接続することなく、Ankiのすべての操作をシミュレートします。これは、データ変更のリスクを負うことなくClaudeとの統合をテストするのに役立ちます。
発達
ホット リロードを使用して開発モードでサーバーを実行するには:
npm run devモックモードを有効にした開発の場合:
npm run dev:testライセンス
マサチューセッツ工科大学
Available Tools
2 toolsget_leech_cardsB
Retrieve cards tagged as leeches from Anki
Inputs: detailed, count.
tag_reviewed_cardsC
Add a 'reviewed on date' tag to specified cards
Inputs: card_ids (required), custom_tag_prefix.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have completely distinct purposes: one retrieves cards with a specific tag, while the other adds a tag to cards. There is no overlap in functionality or ambiguity between them.
Both tools follow a consistent verb_noun pattern (get_leech_cards, tag_reviewed_cards) with clear actions and objects, making them predictable and easy to understand.
With only 2 tools, the server feels thin for an Anki integration, lacking basic operations like creating cards, reviewing cards, or managing decks. This minimal set limits agent workflows significantly.
The toolset is severely incomplete for an Anki server, missing core CRUD operations for cards, decks, and reviews. Agents cannot perform essential tasks like adding new cards or scheduling reviews, leading to dead ends.
Maintenance
Related MCP Connectors
Learn languages in Claude: review your flashcards, track progress, build collections, ask questions.
241Turn text, files, URLs, or photos into Anki flashcard decks from your AI assistant.
Connect Claude to Fathom meeting recordings, transcripts, and summaries
Connect Claude to your Platform7n workspaces: chat, links, work and decks. One-click OAuth.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants like Claude to interact with Anki flashcard decks through AnkiConnect. Supports creating and managing decks, basic and cloze deletion cards, searching existing cards, and organizing content with tags.-
- AlicenseNot gradedqualityNot gradedmaintenanceConnects Claude to Anki flashcard software via AnkiConnect, enabling users to review due cards, create flashcards, and manage spaced repetition learning through natural language conversations.MIT
- FlicenseNot gradedqualityDmaintenanceConnects Claude Desktop to personal Japanese study data, including Anki due cards and a study session log, enabling card retrieval, session logging, streak tracking, and interactive quizzes.-
- AlicenseAqualityCmaintenanceEnables reading and writing to your local Anki collection through AnkiConnect, allowing creation, update, and search of notes and decks from MCP clients like Claude Desktop.11MIT