pub enum ProtocolVersion {
V2024_11_05,
V2025_03_26,
V2025_06_18,
V2025_11_25,
}Expand description
MCP protocol versions in chronological order.
The ordering is: V2024_11_05 < V2025_03_26 < V2025_06_18 < V2025_11_25
This enum implements Ord, so you can compare versions:
use mcpkit_core::protocol_version::ProtocolVersion;
assert!(ProtocolVersion::V2025_11_25 > ProtocolVersion::V2024_11_05);
assert!(ProtocolVersion::V2025_03_26 >= ProtocolVersion::V2024_11_05);Variants§
V2024_11_05
Original MCP specification (November 2024).
Features: HTTP+SSE transport, tools, resources, prompts.
V2025_03_26
OAuth 2.1 and Streamable HTTP update (March 2025).
New features:
- OAuth 2.1 authorization framework
- Streamable HTTP transport (replaces HTTP+SSE)
- JSON-RPC batching (removed in 2025-06-18)
- Tool annotations (readOnly, destructive)
- Audio content type
- Completions capability
V2025_06_18
Security and elicitation update (June 2025).
New features:
- Elicitation (server requesting user input)
- Structured tool output
- Resource links in tool results
- Protected resource metadata
_metafield in messagestitlefield for display names
Breaking changes:
- Removed JSON-RPC batching
- MCP-Protocol-Version header required
V2025_11_25
Tasks and parallel tools update (November 2025).
New features:
- Tasks with async status tracking
- Parallel tool calls
- Server-side agent loops
- Tool calling in sampling requests
Implementations§
Source§impl ProtocolVersion
impl ProtocolVersion
Sourcepub const fn as_str(&self) -> &'static str
pub const fn as_str(&self) -> &'static str
Returns the string representation used in the protocol.
This matches the format expected in MCP messages (e.g., "2025-11-25").
Sourcepub const fn supports_sse_transport(&self) -> bool
pub const fn supports_sse_transport(&self) -> bool
Whether this version uses HTTP+SSE transport (original spec).
Only V2024_11_05 uses the original HTTP+SSE transport.
Later versions use Streamable HTTP.
Sourcepub const fn supports_streamable_http(&self) -> bool
pub const fn supports_streamable_http(&self) -> bool
Whether this version supports Streamable HTTP transport.
Added in 2025-03-26, replacing HTTP+SSE.
Sourcepub const fn supports_batching(&self) -> bool
pub const fn supports_batching(&self) -> bool
Whether this version supports JSON-RPC batching.
Only available in 2025-03-26. Removed in 2025-06-18.
Sourcepub const fn requires_version_header(&self) -> bool
pub const fn requires_version_header(&self) -> bool
Whether the MCP-Protocol-Version header is required in HTTP requests.
Required from 2025-06-18 onwards.
Sourcepub const fn supports_audio_content(&self) -> bool
pub const fn supports_audio_content(&self) -> bool
Whether this version supports audio content type.
Added in 2025-03-26.
Sourcepub const fn supports_tool_annotations(&self) -> bool
pub const fn supports_tool_annotations(&self) -> bool
Whether this version supports tool annotations.
Tool annotations describe behavior like readOnly, destructive, idempotent.
Added in 2025-03-26.
Sourcepub const fn supports_structured_tool_output(&self) -> bool
pub const fn supports_structured_tool_output(&self) -> bool
Whether this version supports structured tool output.
Allows tools to return structured data alongside text. Added in 2025-06-18.
Sourcepub const fn supports_resource_links(&self) -> bool
pub const fn supports_resource_links(&self) -> bool
Whether this version supports resource links in tool results.
Allows tool results to reference resources. Added in 2025-06-18.
Sourcepub const fn supports_parallel_tools(&self) -> bool
pub const fn supports_parallel_tools(&self) -> bool
Whether this version supports parallel tool calls.
Allows multiple tools to be called concurrently. Added in 2025-11-25.
Sourcepub const fn supports_oauth(&self) -> bool
pub const fn supports_oauth(&self) -> bool
Whether this version supports OAuth 2.1 authorization.
Added in 2025-03-26.
Sourcepub const fn supports_protected_resources(&self) -> bool
pub const fn supports_protected_resources(&self) -> bool
Whether this version supports protected resource metadata.
Enables discovery of OAuth authorization servers. Added in 2025-06-18.
Sourcepub const fn supports_elicitation(&self) -> bool
pub const fn supports_elicitation(&self) -> bool
Whether this version supports elicitation.
Elicitation allows servers to request additional information from users. Added in 2025-06-18.
Sourcepub const fn supports_tasks(&self) -> bool
pub const fn supports_tasks(&self) -> bool
Whether this version supports tasks with async status tracking.
Tasks allow tracking long-running operations. Added in 2025-11-25.
Sourcepub const fn supports_agent_loops(&self) -> bool
pub const fn supports_agent_loops(&self) -> bool
Whether this version supports server-side agent loops.
Enables sophisticated multi-step reasoning on the server. Added in 2025-11-25.
Sourcepub const fn supports_sampling_tools(&self) -> bool
pub const fn supports_sampling_tools(&self) -> bool
Whether this version supports tool calling in sampling requests.
Allows servers to include tool definitions in sampling. Added in 2025-11-25.
Sourcepub const fn supports_meta_field(&self) -> bool
pub const fn supports_meta_field(&self) -> bool
Whether this version supports the _meta field in messages.
Provides metadata for messages. Added in 2025-06-18.
Sourcepub const fn supports_title_field(&self) -> bool
pub const fn supports_title_field(&self) -> bool
Whether this version supports the title field for display names.
Separate from name which is the programmatic identifier.
Added in 2025-06-18.
Sourcepub const fn supports_completion_context(&self) -> bool
pub const fn supports_completion_context(&self) -> bool
Whether this version supports the context field in completion requests.
Provides previously-resolved variable values. Added in 2025-06-18.
Sourcepub const fn supports_completions_capability(&self) -> bool
pub const fn supports_completions_capability(&self) -> bool
Whether this version supports the completions capability.
Explicitly indicates support for argument autocompletion. Added in 2025-03-26.
Sourcepub fn negotiate(requested: &str, supported: &[Self]) -> Option<Self>
pub fn negotiate(requested: &str, supported: &[Self]) -> Option<Self>
Negotiate the best protocol version between requested and supported versions.
Returns the highest version that is:
- Less than or equal to the requested version
- In the supported versions list
Returns None if no compatible version exists.
§Arguments
requested- The version string requested by the clientsupported- List of versions supported by the server
§Example
use mcpkit_core::protocol_version::ProtocolVersion;
// Server supports all versions, client requests latest
let negotiated = ProtocolVersion::negotiate(
"2025-11-25",
ProtocolVersion::ALL
);
assert_eq!(negotiated, Some(ProtocolVersion::V2025_11_25));
// Client requests older version
let negotiated = ProtocolVersion::negotiate(
"2024-11-05",
ProtocolVersion::ALL
);
assert_eq!(negotiated, Some(ProtocolVersion::V2024_11_05));
// Client requests unknown future version
let negotiated = ProtocolVersion::negotiate(
"2026-01-01",
ProtocolVersion::ALL
);
// Returns latest supported version
assert_eq!(negotiated, Some(ProtocolVersion::V2025_11_25));Sourcepub const fn is_compatible_with(&self, client_version: Self) -> bool
pub const fn is_compatible_with(&self, client_version: Self) -> bool
Check if this version can communicate with another version.
Newer servers can communicate with older clients using backward compatibility.
§Arguments
client_version- The version the client supports
§Example
use mcpkit_core::protocol_version::ProtocolVersion;
let server = ProtocolVersion::V2025_11_25;
// Server can talk to older clients
assert!(server.is_compatible_with(ProtocolVersion::V2024_11_05));
// Server can talk to same version
assert!(server.is_compatible_with(ProtocolVersion::V2025_11_25));Trait Implementations§
Source§impl Clone for ProtocolVersion
impl Clone for ProtocolVersion
Source§fn clone(&self) -> ProtocolVersion
fn clone(&self) -> ProtocolVersion
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProtocolVersion
impl Debug for ProtocolVersion
Source§impl Default for ProtocolVersion
impl Default for ProtocolVersion
Source§impl<'de> Deserialize<'de> for ProtocolVersion
impl<'de> Deserialize<'de> for ProtocolVersion
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ProtocolVersion
impl Display for ProtocolVersion
Source§impl From<ProtocolVersion> for String
impl From<ProtocolVersion> for String
Source§fn from(version: ProtocolVersion) -> Self
fn from(version: ProtocolVersion) -> Self
Source§impl FromStr for ProtocolVersion
impl FromStr for ProtocolVersion
Source§impl Hash for ProtocolVersion
impl Hash for ProtocolVersion
Source§impl Ord for ProtocolVersion
impl Ord for ProtocolVersion
Source§impl PartialEq for ProtocolVersion
impl PartialEq for ProtocolVersion
Source§impl PartialOrd for ProtocolVersion
impl PartialOrd for ProtocolVersion
Source§impl Serialize for ProtocolVersion
impl Serialize for ProtocolVersion
Source§impl TryFrom<&str> for ProtocolVersion
impl TryFrom<&str> for ProtocolVersion
Source§impl TryFrom<String> for ProtocolVersion
impl TryFrom<String> for ProtocolVersion
impl Copy for ProtocolVersion
impl Eq for ProtocolVersion
impl StructuralPartialEq for ProtocolVersion
Auto Trait Implementations§
impl Freeze for ProtocolVersion
impl RefUnwindSafe for ProtocolVersion
impl Send for ProtocolVersion
impl Sync for ProtocolVersion
impl Unpin for ProtocolVersion
impl UnwindSafe for ProtocolVersion
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more