Skip to content

fix(mcp): migrate to official rmcp SDK and fix clientInfo handling#37

Merged
sonesuke merged 1 commit intomainfrom
migrate/rmcp-sdk
Feb 22, 2026
Merged

fix(mcp): migrate to official rmcp SDK and fix clientInfo handling#37
sonesuke merged 1 commit intomainfrom
migrate/rmcp-sdk

Conversation

@sonesuke
Copy link
Copy Markdown
Owner

Summary

Migrate from third-party mcp-sdk-rs (v0.3.4) to the official rmcp SDK (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 expected implementation field, while the current MCP specification and clients (like Claude CLI) send clientInfo field. This caused initialization failures with the error:

invalid type: null, expected struct Implementation

Changes

  • Migrated from mcp-sdk-rs v0.3.4 to official rmcp v0.16
  • Updated #[tool_router] and #[tool_handler] macro syntax
  • Updated to use Parameters<T> wrapper for tool parameters
  • Fixed initialized notification method name (notifications/initialized)
  • Updated initialization to properly accept protocolVersion and clientInfo params

Test Plan

  • ✅ All unit tests pass (18 tests)
  • ✅ All E2E CLI tests pass (13 tests)
  • ✅ All E2E MCP tests pass (2 tests)
  • cargo fmt --check passes
  • cargo clippy -D warnings passes

Verification

Test with standard MCP client initialization:

echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1"}}}' | cargo run -- mcp

🤖 Generated with Claude Code

- 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>
@sonesuke sonesuke merged commit 609d9cc into main Feb 22, 2026
4 checks passed
@sonesuke sonesuke deleted the migrate/rmcp-sdk branch February 22, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants