Skip to content

feat(vmcp): add support for ResourceLink content type#4023

Open
Sanskarzz wants to merge 1 commit intostacklok:mainfrom
Sanskarzz:suppResourceLink
Open

feat(vmcp): add support for ResourceLink content type#4023
Sanskarzz wants to merge 1 commit intostacklok:mainfrom
Sanskarzz:suppResourceLink

Conversation

@Sanskarzz
Copy link
Contributor

[WIP]

Summary

This PR implements support for the ResourceLink content type (type discriminant "resource_link") in the vMCP bridge layer. Previously, ResourceLink content returned by backend MCP servers was unrecognized by the conversion layer, causing it to fall through to "unknown" and eventually be emitted as empty text, losing critical resource pointers and metadata.

Key Changes

  • Core Types: Extended vmcp.Content in pkg/vmcp/types.go to include Name and Description fields, allowing it to faithfully represent a ResourceLink .
  • Conversion Layer: Added contentTypeLink constant to pkg/vmcp/conversion/content.go. Updated ConvertMCPContent to detect mcp.ResourceLink via type assertion and map it to vmcp.Content. Updated ToMCPContent to reconstruct mcp.ResourceLink using mcp.NewResourceLink.
  • Tests: Added new test cases to TestConvertMCPContent and TestToMCPContent in conversion_test.go. Added TestResourceLinkRoundTrip to verify that data is preserved when converting in both directions.

Validation Results

All tests in pkg/vmcp/conversion and pkg/vmcp/server/adapter pass. go vet is clean.

Fixes #3960

Signed-off-by: Sanskarzz <sanskar.gur@gmail.com>
@github-actions github-actions bot added the size/S Small PR: 100-299 lines changed label Mar 5, 2026
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.57%. Comparing base (e42f226) to head (963b417).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4023      +/-   ##
==========================================
+ Coverage   68.53%   68.57%   +0.04%     
==========================================
  Files         441      441              
  Lines       44970    44979       +9     
==========================================
+ Hits        30820    30846      +26     
+ Misses      11758    11739      -19     
- Partials     2392     2394       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Sanskarzz Sanskarzz marked this pull request as ready for review March 6, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR: 100-299 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ResourceLink content type support to vmcp bridge

1 participant