Anytype 标志

Anytype

组织
anyproto

An MCP server enabling AI assistants to interact with Anytype - your encrypted, local and collaborative wiki - to organize objects, lists, and more through natural language.

发布者anyproto
代码仓库anytype-mcp
语言TypeScript
复刻数
59
星标数
525
可用工具
29
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    Anytype 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 29 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 525 个 Star 和 59 个 Fork。

Anytype MCP Server

The Anytype MCP Server is a Model Context Protocol (MCP) server enabling AI assistants to seamlessly interact with Anytype's API through natural language.

It bridges the gap between AI and Anytype's powerful features by converting Anytype's OpenAPI specification into MCP tools, allowing you to manage your knowledge base through conversation.

Features

  • Global & Space Search
  • Spaces & Members
  • Objects & Lists
  • Properties & Tags
  • Types & Templates

Quick Start

1. Get Your API Key

  1. Open Anytype
  2. Go to App Settings
  3. Navigate to API Keys section
  4. Click on Create new button

You can also get your API key using the command line:

bash
npx -y @anyproto/anytype-mcp get-key

2. Configure Your MCP Client

Claude Desktop, Cursor, Windsurf, Raycast, etc.

Add the following configuration to your MCP client settings after replacing <YOUR_API_KEY> with your actual API key:

json
{
  "mcpServers": {
    "anytype": {
      "command": "npx",
      "args": ["-y", "@anyproto/anytype-mcp"],
      "env": {
        "OPENAPI_MCP_HEADERS": "{\"Authorization\":\"Bearer <YOUR_API_KEY>\", \"Anytype-Version\":\"2025-11-08\"}"
      }
    }
  }
}

Tip: After creating an API key in Anytype, you can copy that ready-to-use configuration snippet with your API key already filled in from the API Keys section.

Claude Code (CLI)

Run this command to add the Anytype MCP server after replacing <YOUR_API_KEY> with your actual API key:

bash
claude mcp add anytype -e OPENAPI_MCP_HEADERS='{"Authorization":"Bearer <YOUR_API_KEY>", "Anytype-Version":"2025-11-08"}' -s user -- npx -y @anyproto/anytype-mcp

If you prefer to install the package globally:

  1. Install the package:
bash
npm install -g @anyproto/anytype-mcp
  1. Update your MCP client configuration to use the global installation:
json
{
  "mcpServers": {
    "anytype": {
      "command": "anytype-mcp",
      "env": {
        "OPENAPI_MCP_HEADERS": "{\"Authorization\":\"Bearer <YOUR_API_KEY>\", \"Anytype-Version\":\"2025-11-08\"}"
      }
    }
  }
}

Custom API Base URL

By default, the server connects to http://127.0.0.1:31009. For anytype-cli (port 31012) or other custom base URLs, set ANYTYPE_API_BASE_URL:

MCP Client (Claude Desktop, Cursor, etc.):

json
{
  "mcpServers": {
    "anytype": {
      "command": "npx",
      "args": ["-y", "@anyproto/anytype-mcp"],
      "env": {
        "ANYTYPE_API_BASE_URL": "http://localhost:31012",
        "OPENAPI_MCP_HEADERS": "{\"Authorization\":\"Bearer <YOUR_API_KEY>\", \"Anytype-Version\":\"2025-11-08\"}"
      }
    }
  }
}

Claude Code (CLI):

bash
claude mcp add anytype \
  -e ANYTYPE_API_BASE_URL='http://localhost:31012' \
  -e OPENAPI_MCP_HEADERS='{"Authorization":"Bearer <YOUR_API_KEY>", "Anytype-Version":"2025-11-08"}' \
  -s user -- npx -y @anyproto/anytype-mcp

Example Interactions

Here are some examples of how you can interact with your Anytype:

  • "Create a new space called 'Project Ideas' with description 'A space for storing project ideas'"
  • "Add a new object of type 'Task' with title 'Research AI trends' to the 'Project Ideas' space"
  • "Create a second one with title 'Dive deep into LLMs' with due date in 3 days and assign it to me"
  • "Now create a collection with the title "Tasks for this week" and add the two tasks to that list. Set due date of the first one to 10 days from now"

Tool behavior and API versions

The server loads one OpenAPI document at startup. With the standard configuration it tries /v2/docs/openapi.json first. If that endpoint returns 404 or 410, it falls back to /docs/openapi.json on the same server, where older apps serve v1. This selects v2 whenever available while supporting apps that only have the legacy API:

json
"args": ["-y", "@anyproto/anytype-mcp"]

To explicitly use the legacy v1 API, select its versioned spec:

json
"args": ["-y", "@anyproto/anytype-mcp", "run", "http://127.0.0.1:31009/v1/docs/openapi.json"]

The versioned /v2/docs/openapi.json URL also remains available for explicitly selecting v2.

