docs: add GET request handling for streamableHttp stateless mode (#1161)

This commit is contained in:
Sahar Shemesh 2025-11-27 18:57:17 +02:00 • committed by GitHub
commit 2aa697ceda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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`);