diff --git a/src/client/index.ts b/src/client/index.ts index b664ead..7748a97 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -110,13 +110,15 @@ export class MCPClient { const initializeResponse = await this.sendRequest(initializeRequest); if (isJSONRPCError(initializeResponse)) { - throw new Error(`Initialization failed: ${initializeResponse.error.message}`); + throw new Error( + `Initialization failed: ${initializeResponse.error.message}` + ); } // 2. Send notifications/initialized message (notification - no response expected) const initializedNotification = newJSONRPCRequest({ id: this.requestId, - method: "notifications/initialized" + method: "notifications/initialized", }); this.sendNotification(initializedNotification); @@ -281,7 +283,9 @@ export class MCPClient { return new Promise((resolve, reject) => { // Add request to pending map before sending this.pendingRequests.set(request.id, { resolve, reject }); - this.logger.debug(`sendRequest: ${JSON.stringify(request)} with id ${request.id}`); + this.logger.debug( + `sendRequest: ${JSON.stringify(request)} with id ${request.id}` + ); this.transport?.send(request).catch((err) => { this.pendingRequests.delete(request.id); diff --git a/src/transport/httpclient.ts b/src/transport/httpclient.ts index bc35b68..8f6fabc 100644 --- a/src/transport/httpclient.ts +++ b/src/transport/httpclient.ts @@ -90,7 +90,7 @@ export class HTTPClientTransport implements Transport { throw new Error(`HTTP ${response.status}: ${response.statusText}`); } - // Capture session ID from response headers if present + // Capture session ID from response headers if present // (https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#session-management) const responseSessionId = response.headers.get("Mcp-Session-Id"); if (responseSessionId && !this.sessionId) {