Expand description
Protocol version management and compatibility checking.
§Protocol Versioning and Compatibility
This module provides comprehensive protocol version management and compatibility checking for MCP implementations.
§Production Guidance
For new deployments, use [Version::latest()] (2025-11-25) - the official stable
MCP specification released on November 25, 2025.
For maximum backwards compatibility, use [Version::stable()] (2025-06-18) which
is widely supported by existing MCP clients including older versions of Claude Code.
use turbomcp_protocol::versioning::Version;
// Recommended: Use latest() for the official 2025-11-25 spec
let version = Version::latest(); // 2025-11-25 (official release)
// Legacy compatibility: Use stable() for older clients
let version = Version::stable(); // 2025-06-18§Supported Versions
TurboMCP supports multiple MCP specification versions:
| Version | Constant | Status |
|---|---|---|
| 2025-11-25 | [Version::latest()] | Current - Official MCP spec (Tasks, Extensions, CIMD) |
| 2025-06-18 | [Version::stable()] | Stable - Widely deployed, legacy client compatibility |
| 2025-03-26 | - | Legacy support |
| 2024-11-05 | - | Legacy support |
§Version Selection Guidelines
- New production servers: Use
Version::latest()for the official 2025-11-25 spec with Tasks API, Extensions, and modern authorization features - Legacy compatibility: Use
Version::stable()if you need to support older clients that haven’t updated to the 2025-11-25 spec - Building clients: Support multiple versions and negotiate with the server
§Version Negotiation
The MCP protocol uses a client-request, server-decide negotiation model:
use turbomcp_protocol::versioning::{Version, VersionManager};
// Server setup - prefers stable for production compatibility
let manager = VersionManager::with_default_versions();
// Client requests the latest version
let client_versions = vec![Version::latest(), Version::stable()];
// Server negotiates (picks highest mutually supported version)
let negotiated = manager.negotiate_version(&client_versions);
assert_eq!(negotiated, Some(Version::latest()));§Feature Flags vs Runtime Negotiation
Feature flags (compile-time) control what types are available:
# Enable all MCP features at compile time
turbomcp-protocol = { version = "2.3", features = ["mcp-draft"] }Runtime negotiation determines what protocol version is used for a session:
use turbomcp_protocol::{InitializeRequest, InitializeResult};
// Client asks for latest spec
let request = InitializeRequest { protocol_version: "2025-11-25".into(), ..Default::default() };
// Server responds with actual version (may downgrade for compatibility)
let response = InitializeResult { protocol_version: "2025-06-18".into(), ..Default::default() };Key Principle: The 2025-11-25 spec is the current official release. Use it for new deployments. The 2025-06-18 version remains available for backwards compatibility with older clients. Always negotiate at runtime based on what the other party supports.
Modules§
- utils
- Utility functions for version management
Structs§
- Version
- Semantic version representation
- Version
Manager - Version manager for handling protocol versions
Enums§
- Version
Compatibility - Version compatibility result
- Version
Error - Version-related errors
- Version
Requirement - Version requirement specification