-
Notifications
You must be signed in to change notification settings - Fork 410
Open
Description
Describe the bug
Resources returned by resources/list (RawResource / Resource) lack an extensible _meta field. This forces servers to embed provenance data (e.g., location=global/project/universal) into less suitable fields like description or URIs. Ultimately this creates inconsistency, as readResource allows _meta on ResourceContents, preventing clients that only list resources from accessing structured metadata.
To Reproduce
- Implement an MCP server that wants to tag each resource with
location. - Return resources via
listResources. - Observe there is no field to attach structured metadata; only
descriptionor name can be overloaded.
Expected behavior
listResources should allow an optional structured metadata map (e.g., _meta / meta: Meta) on each resource, matching how ResourceContents supports _meta. Clients should receive structured fields like {"location":"global"} without string scraping.
Logs
Not a runtime error; this is a protocol/schema limitation observed during server implementation.
Additional context
- Adding optional
_metapreserves backward compatibility (omit when empty). - Aligns with other SDKs that allow resource metadata.
- Alternatives (description/URI query) are brittle, change resource identity, and require heuristic parsing.
Related issues
- Missing _meta Field Support in rmcp Tool Registration #505 mentions adding
_metatoToolregistration, but does not cover the need for resource-level_metainlistResources. - Request Metadata Context #61 describes allowing servers to attach arbitrary metadata to requests such that handlers are able to access client-related details (such as transport type or bearer token). It doesn't provide the ability to add
_metatolistResourcesor resources. The scope with this issue is limited to request context rather than including resource metadata.
Metadata
Metadata
Assignees
Labels
No labels