1use crate::CliError;
4use std::path::PathBuf;
5
6pub mod config;
7pub mod server;
8
9pub use config::*;
10pub use server::*;
11
12pub async fn handle_mcp_start(
14 bind: String,
15 transport: String,
16 config: Option<PathBuf>,
17 verbose: bool,
18 background: bool,
19) -> Result<(), CliError> {
20 if background {
21 start_mcp_server_background(bind, transport, config, verbose).await
22 } else {
23 start_mcp_server_foreground(bind, transport, config, verbose).await
24 }
25}
26
27pub async fn handle_mcp_stop(force: bool) -> Result<(), CliError> {
29 stop_mcp_server(force).await
30}
31
32pub async fn handle_mcp_status() -> Result<(), CliError> {
34 show_mcp_server_status().await
35}
36
37pub async fn handle_mcp_config_show() -> Result<(), CliError> {
39 show_mcp_config().await
40}
41
42pub async fn handle_mcp_config_init(output: Option<PathBuf>, force: bool) -> Result<(), CliError> {
44 init_mcp_config(output, force).await
45}
46
47pub async fn handle_mcp_config_validate(config_path: PathBuf) -> Result<(), CliError> {
49 validate_mcp_config(config_path).await
50}
51
52pub async fn handle_mcp_tools() -> Result<(), CliError> {
54 list_mcp_tools().await
55}
56
57pub async fn handle_mcp_resources() -> Result<(), CliError> {
59 list_mcp_resources().await
60}
61
62pub async fn handle_mcp_test(endpoint: String) -> Result<(), CliError> {
64 test_mcp_server(endpoint).await
65}