metis_docs_cli/commands/mcp.rs
1use anyhow::Result;
2use clap::Args;
3
4#[derive(Args)]
5pub struct McpCommand {
6 /// Log level for the MCP server (trace, debug, info, warn, error)
7 #[arg(long, default_value = "info")]
8 pub log_level: String,
9}
10
11impl McpCommand {
12 pub async fn execute(&self) -> Result<()> {
13 // Set the log level environment variable
14 std::env::set_var("METIS_LOG_LEVEL", &self.log_level);
15
16 // Call the MCP server main function directly
17 metis_mcp_server::run().await
18 }
19}