From ad51fd0f5b472a20620d7828cd5373196c35ee56 Mon Sep 17 00:00:00 2001 From: simonedstrom96 <42982214+simonedstrom96@users.noreply.github.com> Date: Tue, 22 Apr 2025 17:59:10 +0200 Subject: [PATCH] Update README.md to include working examples The current documentation contains code that will cause errors, they should be fixed. --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index e0d68909..6de175f6 100644 --- a/README.md +++ b/README.md @@ -242,7 +242,6 @@ app.post('/mcp', async (req, res) => { transport = transports[sessionId]; } else if (!sessionId && isInitializeRequest(req.body)) { // New initialization request - const eventStore = new InMemoryEventStore(); transport = new StreamableHTTPServerTransport({ sessionIdGenerator: () => randomUUID(), onsessioninitialized: (sessionId) => { @@ -815,7 +814,7 @@ app.post('/messages', async (req, res) => { const sessionId = req.query.sessionId as string; const transport = transports.sse[sessionId]; if (transport) { - await transport.handlePostMessage(req, res); + await transport.handlePostMessage(req, res, req.body); } else { res.status(400).send('No transport found for sessionId'); }