Skip to content

Resources/read does not return content, specified by [McpMeta] attribute, resources/list does #1228

@Ponomareff

Description

@Ponomareff

Describe the bug
Resources/read does not return content, specified by [McpMeta] attribute, resources/list does

To Reproduce
Steps to reproduce the behavior:

  1. Attach attribute [McpMeta("ui", JsonValue = """{ "csp": { "resourceDomains": ["https://cdn.jsdelivr.net"] } }""")] to method, marked with [McpServerResource]
  2. Using MCP Inspector: resources/list returns _meta attribute value above
  3. Using MCP Inspector: resources/read does not

Expected behavior
resources/read returns content of [McpMeta] attribute along with uri, mimeType and text

Additional context
Bug in src\ModelContextProtocol.Core\Server\AIFunctionMcpServerResource.cs method ReadAsync results do not initialize Meta property of returned results

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions