Preserve per-item ResourceContents._meta in vMCP
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2.2k
- Forks
- 300
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 184
Description
Part of #5743. Surfaced in jhrozek's review of #6180.
Problem
The spec puts _meta on ResourceContents items too (it's the MCP-UI carrier), and mcpcompat models it (mcpcompat/mcp/resources.go), but vMCP drops it: vmcp.ResourceContent has no Meta field, so both the Legacy conversion (pkg/vmcp/conversion/content.go, ToMCPResourceContents/ConvertMCPResourceContents) and the Modern rebuild (pkg/vmcp/client/client.go modernReadResource) lose it. Legacy and Modern are equally blind, so there's no revision fork — but a backend that sets per-item meta (e.g. MCP-UI payloads) has it silently stripped.
Work
- Add
Meta map[string]anytovmcp.ResourceContent(pkg/vmcp/types.go). - Populate it in both client paths (Legacy
legacyReadResourceviaconversion.FromMCPMetaon each item; Modern rebuild similarly). - Forward it in the Serve-path conversion, with the same reserved-key strip every other egress gets (
mcpparser.StripReservedMetaviaconversion.ToMCPMeta) — a backend can smuggle reservedio.modelcontextprotocol/*keys at the item level too. - Extend the meta-preservation tests to cover per-item meta on both revisions.
Related: #6027 (result-level resource _meta, shipped in toolhive-core v0.0.38 + #6180).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with vmcp.ResourceContent in pkg/vmcp/types.go, then trace legacy conversion in pkg/vmcp/conversion/content.go and modernReadResource in pkg/vmcp/client/client.go. Check legacyReadResource and the existing meta-preservation tests first. Done means per-item metadata survives both client revisions and Serve conversion, with reserved keys stripped on egress.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100