pub struct McpServerConfig {
pub name: String,
pub transport: McpTransport,
pub timeout_ms: u64,
pub allowed_tools: Option<Vec<String>>,
}Expand description
One MCP server.
{ "name": "fs", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/data"] }
{ "name": "remote", "url": "https://mcp.example.com/mcp", "bearer_token": "..." }Exactly one of command (stdio) or url (Streamable HTTP) must be present, and
transport-specific keys must match the chosen transport.
Fields§
§name: StringProvider name used to reference the server’s tools (<name> and mcp:<name>).
Optional when the config comes from a named map (McpServers).
transport: McpTransport§timeout_ms: u64Timeout for each request (connect handshake, list, call), in milliseconds.
Defaults to DEFAULT_TIMEOUT_MS.
allowed_tools: Option<Vec<String>>When set, only these tools are listed and callable.
Implementations§
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
Source§impl PartialEq for McpServerConfig
impl PartialEq for McpServerConfig
Source§impl Serialize for McpServerConfig
impl Serialize for McpServerConfig
impl StructuralPartialEq for McpServerConfig
Auto Trait Implementations§
impl Forget for McpServerConfig
impl Freeze for McpServerConfig
impl Move 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