You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Request]: Origin allowlist and MCP-Protocol-Version check for @jimhoyd/urlcode-mcp mounts #676
bugSomething isn't workingextensionInvolves an extension or companion package (store, ui, auth, admin)importantHigh-priority work selected for near-term focus
@jimhoyd/urlcode-mcp 0.6.0 (packages/mcp/src/mcp.ts, handle()) checks method, content type, body size and the JSON-RPC envelope, but never reads the Origin header. The MCP Streamable HTTP transport says servers MUST validate Origin on incoming connections to prevent DNS-rebinding attacks. An operator can't do this in YAML today, because the mount has no origin setting and no hook runs before dispatch.
It also doesn't validate the MCP-Protocol-Version request header. The spec says a server should answer 400 Bad Request for an unsupported version, and treat a missing header as 2025-03-26.
urlcode-ai's hand-written /mcp (functions/mcp.mjs) does both checks: MCP_ALLOWED_ORIGINS returns 403, and an unsupported version returns 400. That makes these checks a blocker for switching https://urlcode.ai/mcp to the extension: switching would drop a spec-required protection from a public endpoint.
Proposed behavior and alternatives
A per-server allowedOrigins: [..] in the extension config. A request whose Origin isn't listed gets 403 before any parsing. A request with no Origin header (non-browser clients) is allowed, as it is today.
Validate MCP-Protocol-Version against the versions the extension negotiates, with a missing header treated as 2025-03-26. Answer 400 otherwise.
Alternative: a general core route option for Origin allowlisting that any extension mount can use. That's more reusable, but MCP is the one surface where the spec requires it.
bugSomething isn't workingextensionInvolves an extension or companion package (store, ui, auth, admin)importantHigh-priority work selected for near-term focus
Activity
fix(mcp): validate Origin and MCP-Protocol-Version; document the exac…