Explicit spec URLs and local files are used exactly as supplied, without fallback. Authentication failures, server errors, connection failures, and malformed JSON also fail startup instead of selecting another API. The wrapper uses the routes declared in the selected document without rewriting their version prefixes.

Discovery runs once per MCP process. Tool calls reuse the parsed specification and HTTP client without fetching OpenAPI again. Restart the MCP server after updating Anytype to discover a newly available API version; no persistent spec cache is used.

Tool descriptions contain operation guidance; API errors are returned when calls fail, with isError: true, HTTP status when available, and the API's code, message, issues, and hints.

The server names its own operations by OpenAPI operationId in the prose it serves. In the MCP tool listing and in the field descriptions of a get_schema or get_op_schema response, those names are re-spelled as this wrapper's tool names (list_properties becomes API-list-properties). A repair hint is different: the server spells each operation it names as a REST route and lists it as a typed see_also reference, so the wrapper replaces that route text with the tool name and arguments, and annotates the reference with tool and args. Literal values are never rewritten: enum and example values, op names, endpoint strings and output schemas keep the server's spelling, and so do the OpenAI and Anthropic tool exports, which name tools by operationId.

Successful v1 object creation, updates, deletion, and chat creation return a compact object receipt with its ID, space ID, name, archive state, and type identity when available. The wrapper omits echoed markdown, snippets, property values, icons, and full type definitions. It preserves warnings, generated IDs, and etag/retry metadata. Read the object to retrieve its content when needed. v2 already returns compact create/edit receipts, which are passed through unchanged apart from their warnings, whose hints are re-spelled and whose references gain tool and args; reads, searches, and errors also keep their full API responses.

The shared tool policy controls inputs and request routing:

  • Authorization and Anytype-Version come from OPENAPI_MCP_HEADERS.
  • expected_etag maps to If-Match. Use the etag from a previous read to prevent overwriting a changed object. The wrapper does not retry a failed precondition or remove it. Response etags are returned in a separate request_metadata text block when available.
  • request_key maps to Idempotency-Key on endpoints that declare that header. Omit it for a new write; the wrapper generates a unique key and returns it in request_metadata or an error's request_key. Reuse it only to retry the same write. Separate calls get different generated keys, even with identical documents. There are no automatic retries. A global Idempotency-Key in OPENAPI_MCP_HEADERS is rejected.
  • Existing callers can still use the exact legacy If-Match and Idempotency-Key argument names. They are not advertised alongside the new names. Conflicting alias values are rejected.
  • Pagination, field selection, dry_run, create_missing_options, and schema discovery remain available.
  • Pairing and API-key management are excluded. v2 auth_whoami remains available for inspecting the current credential's permissions; its response does not contain the bearer token.
  • Event-stream tools are excluded because they do not produce a bounded tool result. Use message-listing tools to retrieve chat messages.
  • File downloads are supported through a binary adapter. The tool streams bytes to a private temporary directory and returns path, filename, media_type, and size. The path is local to the machine/container running MCP. Successful files remain there until removed or cleaned up by the operating system; interrupted downloads are removed. Range and cache headers are not model inputs.

Known inputs with HTTP meanings are matched by parameter location, so a document's own fields are preserved. Open-ended JSON documents use the body argument. Objects with declared fields use flat arguments. The existing omission of flattened filters fields and the FilterExpression schema fallback remain separate limitations; this cleanup does not restore filter-schema support.

Duplicate final tool names fail startup with both routes identified. Select separate v1/v2 specs instead of merging operations with overlapping names.

Set ANYTYPE_MCP_DEBUG=1 for concise operation names, response status, and timing on stderr. Arguments, authorization headers, payloads, and entire operation tables are not logged.

Measuring tool definitions

bash
bun run measure-tools
# Or inspect a different local OpenAPI document:
bun run measure-tools ./path/to/openapi.json

The default command compares fixed v1 and v2 fixtures. It reports tool count, serialized characters, and UTF-8 bytes, not model-specific token counts.

Development

Installation from Source

  1. Clone the repository:
bash
git clone https://github.com/anyproto/anytype-mcp.git
cd anytype-mcp
  1. Install dependencies (requires Bun):
bash
bun install
  1. Build the project:
bash
bun run build
  1. Link the package globally (optional):
bash
bun link

Contribution

Thank you for your desire to develop Anytype together!

❤️ This project and everyone involved in it is governed by the Code of Conduct.

🧑‍💻 Check out our contributing guide to learn about asking questions, creating issues, or submitting pull requests.

🫢 For security findings, please email security@anytype.io and refer to our security guide for more information.

🤝 Follow us on Github and join the Contributors Community.


Made by Any — a Swiss association 🇨🇭

Licensed under MIT.

安装

TypingMind
前提条件:

Node.js 18+

