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

Function openGet

e2e/cloud/mcp-sse-replay.test.ts:201–221  ·  view source on GitHub ↗
(
  mcpUrl: string,
  bearer: string,
  sessionId: string,
  lastEventId?: string,
)

Source from the content-addressed store, hash-verified

199}
200
201const openGet = async (
202 mcpUrl: string,
203 bearer: string,
204 sessionId: string,
205 lastEventId?: string,
206): Promise<SseCapture> => {
207 const abortController = new AbortController();
208 const response = await fetch(mcpUrl, {
209 method: "GET",
210 headers: {
211 accept: "text/event-stream",
212 authorization: `Bearer ${bearer}`,
213 "mcp-protocol-version": PROTOCOL_VERSION,
214 "mcp-session-id": sessionId,
215 ...(lastEventId ? { "last-event-id": lastEventId } : {}),
216 },
217 signal: abortController.signal,
218 });
219 expect(response.status, "GET SSE opens").toBe(200);
220 return new SseCapture(response, abortController);
221};
222
223const startPostCapture = async (
224 mcpUrl: string,

Callers 1

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected