Skip to content

Commit 9db5b83

Browse files
committed
fix sse examples
1 parent 3f95b76 commit 9db5b83

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/examples/server/simpleSseServer.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ app.get('/mcp', async (req: Request, res: Response) => {
102102
const server = getServer();
103103
await server.connect(transport);
104104

105-
// Start the SSE transport to begin streaming
106-
// This sends an initial 'endpoint' event with the session ID in the URL
107-
await transport.start();
108-
109105
console.log(`Established SSE stream with session ID: ${sessionId}`);
110106
} catch (error) {
111107
console.error('Error establishing SSE stream:', error);

src/examples/server/sseAndStreamableHttpCompatibleServer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ app.post("/messages", async (req: Request, res: Response) => {
194194
return;
195195
}
196196
if (transport) {
197-
await transport.handlePostMessage(req, res);
197+
await transport.handlePostMessage(req, res, req.body);
198198
} else {
199199
res.status(400).send('No transport found for sessionId');
200200
}

0 commit comments

Comments
 (0)