Anki MCP Server
Anki MCP 服务器
Claude Desktop 的 MCP(模型上下文协议)服务器通过 AnkiConnect 连接到 Anki 并检索带有水蛭标记的卡片。
特征
通过 AnkiConnect API 连接到 Anki
检索带有“leech”标签的卡片
在卡片上添加带有日期戳的评论标签
提供全面的卡片数据供 Claude 分析
可与 Claude Desktop 一起使用
Related MCP server: Anki MCP
先决条件
Anki安装并运行
AnkiConnect插件安装在 Anki 中
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 版本 |
|
| 启用模拟模式进行测试(真/假) |
|
如果未设置环境变量,服务器将使用默认值。
查找 AnkiConnect 的本地 IP 地址
如果连接到localhost不起作用,则需要使用计算机的本地 IP 地址。使用以下命令配置.env文件:
ANKI_CONNECT_URL=http://YOUR_LOCAL_IP:8765要查找您的本地 IP 地址:
macOS :打开终端并运行
ifconfig或ipconfig getifaddr en0(适用于 WiFi)Windows :打开命令提示符并运行
ipconfigLinux :打开终端并运行
ip addr show或hostname -I
在输出中查找 IPv4 地址,例如192.168.xx或10.xxx 。
测试配置
为了测试,提供了一个单独的配置文件.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用法
确保 Anki 正在运行并且安装了 AnkiConnect
运行 MCP 服务器:
npm start
配置 Claude 桌面
要将此 MCP 服务器与 Claude Desktop 一起使用:
打开 Claude 桌面
编辑位于以下位置的 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):是否返回综合卡数据或仅返回 IDcount(可选,数字):返回的随机卡片数量(默认为所有卡片)
标签_已审阅_卡片
为指定卡片添加带有日期标记的“已审阅”标签。这样您就可以追踪哪些卡片已由 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 地址
更新您的
.env文件以使用ANKI_CONNECT_URL=http://YOUR_LOCAL_IP:8765确保 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执照
麻省理工学院
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with the Anki desktop app for spaced repetition learning. Supports reviewing due cards, creating new flashcards, and managing study sessions through natural language commands.MIT
- 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.
- FlicenseNot 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.
- FlicenseNot gradedqualityDmaintenanceProvides programmatic access to Anki flashcard operations through the AnkiConnect API, allowing users to list and create decks and cards. It enables seamless management of flashcards directly from MCP-compatible clients like Claude Desktop.
Related MCP Connectors
Connect Claude to Fathom meeting recordings, transcripts, and summaries
WHOOP recovery, strain, sleep and workouts in Claude via official WHOOP OAuth. Free, open source.
Connect your team's living knowledge base — docs, data, issues, CRM — to Claude and ChatGPT.
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/captain-blue210/anki-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server