Uh oh!
There was an error while loading. Please reload this page.
feat: add resource_link support to tools and prompts - #381
Conversation
28057c6 to
c9fde77Comparec34d426 to
c4acd32Compareaa4fef7 to
5812189Compare
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
aharvard
commented
Aug 22, 2025
0a53835 to
305b58eCompareThere was a problem hiding this comment.
Pull Request Overview
This PR adds MCP ResourceLink content block support to align rmcp with the MCP 2025-06-18 specification, enabling references to server resources without embedding their payloads.
- Adds ResourceLink content type with URI-based resource referencing
- Updates embedded text MIME type to use proper "text/plain" instead of generic "text"
- Includes comprehensive test coverage for new functionality
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/rmcp/src/model/content.rs | Adds ResourceLink variant to RawContent enum and constructors for resource linking |
| crates/rmcp/src/model/prompt.rs | Adds ResourceLink support to PromptMessageContent for prompts/get |
| crates/rmcp/tests/test_message_schema/*.json | Updates JSON schema files to reflect new ResourceLink type definitions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
a54f798 to
3dcfba3Compareaharvard
commented
Aug 26, 2025
@4t145, I am converting this PR back to a draft state. Something happened when I rebased and force-pushed. I've been working thru failing merge checks with Goose and don't like the edits I'm seeing. I'll notify when ready for another review. |
364059f to
dc96c4aCompared3273e0 to
3b1cd0fCompare3b1cd0f to
71978a9Compareaharvard
commented
Aug 26, 2025
Ready for re-review @4t145. Please take another look at everything I re-rolled my attempt entirely. Pinging @alexhancock as well. |
alexhancock
commented
Aug 27, 2025
Will look later today @aharvard |
Uh oh!
There was an error while loading. Please reload this page.
…tocol#381) * feat: add resource_link support to tools and prompts * chore: remove unused serde_json import from test_resource_link_integration.rs * chore: remove unused serde_json import from test_resource_link.rs


Summary
This PR adds support for the
resource_linkcontent type to the Rust SDK, as specified in the MCP specification. This allows both tools and prompts to return links to resources without embedding the full content, which is useful for large files or resources that should be fetched on-demand.Changes
Core Implementation
ResourceLinkvariant toRawContentenum incontent.rswithsnake_casediscriminantResourceLinkvariant toPromptMessageContentenum inprompt.rs#[serde(rename_all = "snake_case")]to match the MCP specHelper Methods
Content::resource_link()- Create resource link content for toolsRawContent::resource_link()- Create raw resource link contentRawContent::as_resource_link()- Access resource link from contentPromptMessageContent::resource_link()- Create resource link for promptsPromptMessage::new_resource_link()- Create resource link prompt messageTests
"type": "resource_link"Schema Updates
resource_linktypeExample Usage
Tools returning resource links:
Prompts returning resource links:
Compatibility
Testing
All tests pass including: