You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
The request handlers for resources, templates and prompts are only added if any are provided at the moment of building the server. Although methods like addResource() do function as expected, request with methods such as resources/list or resources/read fail with no such method errors because the handlers are not there, even if the server does support the capability.
Environment
Java SDK, async server
Steps to reproduce
Create a server like this:
return McpServer.async(createTransport())
.serverInfo(config.getServerName(), config.getServerVersion())
.capabilities(new ServerCapabilities(
emptyMap(),
null,
null,
new ResourceCapabilities(
config.getResourceCapabilities().isSubscribe(),
config.getResourceCapabilities().isListChanged()),
new ServerCapabilities.ToolCapabilities(config.getToolCapabilities()
.isListChanged())))
.build();
Bug description
The request handlers for resources, templates and prompts are only added if any are provided at the moment of building the server. Although methods like addResource() do function as expected, request with methods such as
resources/list
orresources/read
fail with no such method errors because the handlers are not there, even if the server does support the capability.Environment
Java SDK, async server
Steps to reproduce
Create a server like this:
Afterwards, add a resource like this:
Expected behavior
The resource can be accessed and listed after being added
The text was updated successfully, but these errors were encountered: