From 19cc793aa301593cc73a3000f6641afda5751fc4 Mon Sep 17 00:00:00 2001 From: Sahar Shemesh Date: Mon, 24 Nov 2025 21:29:22 +0200 Subject: [PATCH] docs: add GET request handling for streamableHttp stateless mode --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index bcdf0d841..51ed48118 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`);