Features Apograph CMS on GitHub

MCP plugin

One endpoint, one credential, and the same authority an API token already has.

Documents 0.5.2 Updated Edit this page Report a problem

On this page

The Model Context Protocol front door. An external agent connects to it with an API token and drives content CRUD through the same tools the CMS defines internally.

It owns the protocol and nothing else — the endpoint, bearer auth, workspace resolution and JSON-RPC dispatch. The tool registry lives in @apograph/tools-server and is shared with the copilot, which is what stops the two surfaces drifting into different implementations of the same tool.

Install

npm install @apograph/mcp-server

Register

import { McpPlugin } from '@apograph/mcp-server';

McpPlugin({ config: config.plugins.mcp });

Register it last. It serves whatever the plugins above it contributed, so anything registered after it is invisible to an agent.

Environment

VariableDefaultWhat it does
MCP_ENABLEDfalseThe kill switch. Off, /api/v1/mcp answers 404
MCP_CALL_TIMEOUT_MS30000Ceiling on one tools/call
MCP_MAX_RESULT_BYTES4194304Ceiling on one result

On, it hands an agent what a full-scope token has

An external agent reaching this endpoint can do the content CRUD the token it presents is scoped for. That is the whole point of it, and it is why it is off unless somebody says otherwise.

Scope the tokens you issue for it. See API tokens.

The call timeout is not optional tuning. A request/response transport owes its caller an answer and the tool registry has no deadline of its own, so without it the only bound on a call is the query underneath it — and a blocked pool turns one call into a socket held until the client gives up.

What it exposes

Content tools served here are declared for the mcp surface: they read the public API’s published-only services and attribute writes to the token, which is right for an external agent and wrong for the chat panel.

A few tools name no surface and are offered to both — the locale list and three media reads. A change to one of those changes what this endpoint exposes, even if you did not write it.

See MCP for connecting a client, and agent tools for adding a tool and choosing its surfaces deliberately.