pub struct ServerConfig {
pub transport: Option<TransportKind>,
pub command: Option<String>,
pub args: Vec<String>,
pub env: BTreeMap<String, String>,
pub url: Option<String>,
pub headers: BTreeMap<String, String>,
pub oauth: Option<OAuthClientConfig>,
pub enabled: bool,
pub approval: ApprovalPolicy,
}Expand description
Standard mcpServers.<name> entry compatible with Claude Code / Cursor configs.
Fields§
§transport: Option<TransportKind>§command: Option<String>§args: Vec<String>§env: BTreeMap<String, String>§url: Option<String>§headers: BTreeMap<String, String>§oauth: Option<OAuthClientConfig>§enabled: bool§approval: ApprovalPolicyImplementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn stdio(
command: impl Into<String>,
args: Vec<String>,
env: BTreeMap<String, String>,
approval: ApprovalPolicy,
) -> Self
pub fn stdio( command: impl Into<String>, args: Vec<String>, env: BTreeMap<String, String>, approval: ApprovalPolicy, ) -> Self
Creates a new stdio server configuration.
Sourcepub fn http(
url: impl Into<String>,
headers: BTreeMap<String, String>,
approval: ApprovalPolicy,
) -> Self
pub fn http( url: impl Into<String>, headers: BTreeMap<String, String>, approval: ApprovalPolicy, ) -> Self
Creates a new Streamable HTTP server configuration.
Sourcepub fn with_oauth(self, oauth: Option<OAuthClientConfig>) -> Self
pub fn with_oauth(self, oauth: Option<OAuthClientConfig>) -> Self
Attaches optional OAuth client settings to this server configuration.
Sourcepub fn resolve_transport_kind(
&self,
server_name: &str,
) -> Result<TransportKind, McpConfigError>
pub fn resolve_transport_kind( &self, server_name: &str, ) -> Result<TransportKind, McpConfigError>
Infers and validates the transport kind for this server entry.
Sourcepub fn trust_fingerprint(&self) -> String
pub fn trust_fingerprint(&self) -> String
Computes a deterministic SHA-256 fingerprint of the server’s executable definition and approval policy.
Sourcepub fn target_display(&self) -> String
pub fn target_display(&self) -> String
Short display target (URL for HTTP, command + args for stdio).
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§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<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
impl Eq for ServerConfig
Source§impl PartialEq for ServerConfig
impl PartialEq for ServerConfig
Source§impl Serialize for ServerConfig
impl Serialize for ServerConfig
impl StructuralPartialEq for ServerConfig
Auto Trait Implementations§
impl Forget for ServerConfig
impl Freeze for ServerConfigwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
impl Move for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfigwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
Compare self to
key and return true if they are equal.