Skip to main content
Glama

Anki MCP Server

by ethangillani

Anki MCP 服务器

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

特征

  • 在 Anki 中创建新的牌组
  • 向现有卡片组添加注释
  • 列出可用的卡组并注释模型
  • 使用 Anki 的搜索语法搜索笔记
  • 获取有关注释模型及其字段的详细信息
  • 一次批量添加多个注释

先决条件

  • Node.js (v14 或更高版本)
  • 安装了AnkiConnect插件的Anki
  • 与模型上下文协议兼容的客户端(例如支持 Anthropic MCP 的 Claude)

安装

  1. 确保已安装 Anki 和 AnkiConnect 插件
    • 通过转到“工具”>“附加组件”>“获取附加组件”并输入代码: 2055492159安装 AnkiConnect
  2. 克隆此存储库:
    git clone https://github.com/yourusername/anki-mcp-server.git cd anki-mcp-server
  3. 安装依赖项:
    npm install
  4. 构建项目:
    npm run build

用法

  1. 确保 Anki 在您的计算机上运行,并且启用了 AnkiConnect
  2. 启动 MCP 服务器:
    npm start
  3. 将您的 MCP 客户端(例如 Claude)连接到此服务器

可用工具

该服务器为 MCP 客户端提供以下工具:

  • listDecks :获取 Anki 中所有卡牌的列表
  • listModels :获取 Anki 中所有笔记模型/类型的列表
  • createDeck :在 Anki 中创建一个新的卡组
  • getModel :获取特定笔记模型/类型的详细信息
  • addNote :向卡片组添加一条注释
  • addNotes :一次添加多个注释
  • searchNotes :使用 Anki 的搜索语法搜索笔记

示例

创建新牌组

{ "name": "createDeck", "arguments": { "name": "My New Deck" } }

添加注释

{ "name": "addNote", "arguments": { "deckName": "My New Deck", "modelName": "Basic", "fields": { "Front": "What is the capital of France?", "Back": "Paris" }, "tags": ["geography", "europe"] } }

搜索笔记

{ "name": "searchNotes", "arguments": { "query": "deck:\"My New Deck\" tag:geography" } }

配置

服务器配置位于src/index.ts中的config对象中。您可以修改:

  • ankiConnectUrl :AnkiConnect API 的 URL(默认值: http://localhost:8765
  • apiVersion :AnkiConnect 的 API 版本(默认值: 6
  • defaultDeckName :如果未指定则使用默认卡组(默认值: Default

故障排除

  1. 无法连接到 Anki
    • 确保 Anki 正在运行
    • 检查 AnkiConnect 插件是否已安装并正常工作
    • 验证 AnkiConnect URL 是否正确(默认值: http://localhost:8765
  2. AnkiConnect 的权限问题
    • 当服务器尝试添加卡片时,AnkiConnect 可能会提示您输入权限。请查看 Anki 中的弹出窗口。

执照

MIT 许可证

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

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

模型上下文协议服务器允许 LLM 与 Anki 抽认卡软件交互,实现创建卡片组、添加注释、搜索卡片以及通过自然语言管理抽认卡内容等功能。

  1. 特征
    1. 先决条件
      1. 安装
        1. 用法
          1. 可用工具
            1. 示例
              1. 创建新牌组
              2. 添加注释
              3. 搜索笔记
            2. 配置
              1. 故障排除
                1. 执照

                  Related MCP Servers

                  • A
                    security
                    A
                    license
                    A
                    quality
                    A server implementation that connects to a locally running Anki, enabling card review and creation through the Model Context Protocol.
                    Last updated -
                    4
                    154
                    JavaScript
                    MIT License
                    • Apple
                  • A
                    security
                    F
                    license
                    A
                    quality
                    A Model Context Protocol server that enables LLMs to interact with Anki flashcard software through AnkiConnect, allowing for creation and management of flashcards, decks, and note types.
                    Last updated -
                    10
                    53
                    98
                    TypeScript
                    • Apple
                  • -
                    security
                    A
                    license
                    -
                    quality
                    A Model Context Protocol server that bridges Claude AI with Anki flashcard app, allowing users to create and manage flashcards using natural language commands.
                    Last updated -
                    3
                    Python
                    MIT License
                    • Apple
                    • Linux
                  • -
                    security
                    A
                    license
                    -
                    quality
                    A Model Context Protocol server that enables language models to interact with Anki flashcard decks programmatically, with specialized features for Japanese language learning including vocabulary import, sample sentence generation, and spaced repetition review.
                    Last updated -
                    2
                    Python
                    MIT License

                  View all related MCP servers

                  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/ethangillani/Anki-MCP-Server'

                  If you have feedback or need assistance with the MCP directory API, please join our Discord server