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

Function corsPreflightResponse

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

Source from the content-addressed store, hash-verified

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