-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Replace mcp_core::content types with rmcp::model types #3500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
339bfc8 to
634bdea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR replaces the mcp_core::content module with types from the rmcp::model crate, consolidating content type definitions and removing duplicate implementations. This is part of a broader migration strategy to unify content types across the codebase.
- Removes the entire
mcp_core/src/content.rsfile containingContent,TextContent,ImageContent,Annotations, andEmbeddedResourcetypes - Updates all imports throughout the codebase to use
rmcp::modelequivalents instead - Adapts code to work with the new type structure, particularly the "raw" wrapper pattern used in rmcp types
Reviewed Changes
Copilot reviewed 61 out of 62 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/mcp-core/src/content.rs | Complete removal of content type definitions |
| crates/mcp-core/src/lib.rs | Removes content module exports |
| crates/mcp-core/src/protocol.rs | Updates Content import to use rmcp |
| crates/mcp-core/src/prompt.rs | Updates content type usage and structure adaptation |
| crates/mcp-server/src/main.rs | Updates Content import source |
| crates/mcp-server/src/router.rs | Updates Content import source |
| crates/mcp-server/Cargo.toml | Adds rmcp workspace dependency |
| crates/goose/src/message.rs | Major updates to content type handling and conversions |
| Multiple goose provider format files | Updates to handle new content structure with raw wrapper |
| Multiple test files | Updates test code to use new content APIs |
| } | ||
| } | ||
| }).collect(); | ||
| Ok(converted_messages) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go away once we do the PromptMessage migration. But we needed to do a bit of it here since we want to work with the rmcp content types.
5aef1aa to
355ac32
Compare
f608459 to
9841c9e
Compare
| data: string; | ||
| mimeType: string; | ||
| type: string; | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks like a bit less useful than what we had before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there any frontend imports of this that may need to be updated? we don't have a ton of testing in the frontend unfortunately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the TS checker passing does give some confidence that this change is OK, but I'll pay some extra attention to this to be sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, turns out we are not using this type at all, because we have our own extended MessageContent type that we use instead
| data: string; | ||
| mimeType: string; | ||
| type: string; | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there any frontend imports of this that may need to be updated? we don't have a ton of testing in the frontend unfortunately
…ntral-deeplinks * origin/main: (22 commits) feat: deprecate jetbrains extension in favor of public one (#2589) feat: Add LiteLLM provider with automatic prompt caching support (#3380) docs: update desktop instructions for managing sessions (#3522) docs: update desktop instructions for session recipes (#3521) Replace mcp_core::content types with rmcp::model types (#3500) docs: update desktop instructions for tool perms (#3518) docs: update desktop instructions for tool router (#3519) Alexhancock/reapply 3491 (#3515) docs: update mcp install instructions for desktop (#3504) Docs: Access settings in new UI (#3514) feat: switch from mcp_core::Role to rmcp::model::Role (#3488) Revert "fix the output not being visible issue (#3491)" (#3511) fix: Load and Use recipes in new window (#3501) fix: working dir was not being set correctly (#3477) Fix launching session in new window (#3497) Fix tool call allow still showing initial state in chat after navigating back (#3498) feat: add rmcp as a workspace dep (#3483) feat: consolidate subagent execution for dynamic tasks (#3444) fix token alert indicator/popovers hiding and showing (#3492) Fix llm errors not propagating to the ui and auto summarize not starting (#3490) ...
* main: Extension Library Improvements (#3541) fix(ui): enable selection of zero-config providers in desktop GUI (#3378) refactor: Renames recipe route to recipes to be consistent (#3540) Blog: Orchestrating 6 Subagents to Build a Collaborative API Playground (#3528) Catch json errors a little better (#3437) Rust debug (#3510) refactor: Centralise deeplink encode and decode into server (#3489) feat: deprecate jetbrains extension in favor of public one (#2589) feat: Add LiteLLM provider with automatic prompt caching support (#3380) docs: update desktop instructions for managing sessions (#3522) docs: update desktop instructions for session recipes (#3521) Replace mcp_core::content types with rmcp::model types (#3500) docs: update desktop instructions for tool perms (#3518) docs: update desktop instructions for tool router (#3519) Alexhancock/reapply 3491 (#3515) docs: update mcp install instructions for desktop (#3504) Docs: Access settings in new UI (#3514) feat: switch from mcp_core::Role to rmcp::model::Role (#3488) Revert "fix the output not being visible issue (#3491)" (#3511) fix: Load and Use recipes in new window (#3501)
Signed-off-by: Adam Tarantino <tarantino.adam@hey.com>
Basically, delete crates/mcp-core/src/content.rs and add in rmcp types in its place. Kicked off by me and mostly done by Goose+Claude.