pub enum ProtocolVersion {
V2025_06_18,
V2025_11_25,
Draft,
Unknown(String),
}Expand description
MCP protocol version.
Represents a known or unknown MCP specification version. Known versions get
first-class enum variants; unknown version strings are preserved via
Unknown for forward compatibility (e.g. proxies
and protocol analyzers that handle arbitrary versions).
§Ordering
Known versions are ordered by specification release date. Unknown
sorts after all known versions.
§Serialization
Serializes to/from the canonical version string (e.g. "2025-11-25").
Variants§
V2025_06_18
MCP specification 2025-06-18
V2025_11_25
MCP specification 2025-11-25 (current stable)
Draft
Draft specification (DRAFT-2026-v1)
Unknown(String)
Unknown/future protocol version (preserved for forward compatibility)
Implementations§
Source§impl ProtocolVersion
impl ProtocolVersion
Sourcepub const LATEST: ProtocolVersion = Self::V2025_11_25
pub const LATEST: ProtocolVersion = Self::V2025_11_25
The latest stable protocol version.
Sourcepub const STABLE: &'static [ProtocolVersion]
pub const STABLE: &'static [ProtocolVersion]
Sourcepub fn is_known(&self) -> bool
pub fn is_known(&self) -> bool
Whether this is a named (non-Unknown) protocol version.
Returns true for all variants except Unknown.
Trait Implementations§
Source§impl Clone for ProtocolVersion
impl Clone for ProtocolVersion
Source§fn clone(&self) -> ProtocolVersion
fn clone(&self) -> ProtocolVersion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProtocolVersion
impl Debug for ProtocolVersion
Source§impl Default for ProtocolVersion
impl Default for ProtocolVersion
Source§fn default() -> ProtocolVersion
fn default() -> ProtocolVersion
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ProtocolVersion
impl<'de> Deserialize<'de> for ProtocolVersion
Source§fn deserialize<D>(
deserializer: D,
) -> Result<ProtocolVersion, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ProtocolVersion, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ProtocolVersion
impl Display for ProtocolVersion
Source§impl From<&str> for ProtocolVersion
impl From<&str> for ProtocolVersion
Source§fn from(s: &str) -> ProtocolVersion
fn from(s: &str) -> ProtocolVersion
Converts to this type from the input type.
Source§impl From<String> for ProtocolVersion
impl From<String> for ProtocolVersion
Source§fn from(s: String) -> ProtocolVersion
fn from(s: String) -> ProtocolVersion
Converts to this type from the input type.
Source§impl Hash for ProtocolVersion
impl Hash for ProtocolVersion
Source§impl Ord for ProtocolVersion
impl Ord for ProtocolVersion
Source§fn cmp(&self, other: &ProtocolVersion) -> Ordering
fn cmp(&self, other: &ProtocolVersion) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq<&str> for ProtocolVersion
impl PartialEq<&str> for ProtocolVersion
Source§impl PartialEq<ProtocolVersion> for &str
impl PartialEq<ProtocolVersion> for &str
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§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
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 UnsafeUnpin for ProtocolVersion
impl UnwindSafe for ProtocolVersion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.