-
Notifications
You must be signed in to change notification settings - Fork 554
Description
MCP clients and servers should be able to gracefully handle unknown or unwanted JSON-RPC methods without generating errors.
This feature would significantly improve MCP ecosystem compatibility and reduce operational overhead from method-not-found errors.
The feature should allow:
- Configurable ignorable methods through builder patterns
- Default ignorable methods for common cases
- Graceful handling that returns empty responses instead of errors
- Debug visibility through warning logs
Code example of expected API:
// Client-side configuration
McpClient.async(transport)
.ignorableJsonRpcMethods("notifications/cancelled", "notifications/stderr", "custom/debug")
.build();
// Server-side configuration
McpServer.async(transportProvider)
.ignorableJsonRpcMethods("notifications/cancelled", "notifications/stderr")
.build();
When an ignorable method is received:
- No error response is generated
- Method is logged as warning for debugging
- Processing continues normally
Current Behavior
Currently, when MCP clients or servers receive JSON-RPC methods they don't recognize:
- The core session handling logic immediately returns errors for unknown methods
- There's no configuration mechanism to specify which methods should be ignored
- The builder patterns don't expose any way to customize method handling behavior
Context
- Different MCP implementations send varying sets of methods, causing compatibility issues
- Experimental features can't be safely tested without breaking existing implementations
- Version mismatches between clients and servers create unnecessary error noise
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request