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

Function mcpPost

e2e/cloud/mcp-session-cold-init.test.ts:78–97  ·  view source on GitHub ↗
(
  url: string,
  init: {
    readonly bearer: string;
    readonly sessionId?: string;
    readonly traceparent?: string;
    readonly body: unknown;
  },
)

Source from the content-addressed store, hash-verified

76};
77
78const 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
99scenario(
100 "MCP session cold init · the org identity rides in the session props instead of a second Postgres read",

Callers 1

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected