fix(mcp): migrate to official rmcp SDK and fix clientInfo handling#37
Merged
fix(mcp): migrate to official rmcp SDK and fix clientInfo handling#37
Conversation
- Migrate from third-party mcp-sdk-rs to official rmcp SDK (v0.16) - Fix clientInfo field handling for MCP protocol compatibility - Update initialization to accept protocolVersion and clientInfo params - Fix initialized notification method name (notifications/initialized) Resolves issue where Claude CLI fails to connect with error: "invalid type: null, expected struct Implementation" Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate from third-party
mcp-sdk-rs(v0.3.4) to the officialrmcpSDK (v0.16) to fix MCP protocol compatibility issues with Claude CLI and other standard MCP clients.Problem
The previous SDK (
mcp-sdk-rs) used an outdated protocol schema that expectedimplementationfield, while the current MCP specification and clients (like Claude CLI) sendclientInfofield. This caused initialization failures with the error:Changes
mcp-sdk-rsv0.3.4 to officialrmcpv0.16#[tool_router]and#[tool_handler]macro syntaxParameters<T>wrapper for tool parametersinitializednotification method name (notifications/initialized)protocolVersionandclientInfoparamsTest Plan
cargo fmt --checkpassescargo clippy -D warningspassesVerification
Test with standard MCP client initialization:
🤖 Generated with Claude Code