[ 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
| Surface | What 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_recall | Verified memory only. Attested material is never served here, and failed checks are not lessons. |
failed_approaches | The recorded dead ends, with the evidence and the run that proved them, so a caller does not repeat them. |
code_map_get | The shared code map snapshot, with its commit and a staleness judgement against the current HEAD. |
filesystem_read | Team filesystem objects, access-filtered the same way: concealed objects read as plain “not found”. |
outcome_propose | A 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_park | Parks 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
- Scope: one container, one conversation, one run, and the six tools or a subset of them. A token can only narrow what its owner could see, never widen it: other containers read as empty, and skills listings shrink to the token’s container.
- Lifetime: 60 minutes by default, or the end of the run, whichever comes first. The actor run spine mints at run start and ends the token when the process finishes.
- Enforcement: the token is re-verified on every request, on HTTP and stdio alike. An expired, ended, or malformed token is refused before any method runs, including mid-session.
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)
- Names, never values. A registration declares credential environment variable names only. A registration carrying an actual secret value is rejected at publish. Values are resolved on the machine doing the brokering, at call time, and never stored in the gateway or the object store. The team endpoint brokers remote servers only; it never spawns local processes.
- Namespaced tools. Upstream tools are served beside Grist’s own as
<server>__<tool>, with audit rows in the same shape. - Conservative classification. A tool’s effects class comes from its registration when declared. Undeclared tools are classified from their name and description, worst plausible reading first: money words mean spend, release words mean deploy, message words mean send, and no signal at all means write. Undeclared tools are marked as undeclared in listings.
- Cross-boundary calls park. A brokered call whose class crosses a boundary (write outside the environment, send, deploy, spend) parks in the inbox instead of executing, for token callers and local callers alike: the local endpoint cannot tell an attended call from an unattended one, so it does not guess.
- Description changes pause the tool. Tool descriptions are prompt surface, so Grist hashes what it first saw. If a description changes, that tool stays listed with a paused note, its calls refuse, and the change shows in the dashboard. A human resumes it with
grist mcp upstream ack, which re-baselines the description and writes an audit row. There is deliberately no dashboard acknowledge button: the state being acknowledged lives on the brokering machine, so the action does too. - Policy can deny. Team actor policy can deny a named server, a named tool, or a whole effects class per container. A denied tool is not listed for that container’s callers and is refused on a direct call.
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.