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

Function initializeServer

test/server/sse.test.ts:156–175  ·  view source on GitHub ↗
(baseUrl: URL)

Source from the content-addressed store, hash-verified

154
155 describe('SSEServerTransport', () => {
156 async function initializeServer(baseUrl: URL): Promise<void> {
157 const response = await sendSsePostRequest(baseUrl, {
158 jsonrpc: '2.0',
159 method: 'initialize',
160 params: {
161 clientInfo: { name: 'test-client', version: '1.0' },
162 protocolVersion: '2025-03-26',
163 capabilities: {}
164 },
165
166 id: 'init-1'
167 } as JSONRPCMessage);
168
169 expect(response.status).toBe(202);
170
171 const text = await readAllSSEEvents(response);
172
173 expect(text).toHaveLength(1);
174 expect(text[0]).toBe('Accepted');
175 }
176
177 describe('start method', () => {
178 it('should correctly append sessionId to a simple relative endpoint', async () => {

Callers 1

sse.test.tsFile · 0.70

Calls 2

sendSsePostRequestFunction · 0.85
readAllSSEEventsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…