{
  "mcpServers": {
    "anytype": {
      "command": "npx",
      "args": [
        "-y",
        "@anyproto/anytype-mcp"
      ],
      "env": {
        "OPENAPI_MCP_HEADERS": "{\"Authorization\":\"Bearer <YOUR_API_KEY>\", \"Anytype-Version\":\"2025-05-20\"}"
      }
    }
  }
}

可用工具

  • API-search-global

    Search objects across all spaces Error Responses: 401: Unauthorized 500: Internal server error

  • API-list-spaces

    List spaces Error Responses: 401: Unauthorized 500: Internal server error

  • API-create-space

    Create space Error Responses: 400: Bad request 401: Unauthorized 429: Rate limit exceeded 500: Internal server error

  • API-get-space

    Get space Error Responses: 401: Unauthorized 404: Space not found 500: Internal server error

  • API-update-space

    Update space Error Responses: 400: Bad request 401: Unauthorized 403: Forbidden 404: Space not found 429: Rate limit exceeded 500: Internal server error

  • API-add-list-objects

    Add objects to list Error Responses: 400: Bad request 401: Unauthorized 404: Not found 429: Rate limit exceeded 500: Internal server error

  • API-get-list-views

    Get list views Error Responses: 401: Unauthorized 404: Not found 500: Internal server error

  • API-get-list-objects

    Get objects in list Error Responses: 401: Unauthorized 404: Not found 500: Internal server error

  • API-list-members

    List members Error Responses: 401: Unauthorized 500: Internal server error

  • API-get-member

    Get member Error Responses: 401: Unauthorized 404: Member not found 500: Internal server error

  • API-list-objects

    List objects Error Responses: 401: Unauthorized 500: Internal server error

  • API-create-object

    Create object Error Responses: 400: Bad request 401: Unauthorized 429: Rate limit exceeded 500: Internal server error

  • API-get-object

    Get object Error Responses: 401: Unauthorized 404: Resource not found 410: Resource deleted 500: Internal server error

  • API-update-object

    Update object Error Responses: 400: Bad request 401: Unauthorized 404: Resource not found 410: Resource deleted 429: Rate limit exceeded 500: Internal server error

  • API-list-properties

    List properties Error Responses: 401: Unauthorized 500: Internal server error

  • API-create-property

    Create property Error Responses: 400: Bad request 401: Unauthorized 429: Rate limit exceeded 500: Internal server error

  • API-get-property

    Get property Error Responses: 401: Unauthorized 404: Resource not found 410: Resource deleted 500: Internal server error

  • API-update-property

    Update property Error Responses: 400: Bad request 401: Unauthorized 403: Forbidden 404: Resource not found 410: Resource deleted 429: Rate limit exceeded 500: Internal server error

  • API-list-tags

    List tags Error Responses: 401: Unauthorized 404: Property not found 500: Internal server error

  • API-create-tag

    Create tag Error Responses: 400: Bad request 401: Unauthorized 429: Rate limit exceeded 500: Internal server error

  • API-get-tag

    Get tag Error Responses: 401: Unauthorized 404: Resource not found 410: Resource deleted 500: Internal server error

  • API-update-tag

    Update tag Error Responses: 400: Bad request 401: Unauthorized 403: Forbidden 404: Resource not found 410: Resource deleted 429: Rate limit exceeded 500: Internal server error

  • API-search-space

    Search objects within a space Error Responses: 401: Unauthorized 500: Internal server error

  • API-list-types

    List types Error Responses: 401: Unauthorized 500: Internal server error

  • API-create-type

    Create type Error Responses: 400: Bad request 401: Unauthorized 429: Rate limit exceeded 500: Internal server error

  • API-get-type

    Get type Error Responses: 401: Unauthorized 404: Resource not found 410: Resource deleted 500: Internal server error

  • API-update-type

    Update type Error Responses: 400: Bad request 401: Unauthorized 404: Resource not found 410: Resource deleted 429: Rate limit exceeded 500: Internal server error

  • API-list-templates

    List templates Error Responses: 401: Unauthorized 500: Internal server error

  • API-get-template

    Get template Error Responses: 401: Unauthorized 404: Resource not found 410: Resource deleted 500: Internal server error

将 Anytype MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 Anytype 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 Anytype 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 Anytype MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "anytype": {
      "command": "npx",
      "args": [
        "-y",
        "@anyproto/anytype-mcp"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 Anytype MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 Anytype MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 Anytype 帮我完成这项任务吗?
Anytype
当然。我已阅读。
以下是我使用 Anytype 得到的结果。

常见问题

Anytype MCP 服务器有什么用途?

Anytype 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 Anytype MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 Anytype,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 Anytype MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 Anytype 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 Anytype MCP 连接到 TypingMind?

Anytype 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

Anytype MCP 在 TypingMind 中提供哪些工具?

Anytype 提供 29 个 MCP 工具,您可以在 TypingMind 的插件页面启用这些工具,然后在聊天中使用,或将其分配给 AI 智能体。

使用 Anytype MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 Anytype 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