MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / corsPreflightResponse

Function corsPreflightResponse

packages/hosts/mcp/src/envelope.ts:55–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53 * the envelope answers OPTIONS for those paths, not only `/mcp`.
54 */
55const corsPreflightResponse = (): Response =>
56 new Response(null, {
57 status: 204,
58 headers: {
59 "access-control-allow-origin": "*",
60 "access-control-allow-methods": "GET, POST, DELETE, OPTIONS",
61 "access-control-allow-headers":
62 "content-type, authorization, mcp-session-id, accept, mcp-protocol-version",
63 "access-control-expose-headers": "mcp-session-id, WWW-Authenticate",
64 },
65 });
66
67/**
68 * The canonical JSON-RPC error `Response` builder for every MCP serving site.

Callers 2

mcpDispatchFunction · 0.70
envelope.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected