pub enum McpServerEntry {
Simple(String),
Full {
url: String,
auth_header: Option<String>,
resource: Option<String>,
scopes: Option<Vec<String>>,
},
Stdio {
command: String,
args: Vec<String>,
env: HashMap<String, String>,
},
}Expand description
An MCP server entry: a bare URL string, a full HTTP config with auth, or a stdio command to spawn as a child process.
Supports backward-compatible TOML: bare strings ("http://...") deserialize
as Simple, inline tables with url ({ url = "...", auth_header = "..." })
as Full, and inline tables with command ({ command = "npx", args = [...] })
as Stdio.
Variants§
Simple(String)
Bare URL string (backward-compatible).
Full
Full HTTP entry with optional auth header.
Fields
Stdio
Stdio transport — spawn a child process communicating via stdin/stdout.
Implementations§
Source§impl McpServerEntry
impl McpServerEntry
Sourcepub fn auth_header(&self) -> Option<&str>
pub fn auth_header(&self) -> Option<&str>
Get the optional auth header value.
Sourcepub fn resource(&self) -> Option<&str>
pub fn resource(&self) -> Option<&str>
Get the RFC 8707 resource indicator (audience for token exchange).
Returns the explicit resource if set, otherwise falls back to the URL.
Sourcepub fn display_name(&self) -> String
pub fn display_name(&self) -> String
Human-readable description for logging.
Trait Implementations§
Source§impl Clone for McpServerEntry
impl Clone for McpServerEntry
Source§fn clone(&self) -> McpServerEntry
fn clone(&self) -> McpServerEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 McpServerEntry
impl Debug for McpServerEntry
Source§impl<'de> Deserialize<'de> for McpServerEntry
impl<'de> Deserialize<'de> for McpServerEntry
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for McpServerEntry
impl PartialEq for McpServerEntry
Source§fn eq(&self, other: &McpServerEntry) -> bool
fn eq(&self, other: &McpServerEntry) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for McpServerEntry
impl Serialize for McpServerEntry
impl StructuralPartialEq for McpServerEntry
Auto Trait Implementations§
impl Freeze for McpServerEntry
impl RefUnwindSafe for McpServerEntry
impl Send for McpServerEntry
impl Sync for McpServerEntry
impl Unpin for McpServerEntry
impl UnsafeUnpin for McpServerEntry
impl UnwindSafe for McpServerEntry
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