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

Function mcp

apps/host-selfhost/src/mcp/mcp.test.ts:61–73  ·  view source on GitHub ↗
(token: string, body: unknown, sessionId?: string, browser = false)

Source from the content-addressed store, hash-verified

59};
60
61const mcp = (token: string, body: unknown, sessionId?: string, browser = false) =>
62 handler(
63 new Request(`${BASE}/mcp${browser ? "?elicitation_mode=browser" : ""}`, {
64 method: "POST",
65 headers: {
66 authorization: `Bearer ${token}`,
67 "content-type": "application/json",
68 accept: "application/json, text/event-stream",
69 ...(sessionId ? { "mcp-session-id": sessionId } : {}),
70 },
71 body: JSON.stringify(body),
72 }),
73 );
74
75const initSession = async (token: string, browser = false): Promise<string> => {
76 const res = await mcp(

Callers 3

initSessionFunction · 0.70
mcp.test.tsFile · 0.70
makeAuthOptionsFunction · 0.50

Calls 1

handlerFunction · 0.50

Tested by

no test coverage detected