Anytype MCP Server

Anytype MCP Server

site icon
2025.04.14 6
JavaScript数据管理API 集成自动化工具开发效率交流协作
Anytype MCP Server 是一个基于 Model Context Protocol (MCP) 的服务,提供对 Anytype API 的访问,允许 AI 助手和其他 MCP 客户端与用户的 Anytype 数据进行交互。该服务支持多种操作,包括获取空间列表、搜索和获取对象、创建和删除空间和对象、导出对象为 markdown 等。
View on GitHub

Overview

基本能力

产品定位

Anytype MCP Server 是一个中间件服务,旨在通过 MCP 协议为 AI 助手和其他客户端提供对 Anytype 数据的访问和操作能力。

核心功能

  • 获取空间列表 (get_spaces)
  • 在空间内或全局搜索/获取对象 (get_objects, search_space, global_search)
  • 获取详细对象内容 (get_object_content,支持检索完整文本)
  • 创建和删除空间 (create_space) 和对象 (create_object, delete_object)
  • 将对象导出为 markdown (export_object)
  • 管理列表视图和列表中的对象 (get_list_views, get_list_view_objects, add_objects_to_list, remove_object_from_list)
  • 获取空间成员 (get_space_members)
  • 获取类型和模板 (get_types, get_type_details, get_templates, get_template_details)

适用场景

  • AI 助手需要访问和操作用户的 Anytype 数据
  • 开发者需要构建与 Anytype 集成的应用
  • 自动化工作流需要与 Anytype 数据进行交互

工具列表

  • get_spaces: 获取用户的所有空间列表
  • get_objects: 获取特定空间中的对象
  • search_space: 在特定空间内搜索对象
  • global_search: 全局搜索对象
  • get_object_content: 获取对象的详细内容
  • create_space: 创建新空间
  • create_object: 创建新对象
  • delete_object: 删除对象
  • export_object: 将对象导出为 markdown
  • get_list_views: 获取列表视图
  • get_list_view_objects: 获取列表视图中的对象
  • add_objects_to_list: 向列表中添加对象
  • remove_object_from_list: 从列表中移除对象
  • get_space_members: 获取空间成员
  • get_types: 获取类型
  • get_type_details: 获取类型详情
  • get_templates: 获取模板
  • get_template_details: 获取模板详情

常见问题解答

  1. Anytype API 无响应
  2. 确保 Anytype 桌面应用程序正在运行
  3. 认证问题
  4. 运行 npm run get-key 获取新的应用密钥
  5. 更新 MCP 配置中的密钥
  6. 重启 MCP 客户端
  7. 本地 API 端口
  8. 默认端口为 31009,如果使用不同端口,需要修改 src/index.ts 中的 apiBaseUrl

使用教程

使用依赖

  • Node.js 18 或更高版本
  • 本地运行的 Anytype 桌面应用程序
  • Anytype 账户

安装教程

  1. 克隆仓库: cli git clone https://github.com/yourusername/anytype-mcp-server.git cd anytype-mcp-server
  2. 安装依赖: node npm install
  3. 构建项目: node npm run build
  4. 获取应用密钥: node npm run get-key

调试方式

  1. 手动启动服务器: node npm start
  2. 检查日志输出是否有错误信息
  3. 确保 Anytype 桌面应用程序正在运行

许可证

该项目遵循 MIT 开源许可条款。