pub struct McpRunner { /* private fields */ }
Expand description
Configure and run MCP servers
This struct is the main entry point for managing MCP server lifecycles
and obtaining clients to interact with them.
All public methods are instrumented with tracing
spans.
Implementations§
Source§impl McpRunner
impl McpRunner
Sourcepub fn from_config_file(path: impl AsRef<Path>) -> Result<Self>
pub fn from_config_file(path: impl AsRef<Path>) -> Result<Self>
Create a new MCP runner from a configuration file path
This method is instrumented with tracing
.
Sourcepub fn from_config_str(config: &str) -> Result<Self>
pub fn from_config_str(config: &str) -> Result<Self>
Create a new MCP runner from a configuration string
This method is instrumented with tracing
.
Sourcepub fn new(config: Config) -> Self
pub fn new(config: Config) -> Self
Create a new MCP runner from a configuration
This method is instrumented with tracing
.
Sourcepub async fn start_server(&mut self, name: &str) -> Result<ServerId>
pub async fn start_server(&mut self, name: &str) -> Result<ServerId>
Start a specific MCP server
This method is instrumented with tracing
.
Sourcepub async fn start_all_servers(&mut self) -> Result<Vec<ServerId>>
pub async fn start_all_servers(&mut self) -> Result<Vec<ServerId>>
Start all configured servers
This method is instrumented with tracing
.
Sourcepub async fn stop_server(&mut self, id: ServerId) -> Result<()>
pub async fn stop_server(&mut self, id: ServerId) -> Result<()>
Stop a running server
This method is instrumented with tracing
.
Sourcepub fn server_status(&self, id: ServerId) -> Result<ServerStatus>
pub fn server_status(&self, id: ServerId) -> Result<ServerStatus>
Get server status
This method is instrumented with tracing
.
Sourcepub fn get_server_id(&self, name: &str) -> Result<ServerId>
pub fn get_server_id(&self, name: &str) -> Result<ServerId>
Get server ID by name
This method is instrumented with tracing
.
Sourcepub fn get_client(&mut self, id: ServerId) -> Result<McpClient>
pub fn get_client(&mut self, id: ServerId) -> Result<McpClient>
Get a client for a server
This method is instrumented with tracing
.