AnkiConnect 闪卡
STDIO通过MCP连接Claude与Anki闪卡系统
通过MCP连接Claude与Anki闪卡系统
Connect Claude conversations with AnkiConnect via MCP to make spaced repetition as easy as "Let's go through today's flashcards" or "Make flashcards for this"
The server implements three tools:
num_cards_due_today
: Get the number of cards due today
deck
argument to filter by specific deckget_due_cards
: Get cards that are due for review
limit
argument (default: 5) to control number of cardsdeck
argument to filter by specific decktoday_only
argument (default: true) to show only today's cardssubmit_reviews
: Submit answers for reviewed cards
reviews
with card_id
and rating
defaults write net.ankiweb.dtop NSAppSleepDisabled -bool true defaults write net.ichi2.anki NSAppSleepDisabled -bool true defaults write org.qt-project.Qt.QtWebEngineCore NSAppSleepDisabled -bool true
Install the AnkiConnect plugin in Anki:
2055492159
Configure Claude Desktop:
On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
Add this configuration:
{ "mcpServers": { "mcp-ankiconnect": { "command": "uv", "args": ["run", "--with", "mcp-ankiconnect", "mcp-ankiconnect"] } } }
Restart Anki and Claude desktop
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector. First, clone the repository and install the dependencies:
git clone https://github.com/samefarrar/mcp-ankiconnect.git cd mcp-ankiconnect uv sync
You can launch the MCP Inspector via the mcp CLI:
uv run mcp dev mcp_ankiconnect/server.py
Upon launching, the Inspector will display a URL you can access in your browser to begin debugging.