-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Goose uses its own implementation of MCP. We should instead adopt the rmcp crate, which has become the official Rust SDK for the Model Context Protocol https://github.com/modelcontextprotocol/rust-sdk
First remove/replace reference to types in the mcp-core create, eventually removing it entirely, and move our MCP client implementation to RMCP
Plan
Migrate away from types in the mcp-core create, eventually removing it entirely, and move our MCP client implementation to RMCP. We will migrate in four steps:
- (In Progress) Step I: Type Migration. Update all existing code referencing data types to use the rmcp equivalents of these types. These can all be merged as standalone PRs and are relatively easier to verify/ensure safety. An analysis of the type mappings has been completed and is below.
- (In Progress) Step 2: Update client/server tooling. This will be feature flagged and can likely also go in in a few different PRs
- Step 3: Cleanup. Remove old MCP crates and “feature flag off” code, leaving only an integration with RMCP
- Step 4: New feature UX. Now that we’ll have an MCP stack with all features supported, we can develop UX for things like prompts/resources/sampling/elicitation
Type Conversion Reference
| mcp_core Type | rmcp::model Equivalent | Migration Difficulty | Notes | Status |
|---|---|---|---|---|
| Content | Content (Annotated) | Medium | rmcp uses Annotated wrapper pattern | Done |
| TextContent | TextContent (Annotated) | Medium | Structure changed, uses annotation system | Done |
| ImageContent | ImageContent (Annotated) | Medium | Structure changed, uses annotation system | Done |
| EmbeddedResource | EmbeddedResource (Annotated) | Medium | Structure changed, uses annotation system | Done |
| Annotations | Annotations | Easy | Very similar structure | Done |
| Tool | Tool | Hard | Significant API changes, different schema handling | Done |
| ToolCall | CallToolRequestParam | Medium | Different naming and structure | Not Started |
| ToolAnnotations | ToolAnnotations | Medium | Similar but with different defaults and API | Done |
| ToolError | No direct equivalent | Hard | Need to use rmcp::Error instead | Not Started |
| ToolResult | Result<T, rmcp::Error> | Medium | Standard Result type in rmcp | Not Started |
| Resource | Resource (Annotated) | Medium | Uses annotation pattern, added size field | Done |
| ResourceContents | ResourceContents | Easy | Nearly identical structure | Done |
| JsonRpcMessage | JsonRpcMessage<Req, Resp, Noti> | Hard | Heavily parameterized, complex generics | Done |
| JsonRpcRequest | JsonRpcRequest | Hard | Generic structure, different approach | Done |
| JsonRpcResponse | JsonRpcResponse | Hard | Generic structure, different approach | Done |
| JsonRpcNotification | JsonRpcNotification | Hard | Generic structure, different approach | Done |
| JsonRpcError | JsonRpcError | Medium | Similar but integrated into generic system | Done |
| ErrorData | ErrorData | Easy | Very similar structure | Done |
| ToolHandler | No direct equivalent | Hard | rmcp uses different handler pattern with macros | Done |
| ResourceTemplateHandler | No direct equivalent | Hard | rmcp uses different handler pattern | Done |
| Role | Role | Easy | Identical enum structure | Done |
| Prompt | Prompt | Easy | Nearly identical structure | Done |
| PromptArgument | PromptArgument | Easy | Identical structure | Done |
| PromptMessage | PromptMessage | Medium | Similar but content handling differs | Done |
| PromptMessageRole | PromptMessageRole | Easy | Identical enum | Done |
| PromptMessageContent | PromptMessageContent | Medium | Similar but uses rmcp's annotation system | Done |
Progress
Some PRs so far:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request