pub struct ServerConfig {
pub command: String,
pub args: Vec<String>,
pub env: HashMap<String, String>,
pub cwd: Option<String>,
pub disabled: bool,
}Expand description
Configuration for a single MCP server.
Fields§
§command: StringCommand to execute (e.g., “npx”, “uvx”, “python”).
args: Vec<String>Arguments to pass to the command.
env: HashMap<String, String>Environment variables to set.
cwd: Option<String>Working directory for the server process.
disabled: boolWhether the server is disabled.
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn new(command: impl Into<String>) -> ServerConfig
pub fn new(command: impl Into<String>) -> ServerConfig
Creates a new server configuration.
Sourcepub fn with_args(
self,
args: impl IntoIterator<Item = impl Into<String>>,
) -> ServerConfig
pub fn with_args( self, args: impl IntoIterator<Item = impl Into<String>>, ) -> ServerConfig
Adds arguments.
Sourcepub fn with_env(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> ServerConfig
pub fn with_env( self, key: impl Into<String>, value: impl Into<String>, ) -> ServerConfig
Adds an environment variable.
Sourcepub fn with_cwd(self, cwd: impl Into<String>) -> ServerConfig
pub fn with_cwd(self, cwd: impl Into<String>) -> ServerConfig
Sets the working directory.
Sourcepub fn disabled(self) -> ServerConfig
pub fn disabled(self) -> ServerConfig
Sets the disabled flag.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
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 ServerConfig
impl Debug for ServerConfig
Source§impl<'de> Deserialize<'de> for ServerConfig
impl<'de> Deserialize<'de> for ServerConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ServerConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ServerConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ServerConfig
impl Serialize for ServerConfig
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
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnwindSafe for ServerConfig
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).