Repository navigation
Description
Out of scope
No implementation of the selected path in this spike; no exemption, allowlist or trusted package for pi-mcp-adapter inside the worker; no weakening of the managed extension refusal (unqualifiedResources, packages/ui-backend-pi/src/native-session-runtime.ts:132-136); no generic provider or public plugin/transport seam; no change to Claude's MCP handling; no live MCP server, credential or network in tests.
Context
Managed Pi turns refuse every loaded extension, pi-mcp-adapter included, because extensions can inject messages or alter provider requests outside the tool-result hooks the input-safety collector observes (packages/ui-backend-pi/README.md:309-330; loadExtensions doc, packages/ui-backend-pi/src/backend-options.ts:119-127). Before that refusal, a third-party MCP tool reached through the adapter raised an approval card like a non-allowlisted MCP tool on Claude (DEFAULT_PI_ALLOWED_TOOLS doc, packages/ui-backend-pi/src/tools.ts:165-177). Disabling extensions restores chat but leaves Pi without MCP.
Claude records every tool, MCP tools included, through PreToolUse/PostToolUse hooks that call inputSafety.begin/result (packages/ui-backend-claude/src/permission-hooks.ts:317-318,695-699). Pi needs an equivalent: each MCP call admitted against the turn's grant and permission policy, and its result recorded by the collector before the model receives it, including cancellation, worker reload and chat resume.
The web-tool precedent is architecture C, host-owned execution behind a constrained bridge (#1863, #2765; docs/plans/host-owned-web-search.md, "Common bridge and governance design" items 1-7). Upstream: pi-mcp-adapter 7.0.1 on npm at the time of filing.
Read ROADMAP.md "What binds future work", docs/decisions/session-safety-reviews.md, docs/decisions/provider-history.md and docs/decisions/governed-writable-workers.md before proposing a shape.
Scope
Produce a reviewed design for restoring MCP tools to ordinary governed and strict Pi workers through a controlled execution path:
- Compare at least: (A) a host-owned MCP client whose tools reach the worker as curated forwarding tools over the existing worker bridge; (B) any path that keeps MCP inside the worker, and what it would need to be recordable. Name the one recommended, with evidence.
- Specify configuration source and ownership (which file or setting declares MCP servers, who may edit it, and why repository-defined configuration does or does not run in a credentialed host context), the permission/approval posture per tool, collector
begin/resultplacement, egress/data-routing/taint/budget application, provider-history stability of the tool roster, and behaviour on cancellation, worker death, reload and resume. - State the contract surfaces the implementation would add (settings, catalog, wire messages) and whether any is breaking.
- File the implementation task(s) under the parent epic with checkable acceptance criteria and a design prompt for any ruling the maintainer must make.
Acceptance criteria
- A
docs/plans/entry compares the options above against the session-safety, provider-history and governed-worker records, citing source, and recommends one. - Every open policy question is listed with options and consequences for a maintainer ruling; recommendation is kept separate from approval.
- Implementation task(s) are filed with acceptance criteria covering admission, recording, cancellation, reload and resume, keyless loopback tests and named mutations, and linked as
Blocked bythis spike where they depend on its ruling. - Any offline prototype used as evidence is keyless, uses fictional Odysseus inputs and is kept outside automatic product CI unless promoted deliberately.
Verification
bun run check:pr --base origin/main for the docs change. Cite exact upstream package versions verified against the npm registry.
Contract impact
None from the spike itself. The design names the additive or breaking surfaces its implementation would introduce.
Activity