Allow SSE POST routing via query session ids

This commit is contained in:
Lee Hanken
2025-10-26 14:24:12 +00:00
parent 931ef0335f
commit 36aa12acb5

View File

@@ -800,7 +800,9 @@ app.get('/sse', async (req, res) => {
// POST endpoint for MCP messages
app.post('/message', async (req, res) => {
const connectionId = req.headers['x-connection-id'];
const headerConnectionId = req.headers['x-connection-id'];
const queryConnectionId = req.query.sessionId;
const connectionId = headerConnectionId || queryConnectionId;
const transport = activeSseTransports.get(connectionId);
if (transport) {