pub struct McpConfig {
pub servers: HashMap<String, McpServerConfig>,
pub settings: McpSettings,
}Expand description
MCP 配置文件
Fields§
§servers: HashMap<String, McpServerConfig>MCP 服务器配置
settings: McpSettings全局设置
Implementations§
Source§impl McpConfig
impl McpConfig
Sourcepub fn add_server(self, key: impl Into<String>, config: McpServerConfig) -> Self
pub fn add_server(self, key: impl Into<String>, config: McpServerConfig) -> Self
添加服务器配置
Sourcepub fn enabled_servers(&self) -> Vec<(String, &McpServerConfig)>
pub fn enabled_servers(&self) -> Vec<(String, &McpServerConfig)>
获取所有启用的服务器配置
Trait Implementations§
Source§impl<'de> Deserialize<'de> for McpConfig
impl<'de> Deserialize<'de> for McpConfig
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 McpConfig
impl RefUnwindSafe for McpConfig
impl Send for McpConfig
impl Sync for McpConfig
impl Unpin for McpConfig
impl UnsafeUnpin for McpConfig
impl UnwindSafe for McpConfig
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