MCPcopy Create free account
hub / github.com/modelcontextprotocol/typescript-sdk / initializeServer

Function initializeServer

test/server/streamableHttp.test.ts:259–266  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

257 });
258
259 async function initializeServer(): Promise<string> {
260 const response = await sendPostRequest(baseUrl, TEST_MESSAGES.initialize);
261
262 expect(response.status).toBe(200);
263 const newSessionId = response.headers.get('mcp-session-id');
264 expect(newSessionId).toBeDefined();
265 return newSessionId as string;
266 }
267
268 it('should initialize server and generate session ID', async () => {
269 const response = await sendPostRequest(baseUrl, TEST_MESSAGES.initialize);

Callers 1

Calls 3

sendPostRequestFunction · 0.85
reqFunction · 0.85
handleRequestMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…