You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Preserve per-item ResourceContents._meta in vMCP #6190
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.gomodernReadResource) 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]any to vmcp.ResourceContent (pkg/vmcp/types.go).
Populate it in both client paths (Legacy legacyReadResource via conversion.FromMCPMeta on each item; Modern rebuild similarly).
Forward it in the Serve-path conversion, with the same reserved-key strip every other egress gets (mcpparser.StripReservedMeta via conversion.ToMCPMeta) — a backend can smuggle reserved io.modelcontextprotocol/* keys at the item level too.
Extend the meta-preservation tests to cover per-item meta on both revisions.
I'd like to work on this. Plan: add Meta map[string]any to vmcp.ResourceContent, populate it in ConvertMCPResourceContents (legacy) and in modernReadResource's wire struct (modern), and forward it on egress through ToMCPResourceContents with the usual reserved-key strip. Will extend the meta-preservation tests for per-item meta on both revisions.
Activity
suantea commentedon Oct 10, 2026
I'd like to work on this. Plan: add
Meta map[string]anytovmcp.ResourceContent, populate it inConvertMCPResourceContents(legacy) and inmodernReadResource's wire struct (modern), and forward it on egress throughToMCPResourceContentswith the usual reserved-key strip. Will extend the meta-preservation tests for per-item meta on both revisions.