Skip to content

fix(claw-server): allow Electron Fetch metadata - #2925

Open
Serg Baburin (gmist) wants to merge 1 commit into
browseros-ai:mainfrom
gmist:fix_rejects_electron_2458
Open

Serg Baburin (gmist) wants to merge 1 commit into
browseros-ai:mainfrom
gmist:fix_rejects_electron_2458

Conversation

@gmist

Copy link
Copy Markdown

What this changes

Allows Electron-based MCP clients to connect to the Neo /mcp endpoint when they send Sec-Fetch-* headers.
Requests with an Origin header remain blocked.

Why

Electron automatically adds Sec-Fetch-Site, Sec-Fetch-Mode, and Sec-Fetch-Dest headers. BrowserOS Neo previously rejected these requests with 403 unsupported request, preventing clients such as Cherry Studio from connecting. Fixes #2458.

How to check it

The regression test verifies that:

  • requests with Origin return 403;
  • requests with Electron-style Sec-Fetch-* headers return 200.

Before you request review

  • Ran the checks for the path you touched (see CONTRIBUTING.md)
  • Added or updated tests where the behaviour changed
  • Checked this on the platforms it affects

@greptile-apps

greptile-apps Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA. Thank you!
Posted by the CLA Assistant Lite bot.

@graphify-labs graphify-labs Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@gmist

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Neo MCP rejects Electron clients with Fetch Metadata headers

1 participant