# 💙 Community contributions: Anytype-Aware MCP Instructions

**URL:** <https://community.anytype.io/t/community-contributions-anytype-aware-mcp-instructions/30398>\
**Category:** Feature Requests\
**Tags:** Markdown, API, AI\
**Created:** [March 14, 2026, 11:53pm UTC](https://community.anytype.io/t/community-contributions-anytype-aware-mcp-instructions/30398 "2026-03-14T23:53:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vadymecum](https://community.anytype.io/user_avatar/community.anytype.io/vadymecum/32/26232_2.png) [@vadymecum](https://community.anytype.io/u/vadymecum)\
**Post date:** [March 14, 2026, 11:53pm UTC](https://community.anytype.io/t/community-contributions-anytype-aware-mcp-instructions/30398/1 "2026-03-14T23:53:00Z")

</div>

💡 _Following up on [💙 Community contributions: HTTP transport, Auto-Launch, and AI-assisted space discovery for the MCP server](https://community.anytype.io/t/community-contributions-http-transport-auto-launch-and-ai-assisted-space-discovery-for-the-mcp-server/30378)_

* * *

The previous post introduced three contributions to the MCP server — HTTP transport, auto-launch, and the `discover-spaces` tool — all aimed at making the server more capable and self-sufficient. This one adds a smaller but practically useful feature: loading MCP instructions directly from an Anytype page.

* * *

### The problem with static instructions

The MCP server broadcasts a system prompt to the AI client on every connection, via the `instructions` field in the `initialize` response. By default this is the bundled `instructions.md` — a carefully written document that tells the AI how to use the server correctly: ID resolution rules, mutation tagging, error handling, and so on.

The problem is that `instructions.md` is a static file in the source tree. Customising it means editing source, rebuilding, and redeploying. For power users who have developed their own workspace conventions — space routing rules, per-space object schemas, naming conventions — there was no good place to put this knowledge where the AI could pick it up automatically. It either lived in the bundled file (requiring source edits) or had to be pasted into every chat session manually.

This creates an awkward split: your workspace knowledge lives in Anytype, but your MCP instructions live outside it.

* * *

### The solution: `anytype://` deep links in `MCP_INSTRUCTIONS`

`MCP_INSTRUCTIONS` now accepts an Anytype object deep link:

```auto
MCP_INSTRUCTIONS=anytype://object?objectId=<id>&spaceId=<id>

```

On startup, the server fetches the linked page via the Anytype API, extracts its markdown content, and uses that as the instructions string. The AI client receives it at session start, before any tool call is made.

This means you can maintain your MCP instructions as an ordinary Anytype page — edit it in the app, add internal links to per-space rule pages, use headings and tables. On the next server restart, the updated instructions are live. No source changes, no rebuild.

To get a page’s deep link: open the page → three-dot menu → **Advanced** → **Copy Deeplink**.

### Claude or OpenCode config example

The following snippet can be used to configure a MCP client, such as Claude desktop application, Cursor, or OpenCode:

```json
{
  "mcpServers": {
    "anytype-stdio": {
      "command": "npx",
      "args": ["-y", "@anyproto/anytype-mcp"],
      "env": {
        "OPENAPI_MCP_HEADERS": "{file:~/.config/anytype/openapi-headers.json}",
        "DISCOVERY_TOOL_CONFIG": "{file:~/.config/anytype/discovery.json}",
        "MCP_INSTRUCTIONS": "anytype://object?objectId=bafyreibaml32crstcptvhymnfdem4lejlge3hqe7r75b4le2wd532hvlae&spaceId=bafyreihm362wmhfanonpiahgxya32r4o4ddkib3fljjw453czkcy2qzmve.31e0h928360j5"
      }
    }
  },

```

#### Key Highlightss:

- `OPENAPI_MCP_HEADERS` references an external JSON file with the OpenAPI headers, including auth.
- `DISCOVERY_TOOL_CONFIG` references a configuration file for the Space Discovery tool.
- `MCP_INSTRUCTIONS` references the Anytype page with the root MCP instructions, which are broadcasted to each connecting client and seed the LLM context.

* * *

### How it fits with `discover-spaces`

The two features are complementary. The instructions page sets the behavioural rules for the session. The discovery map provides the workspace snapshot — IDs, types, tags — needed to act on those rules. Together they give the AI client everything it needs from the first two interactions of a session.

* * *

### A practical pattern and workflow

1. The instructions page contains general rules and links to per-space detail pages.
2. The AI reads the root instructions on connect, calls `discover-spaces` to orient itself.
3. The fetched page contains links to other pages with per-space rules.
4. The AI determines which specific link to fetch next depending on the space to work in.

Outcome:

- Context stays lean; nothing irrelevant is loaded upfront.
- The user can create any structure of rules in multiple pages, which cover all practical cases.

* * *

### Fallback behaviour

If the page cannot be fetched — Anytype not running at startup, invalid link, network error — the server falls back to the bundled `instructions.md` and prepends a visible warning block. The AI client sees the warning immediately and can surface it to the user, rather than silently operating on stale or missing instructions.

* * *

### Status

⚠ PR open as draft in the fork repository until the previous PR is merged. Still, you can clone it and try out today. Happy to answer questions or take feedback here.

* * *

### Inspiration

[![](https://community-static.anytype.io/original/3X/f/a/fa168b88634648945202caf7d8c06a89b6de2282.jpeg "Why 2026 Is the Year to Build a Second Brain (And Why You NEED One)") ](https://www.youtube.com/watch?v=0TpON5T-Sw4)

---

<div class="post-metadata">

**Author:** ![AnyFriends](https://community.anytype.io/user_avatar/community.anytype.io/anyfriends/32/19140_2.png) [@AnyFriends](https://community.anytype.io/u/AnyFriends)\
**Post date:** [March 14, 2026, 11:53pm UTC](https://community.anytype.io/t/community-contributions-anytype-aware-mcp-instructions/30398/2 "2026-03-14T23:53:08Z")

</div>

This report has been added to our tracker and received by our team.
