fix: filter template resources from standard resource listing (#528)
- Add filter to exclude resources with template parameters ({}) from resources/list
- Template resources should only appear in resources/templates/list per MCP spec
- Add comprehensive test coverage for resource/template separation
- Update mock transport utilities for better test support
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
This commit is contained in:
parent
ec4b329699
commit
2314238469
1 changed files with 110 additions and 1 deletions
|
|
@ -594,6 +594,7 @@ public class McpAsyncServer {
|
|||
var resourceList = this.resources.values()
|
||||
.stream()
|
||||
.map(McpServerFeatures.AsyncResourceSpecification::resource)
|
||||
.filter(resource -> !resource.uri().contains("{"))
|
||||
.toList();
|
||||
return Mono.just(new McpSchema.ListResourcesResult(resourceList, null));
|
||||
};
|
||||
|
|
@ -906,4 +907,4 @@ public class McpAsyncServer {
|
|||
this.protocolVersions = protocolVersions;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue