Bug description
The annotations property of an McpResource is ignored. It is not propagated to the client.
@McpResource(
uri = "test://resource/{id}",
name = "test-resource",
annotations = @McpResource.McpAnnotations(
audience = McpSchema.Role.ASSISTANT,
priority = 1.0,
lastModified = "some time"
)
)
public String myResource() {
return "something";
}
The only accessor of this property is
|
public static McpSchema.Resource asResource(McpResource mcpResourceAnnotation) { |
The only callers of that method are tests
Environment
Spring AI version: 2.0.0
Expected behavior
Properties should be sent to the client.
For lastModified specifically, the design seems wrong. It's quite unlikely that a static lastModified time will be possible. In many cases, the the property must be derived programmatically from the resource.
McpResource is also used for template resources, and for such cases, there is not a single last modified time - it depends on the resource.
Bug description
The
annotationsproperty of an McpResource is ignored. It is not propagated to the client.The only accessor of this property is
spring-ai/mcp/mcp-annotations/src/main/java/org/springframework/ai/mcp/annotation/adapter/ResourceAdapter.java
Line 42 in ca666e7
The only callers of that method are tests
Environment
Spring AI version: 2.0.0
Expected behavior
Properties should be sent to the client.
For
lastModifiedspecifically, the design seems wrong. It's quite unlikely that a static lastModified time will be possible. In many cases, the the property must be derived programmatically from the resource.McpResource is also used for template resources, and for such cases, there is not a single last modified time - it depends on the resource.