Repository navigation
fix(claw-server): allow Electron Fetch metadata - #2925
Serg Baburin (gmist) wants to merge 1 commit into
Conversation
|
PR author is not in the allowed authors list. |
|
All contributors have signed the CLA. Thank you! |
There was a problem hiding this comment.
Graphify reviewed this change.
Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.
Not checked: tests were not run; formal verification proved 0 of 1 changed function(s) (1 not verified).
Formal verification. PR-changed functions: 0/1 verified (0 proven, 0 may-equivalent, 0 distinguished) · 1 not verified (1 unsupported).
Not verified on this run: mcp\_request\_hygiene (unsupported).
Graphify review — findings
Loosens the loopback /mcp guard so mcp_request_hygiene rejects a request only when it carries an Origin header, and no longer treats Sec-Fetch-Site as a browser signal. Electron-based MCP clients such as Cherry Studio send browser-default Sec-Fetch-* metadata and were being rejected with 403 as a result. The trade-off is that an Origin-less request marked cross-site now reaches /mcp, so the Origin check is the only remaining browser-page gate. Updates the route test and the claw-mcp contract case to pin the new behaviour: Origin still returns 403, while initialize with Sec-Fetch-* headers returns 200 and the expected server info.
Worth a look
- Removing the Sec-Fetch-Site check lets Origin-less cross-site GETs reach /mcp —
packages/browseros-agent/apps/claw-server/src/api/http/mod.rs:155· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 142 functions depend on the 94 functions this change touches.
Health — grade A; 10 existing hotspot(s) in the area this change touches (pre-existing, not introduced here):
createApiRoutes()— 3 callers, 20 callees (high)createMcpRoutes()— 7 callers, 5 callees (medium)registerKlavisTools()— 2 callers, 10 callees (medium)initialize_mcp()— 5 callers, 3 callees (medium)createHttpServer()— 2 callers, 6 callees (medium)ensureRun()— 1 callers, 9 callees (medium)canonical_cancel_endpoint_aborts_in_flight_dispatch()— 0 callers, 7 callees (medium)mcp_session_naming_appends_five_tips_without_elicitation()— 0 callers, 7 callees (medium)- …and 2 more
Verification — 142 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 125 function(s) in the blast radius were not formally verified this run
Formal verification
Could not verify: Could not verify mcp\_request\_hygiene.
The verifier did not have enough to check mcp\_request\_hygiene, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: unsupported return type: Response
|
I have read the CLA Document and I hereby sign the CLA |
What this changes
Allows Electron-based MCP clients to connect to the Neo
/mcpendpoint when they sendSec-Fetch-*headers.Requests with an
Originheader remain blocked.Why
Electron automatically adds
Sec-Fetch-Site,Sec-Fetch-Mode, andSec-Fetch-Destheaders. BrowserOS Neo previously rejected these requests with403 unsupported request, preventing clients such as Cherry Studio from connecting. Fixes #2458.How to check it
The regression test verifies that:
Before you request review