-
Notifications
You must be signed in to change notification settings - Fork 803
Description
I would like to extend the McpAsyncServer, McpSyncServer and the stateless versions to extend the behavior of these servers via a new MCP extension under development.
Currently, these classes, and a couple of classes that their constructors depend upon (McpServerFeatures.Sync and Async) are package protected meaning that only the code in the sdk can use these constructors, effectively preventing the creation of subclasses.
Environment
version 0.18.0.SNAPSHOT of sdk as of 2/14/2026
Please provide as many details as possible: Spring MCP version, Java version, which vector store you use if any, etc
Expected behavior
Ability to declare subclasses of McpSyncServer, McpAsyncServer, and stateless analogs. Subclass constructors must call the superclass constructor and so currently cannot be from outside of io.modelcontextprotocol package namespace.
Minimal Complete Reproducible example
The follow code will not compile, because the superclass (McpAsyncServer) constructor is package private.
class AsyncToolGroupServer extends McpAsyncServer {
public AsyncToolGroupServer(McpServerTransportProvider mcpTransportProvider, McpJsonMapper jsonMapper,
Async features, Duration requestTimeout, McpUriTemplateManagerFactory uriTemplateManagerFactory,
JsonSchemaValidator jsonSchemaValidator) {
super(mcpTransportProvider, jsonMapper, features, requestTimeout, uriTemplateManagerFactory, jsonSchemaValidator);
}
}
fix pr forthcoming