pub struct McpServerConfig {
pub transport: Option<McpTransportKind>,
pub command: Option<String>,
pub args: Vec<String>,
pub env: Option<HashMap<String, String>>,
pub cwd: Option<String>,
pub url: Option<String>,
pub headers: Option<HashMap<String, String>>,
}Expand description
MCP server definition stored in config.
Stdio: command + args. Remote: url (+ optional type / headers).
Fields§
§transport: Option<McpTransportKind>Explicit transport (stdio | http | sse | auto).
command: Option<String>Command to spawn (stdio transport)
args: Vec<String>§env: Option<HashMap<String, String>>§cwd: Option<String>§url: Option<String>Remote MCP endpoint URL (Streamable HTTP or legacy SSE)
headers: Option<HashMap<String, String>>Implementations§
Source§impl McpServerConfig
impl McpServerConfig
pub fn resolved_transport(&self) -> Result<McpTransportKind, String>
Sourcepub fn stdio_problem(&self) -> Option<String>
pub fn stdio_problem(&self) -> Option<String>
Why this stdio entry cannot work, before anything is spawned: an
empty command, or a package runner (npx, uvx, …) given no
package in args, which waits for input until the connect times out.
pub fn is_remote(&self) -> bool
Trait Implementations§
Source§impl Clone for McpServerConfig
impl Clone for McpServerConfig
Source§impl Debug for McpServerConfig
impl Debug for McpServerConfig
Source§impl<'de> Deserialize<'de> for McpServerConfig
impl<'de> Deserialize<'de> for McpServerConfig
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
Auto Trait Implementations§
impl Freeze for McpServerConfig
impl RefUnwindSafe for McpServerConfig
impl Send for McpServerConfig
impl Sync for McpServerConfig
impl Unpin for McpServerConfig
impl UnsafeUnpin for McpServerConfig
impl UnwindSafe for McpServerConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more