From 2aa697ceda78ab4286820399016e91cf97bdeb9a Mon Sep 17 00:00:00 2001 From: Sahar Shemesh <48128579+saharis9988@users.noreply.github.com> Date: Thu, 27 Nov 2025 18:57:17 +0200 Subject: [PATCH] docs: add GET request handling for streamableHttp stateless mode (#1161) --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index bfe5f662..b251359a 100644 --- a/README.md +++ b/README.md @@ -625,6 +625,11 @@ app.post('/mcp', async (req, res) => { } }); +// Handle GET requests when session management is not supported - the server must return an HTTP 405 status code in this case +app.get('/mcp', (req, res) => { + res.status(405).end(); +}); + const port = parseInt(process.env.PORT || '3000'); app.listen(port, () => { console.log(`MCP Server running on http://localhost:${port}/mcp`);