Skip to content

Commit 29ae6b8

Browse files
committed
appying suggested changes
1 parent 9e60411 commit 29ae6b8

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/examples/client/streamableHttpWithSseFallbackClient.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,15 @@ async function connectWithBackwardsCompatibility(url: string): Promise<{
109109
try {
110110
// Create SSE transport pointing to /sse endpoint
111111
const sseTransport = new SSEClientTransport(baseUrl);
112-
await client.connect(sseTransport);
112+
const sseClient = new Client({
113+
name: 'backwards-compatible-client',
114+
version: '1.0.0'
115+
});
116+
await sseClient.connect(sseTransport);
113117

114118
console.log('Successfully connected using deprecated HTTP+SSE transport.');
115119
return {
116-
client,
120+
client: sseClient,
117121
transport: sseTransport,
118122
transportType: 'sse'
119123
};

src/examples/server/sseAndStreamableHttpCompatibleServer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { CallToolResult, isInitializeRequest, JSONRPCMessage } from '../../types
1414
* It maintains a single MCP server instance but exposes two transport options:
1515
* - /mcp: The new Streamable HTTP endpoint (supports GET/POST/DELETE)
1616
* - /sse: The deprecated SSE endpoint for older clients (GET to establish stream)
17-
* - /request: The deprecated POST endpoint for older clients (POST to send messages)
17+
* - /messages: The deprecated POST endpoint for older clients (POST to send messages)
1818
*/
1919

2020
// Simple in-memory event store for resumability
@@ -288,10 +288,10 @@ SUPPORTED TRANSPORT OPTIONS:
288288
- Terminate session with DELETE to /mcp
289289
290290
2. Http + SSE (Protocol version: 2024-11-05)
291-
Endpoints: /sse (GET) and /request (POST)
291+
Endpoints: /sse (GET) and /messages (POST)
292292
Usage:
293293
- Establish SSE stream with GET to /sse
294-
- Send requests with POST to /message?sessionId=<id>
294+
- Send requests with POST to /messages?sessionId=<id>
295295
==============================================
296296
`);
297297
});

0 commit comments

Comments
 (0)