-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
bugSomething isn't workingSomething isn't workingneeds confirmationNeeds confirmation that the PR is actually required or needed.Needs confirmation that the PR is actually required or needed.
Description
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/sdklatest version - Reproducible 100% of the time
- Single malformed request is enough to freeze the server
- IDs at or below MAX_SAFE_INTEGER work fine
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingneeds confirmationNeeds confirmation that the PR is actually required or needed.Needs confirmation that the PR is actually required or needed.