Repository navigation
Migrate Frontman to MCP 2026-07-28 - #1392
BlueHotDog wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
frontman/libs/frontman-client/src/FrontmanClient__Relay.res
Lines 94 to 95 in 00272b1
When the connected framework registry contains an internal tool such as load_agent_instructions (visibleToAgent = false), this maps every relay tool into the MCP catalog while dropping that visibility policy. The Phoenix side consequently defaults the tool to visible and exposes it to normal agents; filter tools by visibleToAgent before serialization instead of removing the policy without enforcing it.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let definition = dict{ | ||
| "name": JSON.Encode.string(T.name), | ||
| "description": JSON.Encode.string(T.description), | ||
| "access": T.access->S.decodeOrThrow(~from=ToolTypes.accessSchema, ~to=S.json), | ||
| "inputSchema": T.inputSchema->S.toJSONSchema->jsonSchemaAsJson, | ||
| "visibleToAgent": JSON.Encode.bool(T.visibleToAgent), | ||
| "executionMode": T.executionMode->S.decodeOrThrow(~from=executionModeSchema, ~to=S.json), | ||
| } |
There was a problem hiding this comment.
Preserve read access in standard annotations
When the planner runs with %{access: [:read]}, every browser MCP tool serialized here is later parsed by FrontmanServer.Tools.MCP.from_map/1 with the default :read_write access, so read-only tools such as get_dom, take_screenshot, and search_text are filtered out in Tasks.Execution.run/7. Map the internal access value to the standard annotations.readOnlyHint field and restore it when constructing the server-side tool policy.
Useful? React with 👍 / 👎.
| when is_binary(type) and is_list(versions) and is_map(capabilities) and is_integer(ttl) and | ||
| ttl >= 0 and scope in ["private", "public"] -> |
There was a problem hiding this comment.
Reject unsupported result discriminators
When a peer returns resultType: "input_required" or an unknown extension value while also including the discovery fields, this guard accepts it as a completed discovery result and MCPInitializer proceeds without satisfying the requested input; the identical issue exists in the tools/list guard below. Since this runtime only implements complete results, require resultType == "complete" and reject every unsupported discriminator rather than accepting any string.
Useful? React with 👍 / 👎.
| | Ok({taskId, toolCallId}) => | ||
| try { | ||
| let {serverInterface} = handler | ||
| let result = await serverInterface.executeTool( | ||
| serverInterface.server, | ||
| ~name=request.params.name, | ||
| ~arguments=request.params.arguments, | ||
| ~taskId, | ||
| ~toolCallId, |
There was a problem hiding this comment.
Verify execution context ownership before running tools
When a tools/call message on one task channel supplies another task's taskId or an unrelated toolCallId, this code immediately passes those peer-controlled identifiers into tool execution without any ownership, existence, replay, or channel-binding check. Task-aware tools such as question can therefore mutate the wrong task, and image-reference resolution can read another task's context; retain the channel's session identity and validate both durable identifiers before invoking executeTool.
Useful? React with 👍 / 👎.
e118654 to
ef79d58
Compare
Summary
2026-07-28contract, removing the initialization handshake, protocol sessions, private Relay fallback, and deprecated HTTP+SSE transportPOST /mcpservers for Next.js, Astro, Vite, and WordPress plus the browser Streamable HTTP client$defsbundle while preserving all 75 stable per-schema filenames as small$refentry pointsDiff Reduction
77,079to52,80928,641lines to approximately3,800Verification
828/828; focused cross-language schema contracts pass27/27frontman-clientpasses170/170;frontman-corepasses483/483; application client passes334/334git diff --check, and pre-push ReScript dead-code gates passmake mcp-verifyand installed Next.js/Astro/Vite/Vue-Vite E2E11/11are accepted evidence5173; the four recovery scenarios therefore never reached their fixture/mcpendpoints. The post-E2E source and generated checks were run directly and pass. No product or schema failure was observed in that contaminated rerunDisclosed Limits
BASE-AUTH-001is an explicitly accepted application-authentication SHOULD deviation; Frontman does not implement or claim MCP OAuth conformanceRelease Status
The implementation phases are accepted, but this PR does not authorize publishing. Remaining release work includes final README/architecture/integration/marketing and breaking-migration review, credential rotation, and final security, package, version, and publishing checks.