Skip to content

Conversation

@hashemix
Copy link
Member

@hashemix hashemix commented Dec 14, 2025

📌 Summary

This PR introduces a major update to the rust-mcp-sdk crate, focusing on adding support for the latest MCP Protocol version (2025-11-25) while removing Cargo features for supporting older versions to simplify the codebase and reduce conditional feature flags.
The new protocol version is backward-compatible, ensuring a smoother transition. Additionally, numerous improvements have been made for cleaner code, better macro support, and enhanced functionality across the SDK.

These updates makes the SDK more robust, future-proof, and easier to maintain.

✨ Changes Made

  • Protocol Update to 2025-11-25:
    • Added full support for the latest MCP schema, including new fields like icons,website_url in Implementation, and extended annotations/support for tools (e.g., execution).
    • Updated method signatures and params (e.g., CallToolRequestParams now includes meta and task; PaginatedRequestParams for listing tools/prompts/resources).
    • Renamed client methods for clarity and consistency (e.g., list_tools → request_tool_list, call_tool → request_tool_call, send_roots_list_changed → notify_roots_list_changed etc.).
    • Enhanced initialization with optional meta and richer server/client info (e.g., icons, descriptions).
  • Removal of Legacy Version Support:
    • Eliminated Cargo features for older MCP versions (e.g., "2025_06_18", "2025_03_26", "2024_11_05") to streamline the code and remove conditional compilation. The SDK now defaults to the latest version, reducing complexity and maintenance overhead.
  • Macro Enhancements:
    • Updated mcp_tool macro to support new attributes like icons (array of icon definitions with src, mime_type, sizes, theme), execution (for task support), and improved meta handling.
    • Introduced mcp_icon! macro for easy icon creation (used in examples and schema).
    • Refined mcp_elicit macro with support for "form" and "url" modes, including elicit_request_params and parsing from ElicitResultContent.
    • Version Bumps and Dependency Changes:
      • Bumped internal crate versions (e.g., rust-mcp-schema from 0.7.5 to 0.9.x).
  • Handler and Runtime Updates:
    • Adjusted server/client handlers to use new param structs (e.g., Option for list requests).
    • Improved error handling and support for custom requests/notifications.
    • create_server() now accepts a McpServerHandler directly.
    • Introduced new traits to convert ServerHandler and ServerHandlerCore to a McpServerHandler.
      This enables the creation and configuration of handlers before calling the create_server().
  • Examples and Documentation:
    • Updated all examples (e.g., hello-world-server, simple-mcp-client) to use new APIs, icons, and protocol features.
    • Added new assets like rust-mcp-icon.png and integrated it via mcp_icon!.
    • README updates for macros, with examples for mcp_tool and mcp_elicit.
  • Other Improvements:
    • Removed unnecessary features, simplified conditional logic, and improved parsing/validation in macros.

⚠ BREAKING CHANGES:

  • Older MCP version features are removed, users must update to the latest protocol.
  • Method renames and param changes in client/server APIs may require code adjustments.
  • Macro attributes have been expanded; check updated docs for compatibility.
  • when calling create_server(), simply call .to_mcp_server_handler() on your handler instance to convert it to an McpServerHandler before passing it in:
- let server =  server_runtime::create_server(server_details, transport, handler);
+ let server =  server_runtime::create_server(server_details, transport, handler.to_mcp_server_handler());

🛠️ Testing Steps

💡 Additional Notes

@hashemix hashemix changed the title feat! update to MCP Protocol 2025-11-25, new mcp_icon macro and various improvements feat!: update to MCP Protocol 2025-11-25, new mcp_icon macro and various improvements Dec 14, 2025
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