首页
学习
活动
专区
圈层
工具
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
首页
学习
活动
专区
圈层
工具
MCP广场
MCP广场 >详情页
anki-mcp-server云托管模式2025-06-170分享
github
一种模型上下文协议服务器,使大型语言模型(LLMs)能够通过AnkiConnect与Anki闪卡软件交互,从而实现对闪卡、卡组和笔记类型的创建与管理。
By nailuoGG
2025-06-170
github
详情内容

Anki MCP 服务器

一个模型上下文协议 (MCP) 服务器,通过 AnkiConnect 使 LLM 能够与 Anki 闪卡软件进行交互。

功能

工具

  • list_decks - 列出所有可用的 Anki 卡组
  • create_deck - 创建一个新的 Anki 卡组
  • create_note - 创建一个新的笔记(基础或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. 添加一张Cloze删除卡片:
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 文件

通过SSE URL连接服务
Server已在腾讯云托管,可在连接后免费调用和在线进行工具测试~
工具测试
已支持Server下的10个工具,可选择工具进行在线测试
list_decks
List all available Anki decks
create_deck
Create a new Anki deck
create_note
Create a new note (Basic or Cloze)
batch_create_notes
Create multiple notes at once
search_notes
Search for notes using Anki query syntax
get_note_info
Get detailed information about a note
update_note
Update an existing note
delete_note
Delete a note
list_note_types
List all available note types
create_note_type
Create a new note type
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档