Skip to content

Commit 25ddecf

Browse files
fix: handle 400 response in SSE polling scenario
Server may return 400 when GET request is missing session context (mcp-session-id header). Treat as INFO similar to 405.
1 parent 32fb397 commit 25ddecf

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/scenarios/server/sse-polling.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,30 @@ export class ServerSSEPollingScenario implements ClientScenario {
5050
return checks;
5151
}
5252

53+
// Server may require session context for standalone SSE GET
54+
if (response.status === 400) {
55+
checks.push({
56+
id: 'server-sse-polling-endpoint',
57+
name: 'ServerSSEPollingEndpoint',
58+
description: 'Server supports SSE GET endpoint',
59+
status: 'INFO',
60+
timestamp: new Date().toISOString(),
61+
specReferences: [
62+
{
63+
id: 'SEP-1699',
64+
url: 'https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1699'
65+
}
66+
],
67+
details: {
68+
serverUrl,
69+
statusCode: response.status,
70+
message:
71+
'Server requires session context for standalone SSE GET endpoint (400 Bad Request)'
72+
}
73+
});
74+
return checks;
75+
}
76+
5377
if (!response.ok) {
5478
checks.push({
5579
id: 'server-sse-polling-connection',

0 commit comments

Comments
 (0)