[ docs · guides ]

The MCP gateway

Grist serves its skills and its verified memory over MCP (Model Context Protocol), so any MCP client can draw on what the team has proven, under the same rules that govern Grist’s own runs. There are two endpoints with one surface: a local one on your machine, and a team endpoint hosted on the gateway.

The two endpoints

grist mcp serve                          # local endpoint, stdio
grist mcp serve --transport http --port 8931   # local endpoint, streamable HTTP on loopback
claude mcp add grist-skills -- grist mcp serve # the wiring it prints for a local client

The local endpoint serves this machine’s team sync state. The team endpoint (POST /v1/mcp on the gateway) serves the same surface from gateway state, for hosted agents and other machines. The local endpoint treats the machine’s owner as the caller; the team endpoint has no anonymous caller at all. State is re-read per request on both.

What is served

SurfaceWhat the caller gets
Skills (resources & prompts)The team’s skills at the versions the caller’s repo has pinned (branch label included), filtered by the caller’s access. A skill the caller may not see is absent from the listing, not just unreadable.
memory_recallVerified memory only. Attested material is never served here, and failed checks are not lessons.
failed_approachesThe recorded dead ends, with the evidence and the run that proved them, so a caller does not repeat them.
code_map_getThe shared code map snapshot, with its commit and a staleness judgement against the current HEAD.
filesystem_readTeam filesystem objects, access-filtered the same way: concealed objects read as plain “not found”.
outcome_proposeA proposal, not a write. Grist grades it through the same outcome machinery as an actor run (see Actors). No argument a caller can pass writes a verified lesson directly.
inbox_parkParks a cross-boundary action in the approvals inbox for a human decision. Anything outside the fixed boundary list (send, deploy, spend, write outside the environment) is refused as out of scope, and with no gateway configured the call fails closed: the action has not been taken.

Run-scoped tokens

A standing account key is a person’s credential. An agent run gets something narrower: a run-scoped token.

grist mcp token mint              # shown exactly once; only its hash is stored
grist mcp token list
grist mcp token end <id>
grist mcp token mint --gateway    # mint at the team endpoint, for a hosted run

One honest limit: Grist does not inject the token into a spawned agent’s own MCP configuration, because that configuration belongs to the agent’s setup. For an MCP-only agent, minting a token with the commands above is the operator’s step.

Brokered upstream servers

Other MCP servers join the same surface by registering once as a team filesystem object of kind mcp_server:

grist team-objects publish search-server.json --kind mcp_server
grist mcp upstream list
grist mcp upstream ack <server> <tool>   # resume a paused tool (below)

Grading at the team endpoint

The gateway holds no checkout and runs no tests on a hosted caller’s machine, so a hosted outcome_propose lands exactly two ways: a reported failure is recorded at full strength as a failed approach, and a reported success lands attested, in a store of its own, no matter what grade the caller claims. Verified lessons reach team memory only through the harness’s own push path, where Grist did the checking itself.

Audit

Every call writes exactly one audit row: the caller (local owner or token id), the actor and run where known, the tool and server, the effects class, a hash of the arguments with a redacted summary of their shape, the status, and the duration. Argument bodies are never stored. Token mints and ends are audited too.

The dashboard’s MCP view shows the registered servers and their description state, the connected clients and live tokens, and the call audit. See Actors for the runs these tokens usually belong to, and Skills for how skills are authored.