Allow named MCP servers in Claude stages

Add validated per-stage MCP allowlists while keeping builtin tools separate. Enable matching Claude Code permission rules only for Claude stages, reject unsupported harnesses, and document the unattended-stage safety model.
This commit is contained in:
2026-11-13 16:06:48 +00:00
parent eeb07e5645
commit b01cfd8eb3
9 changed files with 138 additions and 7 deletions
+5
View File
@@ -59,6 +59,11 @@ blocks; stages communicate through `output.md` (`# handoff`) and `public/`.
`pipelines submit DRAFT` publishes a new immutable version.
`pipelines help <command>` has flags.
Stage `tools` blocks may use `mcp:<server>` or `mcp:<server>/<tool>` for
Claude-only, allowlisted MCP access. Prefer read-only tools; unattended stages
deny every MCP tool not listed. The name is the Claude Code display name
(mapped internally to `mcp__<server>__<tool>`).
## References
Read only what the task needs. Rows marked operator only are for setting up or
+10 -1
View File
@@ -121,7 +121,8 @@ evidence route to `blocked` when declared, else `error`; never fabricate a resul
## Tools and permissions
`tools` lists `read`, `glob`, `grep`, `webfetch`, `websearch`, `edit`, `shell`,
one per line; an empty block denies all and a missing block grants local
or (Claude stages only) `mcp:<server>` / `mcp:<server>/<tool>`, one per line;
an empty block denies all and a missing block grants local
read/glob/grep/edit/shell (prefer explicit). Roles: `plan` reads (web only when
external knowledge is needed); `implement` reads, edits and runs shell; `review`
reads and may use shell for `git diff`, never edits; `land` has read/glob/grep and
@@ -134,6 +135,14 @@ enables a missing one. Empty arrays deny; wildcards, chaining, redirects and
traversal are rejected. With restricted edits and shell enabled, list shell too:
`{"edit":["README.md","plugin/*.qml"],"shell":["bash -n install.sh"]}`.
Named MCP entries are an explicit allowlist for unattended Claude stages:
`mcp:ai-memory` allows that server's tools, while `mcp:linear/list_issues`
allows one tool. Names are the server/tool names Claude Code displays (mapped
internally to `mcp__<server>__<tool>`; claude.ai connectors may look like
`claude_ai_Linear`). Other harnesses reject these entries. Prefer read-only
MCP tools; server configuration is not inspected during validation, so an
unknown name may fail at runtime.
## Checks
Every model stage that can modify the workspace (`edit` or `shell`, no `tools`
@@ -44,3 +44,9 @@ OS sandbox: approved shell can have broad side effects. Usage accumulates across
attempts and visits; missing required accounting fails closed. Session/RPC audit
lives in the execution user's cache under `pipelines/pi-sessions`; unconfirmed
cleanup blocks continuation and retry.
Claude stages may additionally allow named MCP servers/tools in the `tools`
block. These are Claude-only, exact allowlist entries; other MCP tools remain
denied in unattended `dontAsk` sessions. Use `mcp:<server>` or
`mcp:<server>/<tool>` with names as Claude Code displays them, and prefer
read-only tools.