(
url: string,
init: {
readonly bearer: string;
readonly sessionId?: string;
readonly traceparent?: string;
readonly body: unknown;
},
)
| 76 | }; |
| 77 | |
| 78 | const mcpPost = ( |
| 79 | url: string, |
| 80 | init: { |
| 81 | readonly bearer: string; |
| 82 | readonly sessionId?: string; |
| 83 | readonly traceparent?: string; |
| 84 | readonly body: unknown; |
| 85 | }, |
| 86 | ): Promise<Response> => |
| 87 | fetch(url, { |
| 88 | method: "POST", |
| 89 | headers: { |
| 90 | accept: JSON_AND_SSE, |
| 91 | "content-type": "application/json", |
| 92 | authorization: `Bearer ${init.bearer}`, |
| 93 | ...(init.sessionId ? { "mcp-session-id": init.sessionId } : {}), |
| 94 | ...(init.traceparent ? { traceparent: init.traceparent } : {}), |
| 95 | }, |
| 96 | body: JSON.stringify(init.body), |
| 97 | }); |
| 98 | |
| 99 | scenario( |
| 100 | "MCP session cold init · the org identity rides in the session props instead of a second Postgres read", |
no test coverage detected