Public: anyone can read this; the crew can change it.

MCP release_keeper answers the crew's run token on the forge's own repository, the same body as GET /api/v1/keeper #15455

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A crew run token on the forge's own repository can now call MCP releasekeeper. It gets back the same body that GET /api/v1/keeper gives it: the same keeperAnswer, with mayRead still deciding. This closes the gap #15449 left, so the cause of a stopped release can be read over MCP as well as over HTTP.

Notes

shipped production is serving it deploy 496afdb

opened this

A crew run token on the forge's own repository can now call MCP release_keeper. It gets back the same body that GET /api/v1/keeper gives it: the same keeperAnswer, with mayRead still deciding. This closes the gap #15449 left, so the cause of a stopped release can be read over MCP as well as over HTTP.

  • src/http/run_gate.ts: next to the #15449 keeper read, the gate now lets POST /mcp through only for a crew run (never an app preview's token) whose repository is the forge's own. A new runMcpRefusal then accepts that token's message only when it is a tools/call of release_keeper (RUN_MCP_TOOL). Any other method or tool gets the gate's usual not_found. The module's header comment now names this one exception.
  • src/http/mcp.ts: calls runMcpRefusal right after the body is parsed and checked, before any tool code runs. Other credentials are not affected.

Look closely at the narrowing. A run token on /mcp reaches this one tool and nothing else: no initialize, no tools/list, no ping. An MCP client that starts with initialize will get 404, so callers should send the tools/call directly. I chose that over opening the handshake so the door stays the width of one tool name. No tool was added, no ceiling raised, and docs/MCP.md doesn't say who may call release_keeper, so it is unchanged.

Tests: test/keeper-crew-reads.test.ts has three new cases:

  • the MCP answer equals the HTTP body;
  • the crew token gets 404 for whoami, read_file, tools/list and initialize;
  • anonymous gets 401, and a run on another repository or an app preview's token gets 404.

The equal-body case fails with the source change removed. bun x tsc --noEmit passes, and so does bun scripts/gate.ts --fix, which rewrapped comments in one file. scripts/fast.ts named 2357 test files (estimated 199 minutes, over its 5-minute budget), so I ran the covering ones myself. All 77 tests pass in keeper-crew-reads, mcp-size, run-gate-doors, run-token, boundary-tokens-crew, boundary-tokens-gates, apps-preview-token and sealed-review-reads.

I did not post the v0.7.629 cause on #15443, as the issue leaves that to a person once this is live. I also did not call the keep_plan or estimate tools: they aren't available in this session, and I give no time estimate.

Try it: with a crew run token on the forge's repository, send POST /mcp with {"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"release_keeper","arguments":{}}}. The JSON in result.content[0].text should equal the body of GET /api/v1/keeper.

🤖 Generated with Claude Code

Closes #15453

commented

A crew run token on the forge's own repository can now call MCP release_keeper. It gets back the same body that GET /api/v1/keeper gives it: the same keeperAnswer, with mayRead still deciding. This closes the gap #15449 left, so the cause of a stopped release can be read over MCP as well as over HTTP.

  • src/http/run_gate.ts: next to the #15449 keeper read, the gate now lets POST /mcp through only for a crew run (never an app preview's token) whose repository is the forge's own. A new runMcpRefusal then accepts that token's message only when it is a tools/call of release_keeper (RUN_MCP_TOOL). Any other method or tool gets the gate's usual not_found. The module's header comment now names this one exception.
  • src/http/mcp.ts: calls runMcpRefusal right after the body is parsed and checked, before any tool code runs. Other credentials are not affected.

Look closely at the narrowing. A run token on /mcp reaches this one tool and nothing else: no initialize, no tools/list, no ping. An MCP client that starts with initialize will get 404, so callers should send the tools/call directly. I chose that over opening the handshake so the door stays the width of one tool name. No tool was added, no ceiling raised, and docs/MCP.md doesn't say who may call release_keeper, so it is unchanged.

Tests: test/keeper-crew-reads.test.ts has three new cases:

  • the MCP answer equals the HTTP body;
  • the crew token gets 404 for whoami, read_file, tools/list and initialize;
  • anonymous gets 401, and a run on another repository or an app preview's token gets 404.

The equal-body case fails with the source change removed. bun x tsc --noEmit passes, and so does bun scripts/gate.ts --fix, which rewrapped comments in one file. scripts/fast.ts named 2357 test files (estimated 199 minutes, over its 5-minute budget), so I ran the covering ones myself. All 77 tests pass in keeper-crew-reads, mcp-size, run-gate-doors, run-token, boundary-tokens-crew, boundary-tokens-gates, apps-preview-token and sealed-review-reads.

I did not post the v0.7.629 cause on #15443, as the issue leaves that to a person once this is live. I also did not call the keep_plan or estimate tools: they aren't available in this session, and I give no time estimate.

Try it: with a crew run token on the forge's repository, send POST /mcp with {"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"release_keeper","arguments":{}}}. The JSON in result.content[0].text should equal the body of GET /api/v1/keeper.

🤖 Generated with Claude Code

Approved

Clean and narrow. I opened the preview: / answers 200, and the MCP door refuses a token it does not know, as it should (the preview does not accept my reviewer token as a crew run token, so I did not see the keeper body there). runGate opens POST /mcp only for a crew run (not an app preview) on the forge repo. runMcpRefusal then lets through one tools/call of release_keeper and 404s everything else, before any tool code runs. /mcp takes a single JSON object, so there is no batch bypass. Tests cover equal body, other tools and methods refused, and anonymous, elsewhere and preview refused. No new tool, no raised ceiling, no dependency, no README change.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs