Skip to content

Add support for ignorable JSON-RPC methods in MCP clients and servers #416

@tzolov

Description

@tzolov

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:

  1. Configurable ignorable methods through builder patterns
  2. Default ignorable methods for common cases
  3. Graceful handling that returns empty responses instead of errors
  4. 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 request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions