Describe the bug
MCP server becomes completely unresponsive when receiving a JSON-RPC request with an id value exceeding Number.MAX_SAFE_INTEGER (9007199254740991). The server doesn't crash or return an error - it simply stops responding to all requests permanently.
To Reproduce
- Start any MCP server using the TypeScript SDK
- Initialize the connection normally
- Send a request with
id: 9007199254740992 (MAX_SAFE_INTEGER + 1)
- Server hangs indefinitely - no response, no error
{"jsonrpc":"2.0","id":9007199254740992,"method":"tools/list"}
Expected behavior
Server should either:
- Return a JSON-RPC error response for invalid ID
- Reject the request and continue processing other requests
Actual behavior
Server enters permanent deadlock. Process stays alive (low CPU, ~55MB memory) but responds to nothing. Requires manual restart.
Logs
No error output - server silently hangs.
Process alive: Yes
CPU: 0.25%
Memory: 54MB
Response: None (waited 10+ minutes)
Additional context
- Tested on
@modelcontextprotocol/sdk latest version
- Reproducible 100% of the time
- Single malformed request is enough to freeze the server
- IDs at or below MAX_SAFE_INTEGER work fine
Describe the bug
MCP server becomes completely unresponsive when receiving a JSON-RPC request with an
idvalue exceedingNumber.MAX_SAFE_INTEGER(9007199254740991). The server doesn't crash or return an error - it simply stops responding to all requests permanently.To Reproduce
id: 9007199254740992(MAX_SAFE_INTEGER + 1){"jsonrpc":"2.0","id":9007199254740992,"method":"tools/list"}Expected behavior
Server should either:
Actual behavior
Server enters permanent deadlock. Process stays alive (low CPU, ~55MB memory) but responds to nothing. Requires manual restart.
Logs
No error output - server silently hangs.
Additional context
@modelcontextprotocol/sdklatest version