pub enum ServerStatus {
Available,
Unavailable,
}Expand description
Status of a configured server.
The precise check behind this depends on the call site: server list
uses transport_available (PATH lookup for stdio; URL well-formedness
plus a bounded MCP introspection attempt for http/sse — see
LIST_AVAILABILITY_TIMEOUT). server info/server validate instead
reflect whether a full MCP introspection handshake succeeded, waiting out
the entry’s full configured connect_timeout_secs/discover_timeout_secs.
For http/sse, list and info/validate share the exact same
connection path (Introspector::discover_server), so they can no longer
disagree about how a transport is reached (proxying, IPv6) — only about
how long the check is allowed to run. list’s bounded check is a
time-boxed, best-effort signal across every configured server; server validate <name>/server info <name> are the authoritative check for one
specific server. A server that is merely slow (past list’s short bound
but within its own configured timeout) can therefore show unavailable
in list and available in validate/info. This is an intentional,
documented trade-off — distinct from #280, which was an unconditional
wrong answer, not a bounded, best-effort one.
For stdio, this equivalence does not hold: list still performs only
a PATH lookup while info/validate perform a full handshake, so the
two can disagree about more than timing (pre-existing behavior, unrelated
to #280’s http/sse scope).
§Examples
use mcp_execution_cli::commands::server::ServerStatus;
assert_eq!(
serde_json::to_string(&ServerStatus::Available).unwrap(),
"\"available\""
);
assert_eq!(
serde_json::to_string(&ServerStatus::Unavailable).unwrap(),
"\"unavailable\""
);Variants§
Available
list: command in PATH / URL well-formed and reachable. info:
introspection succeeded.
list: command missing / URL malformed or unreachable. info:
introspection failed.
Trait Implementations§
Source§impl Clone for ServerStatus
impl Clone for ServerStatus
Source§fn clone(&self) -> ServerStatus
fn clone(&self) -> ServerStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ServerStatus
Source§impl Debug for ServerStatus
impl Debug for ServerStatus
impl Eq for ServerStatus
Source§impl PartialEq for ServerStatus
impl PartialEq for ServerStatus
Source§impl Serialize for ServerStatus
impl Serialize for ServerStatus
impl StructuralPartialEq for ServerStatus
Auto Trait Implementations§
impl Freeze for ServerStatus
impl RefUnwindSafe for ServerStatus
impl Send for ServerStatus
impl Sync for ServerStatus
impl Unpin for ServerStatus
impl UnsafeUnpin for ServerStatus
impl UnwindSafe for ServerStatus
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<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
key and return true if they are equal.