The transport spec (2025-11-25 § 2.1, point 4) requires that a server
reply to a JSON-RPC notification with 202 Accepted and no body. The
fall-through branch in the initialize scenario test server returned
200 with `{"jsonrpc":"2.0","id":null,"result":{}}` for all non-initialize,
non-tools/list requests - including `notifications/initialized`.
Branch on `request.id == null` (notification) and emit 202 with no body
in that case. Non-notification requests still get the prior placeholder
200-response behavior.
Closes #274.
Co-authored-by: aditya <aditya@rapidcircuitry.com>
Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>
This commit is contained in:
parent
cf022cbb54
commit
0e1235d352
1 changed files with 6 additions and 0 deletions
|
|
@ -83,6 +83,12 @@ export class InitializeScenario implements Scenario {
|
|||
this.handleInitialize(request, res);
|
||||
} else if (request.method === 'tools/list') {
|
||||
this.handleToolsList(request, res);
|
||||
} else if (request.method === 'notifications/initialized') {
|
||||
// Per MCP spec 2025-11-25 section 2.1 (Sending Messages to the Server),
|
||||
// point 4: "If the input is a JSON-RPC response or notification ...
|
||||
// the server MUST return HTTP status code 202 Accepted with no body."
|
||||
res.writeHead(202);
|
||||
res.end();
|
||||
} else {
|
||||
res.writeHead(200, { 'Content-Type': 'application/json' });
|
||||
res.end(
|
||||
|
|
|
|||
Loading…
Reference in a new issue