-
Notifications
You must be signed in to change notification settings - Fork 714
Open
Description
Expected Behavior
Currently using the Stateless server. We need a way to override the behavior of a single request handler, for instance the tools/list request to provide custom tool descriptions.
Current Behavior
The McpStatelessAsyncServer constructor currently creates a DefaultMcpStatelessServerHandler as mcpHandler for the ServerTransport with private methods as handlers with private variables.
We can currently override the mcpHandler after-the-fact using McpStatelessServerTransport::setMcpHandler, but it would be nice to override only a single handler, for example adding a couple of getters:
var serverTransport = WebMvcStatelessServerTransport.builder() [...] .build();
...
var server = McpServer.sync(serverTransport).tools(tools) [...] .build();
// Override default request handler
serverTransport.getMcpHandler()
.getRequestHandlers()
.put(McpSchema.METHOD_TOOLS_LIST, myCustomToolsList(tools));What do you think?
Context
We want customizable tool descriptions per-user with minimal code duplication of the SDK.
linarkoubcersows
Metadata
Metadata
Assignees
Labels
No labels