Problem
handleMcpRequest treats an empty JSON array as a batch with no responses and returns HTTP 202. Under JSON-RPC 2.0, an empty batch is invalid and should return an Invalid Request error.
Relevant code: src/mcp.ts.
Expected behavior
A request body of [] should return a JSON-RPC error with code -32600, rather than a successful empty response.
Acceptance criteria
- Detect an empty batch before dispatch.
- Return a valid JSON-RPC
Invalid Request error with id null.
- Keep notification-only non-empty batches returning no response.
- Add request-level tests covering empty batches and notification-only batches.
Problem
handleMcpRequesttreats an empty JSON array as a batch with no responses and returns HTTP 202. Under JSON-RPC 2.0, an empty batch is invalid and should return anInvalid Requesterror.Relevant code:
src/mcp.ts.Expected behavior
A request body of
[]should return a JSON-RPC error with code-32600, rather than a successful empty response.Acceptance criteria
Invalid Requesterror with idnull.