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 Model Context Protocol server that enables LLMs to interact with Salesforce data through SOQL queries, SOSL searches, and various API operations including record management.
                    Last updated -
                    10
                    77
                    Python
                    MIT License
                  • A
                    security
                    A
                    license
                    A
                    quality
                    A Model Context Protocol server that gives LLMs the ability to interact with Ethereum networks, manage wallets, query blockchain data, and execute smart contract operations through a standardized interface.
                    Last updated -
                    31
                    323
                    2
                    TypeScript
                    MIT License
                  • 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
                    206
                    30
                    TypeScript
                    • Apple
                  • A
                    security
                    A
                    license
                    A
                    quality
                    A Model Context Protocol server that enables LLMs to interact with web pages, take screenshots, generate test code, scrape web pages, and execute JavaScript in a real browser environment.
                    Last updated -
                    29
                    10
                    1
                    TypeScript
                    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