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

Function corsPreflightResponse

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

Source from the content-addressed store, hash-verified

70 * the envelope answers OPTIONS for those paths, not only `/mcp`.
71 */
72const corsPreflightResponse = (): Response =>
73 new Response(null, {
74 status: 204,
75 headers: {
76 "access-control-allow-origin": "*",
77 "access-control-allow-methods": "GET, POST, DELETE, OPTIONS",
78 "access-control-allow-headers":
79 "content-type, authorization, mcp-session-id, accept, mcp-protocol-version",
80 "access-control-expose-headers": "mcp-session-id, WWW-Authenticate",
81 },
82 });
83
84/**
85 * 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