anytype-mcp-remote
Provides tools for interacting with a self-hosted Anytype space, including full-text search, fetching objects, listing spaces, types, objects, and properties, and optionally creating or updating objects when writes are enabled.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@anytype-mcp-remotesearch my notes for the meeting agenda"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
anytype-mcp-remote
A remote MCP server (Streamable HTTP) in front of the local Anytype REST API. It lets ChatGPT — or any MCP client that supports remote servers — talk to a self-hosted Anytype space.
ChatGPT --HTTPS--> tunnel --> anytype-mcp-remote :8787 --> 127.0.0.1:31012 --> any-sync network
(headless anytype-cli)Why @anyproto/anytype-mcp is not enough
The official package exposes only StdioServerTransport: it runs as a child
process of the client, over stdin/stdout. ChatGPT, by contrast, connects to
remote MCP servers over HTTPS. This project is the missing piece: the same
API underneath, HTTP transport on top.
Related MCP server: Obsidian MCP Server
Tools exposed
Tool | What it does |
| full-text search, returns id + title + preview |
| one whole object with its properties |
| spaces visible to the bot |
| defined types and their properties |
| every object of one or more types (pagination handled) |
| properties and, on request, the tag IDs of select fields |
| creates an object — only with |
| edits name/properties — only with |
search and fetch carry those names on purpose: they are the ones ChatGPT
expects.
Responses go through a slim() function that discards the type schema attached
to every object (tens of KB per record). Without it, a list of 100 objects would
swamp the context.
Configuration
See .env.example. In short:
Variable | Role |
|
|
| key generated by the CLI; it never leaves the server |
| your secret, the one you hand to the client. Min 24 chars |
|
|
| when set, the server is pinned to that space |
| your domain: it lands in the OpenAPI document for Actions |
| listening interface, |
The environment is validated as a whole at startup (src/config.ts): if a
variable is missing or malformed the process dies immediately naming it, rather
than failing later as a 401 or a broken URL in the schema.
Security
The token is the password. Whoever has the URL has access: treat it as a credential, keep it out of chats and screenshots. To rotate it, change
MCP_TOKENand restart.The Anytype key never leaves the VPS. It lives in the environment file; the client only ever sees your token.
Writes are off by default. With
MCP_ALLOW_WRITES=falsethe write tools are not even registered: they do not appear intools/list, so the model cannot attempt them. Turn them on only if you truly need them.Pin the space. With
MCP_SPACE_IDset, thespace_idparameter disappears from the schemas and any attempt to point elsewhere is refused.The bot is revocable. If something goes wrong, remove it from the space in the desktop app: it loses access without you touching your personal account.
The token is compared in constant time and never reaches the logs.
Development
TypeScript in strict mode, compiled with tsc into dist/. No bundler, no
runtime transpiler: the service runs ordinary JavaScript.
Command | What it does |
|
|
| compiles and runs the unit tests ( |
| emits |
| runs |
| typecheck plus tests, what CI runs |
Unit tests live in test/ and never touch the network: the Anytype client takes
an injected fetch, so retries, pagination and 401s can be exercised without a
real instance. They cover config validation, object reduction, client retries,
authentication and the shape of the OpenAPI document.
Contributions must be written in English — see AGENTS.md.
Integration test against a real Anytype
The server behaves identically against the desktop app (port 31009): same
/v1 API.
npm install
npm run build
export ANYTYPE_API_BASE_URL=http://127.0.0.1:31009
export ANYTYPE_API_KEY=<app key from the desktop>
export MCP_SPACE_ID=<space id>
export MCP_TOKEN=$(openssl rand -hex 32)
export PORT=8791
npm start &
npm run smokescripts/smoke.ts speaks JSON-RPC like a real MCP client: initialize,
tools/list, then search / fetch / list_objects, and it checks that a
wrong token gives a 401 and that the write tools stay hidden when not enabled.
Installing on a VPS
The full runbook, including the privileged steps, is in deploy/RUNBOOK.md.
Supporting files in deploy/: network.yml (a template for the self-hosted
any-sync network — put your own networkId and peerId values in it, it is not
usable as-is), anytype-mcp-remote.service (systemd unit), Caddyfile and
cloudflared-config.yml (TLS and reverse proxy, pick one).
Licence
MIT — see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP server for AI agent identity, permissions, verification, and reusable proof.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Query, browse, and automate OmegaAI workspaces from any MCP client. Streamable HTTP with OAuth 2.0.
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA Model Context Protocol (MCP) server implementation that enables AI assistants to interact with Anytype's API through natural language, allowing users to manage their knowledge base through conversation.862517MIT
- AlicenseNot gradedqualityBmaintenanceEnables external applications to interact with an Obsidian vault through MCP tools, including semantic search and file operations.20513AGPL 3.0
- FlicenseNot gradedqualityCmaintenanceSelf-hosted MCP server that provides remote AI clients with read and write access to Obsidian vaults over HTTPS without needing the Obsidian desktop app running.2-
- AlicenseNot gradedqualityAmaintenanceEnables search, content creation, weblink saving, and knowledge base analysis with Capacities through any MCP-compatible client.7MIT