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

Function call

packages/hosts/mcp/src/in-memory-session-store.test.ts:196–214  ·  view source on GitHub ↗
(id: number, role: "admin" | "member")

Source from the content-addressed store, hash-verified

194 const admin = { ...TEST_PRINCIPAL, orgRole: "admin" as const };
195 const sessionId = await openSession(sessions, admin);
196 const call = (id: number, role: "admin" | "member") =>
197 Effect.runPromise(
198 sessions.store.dispatch({
199 request: new Request("https://executor.test/mcp", {
200 method: "POST",
201 headers: { ...MCP_POST_HEADERS, "mcp-session-id": sessionId },
202 body: JSON.stringify({
203 jsonrpc: "2.0",
204 id,
205 method: "tools/call",
206 params: { name: "execute", arguments: { code: role } },
207 }),
208 }),
209 principal: { ...admin, orgRole: role },
210 resource: defaultMcpResource,
211 sessionId,
212 method: "POST",
213 }),
214 ) as Promise<Response>;
215
216 // Start the demoted member first, then let a stale admin request overlap it.
217 // A session-global cell ends this interleaving at "allowed" and incorrectly

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected