1pub mod client;
10pub mod discovery;
11pub mod server;
12pub mod tool_bridge;
13pub mod transport;
14
15pub use client::McpClient;
16pub use discovery::discover_tools;
17pub use tool_bridge::McpTool;
18pub use transport::{Framing, StdioTransport, Transport};
19
20use serde::{Deserialize, Serialize};
21
22#[derive(Debug, Clone, Serialize, Deserialize)]
24pub struct McpServerConfig {
25 pub name: String,
27 pub command: String,
29 #[serde(default)]
31 pub args: Vec<String>,
32 #[serde(default)]
34 pub env: std::collections::HashMap<String, String>,
35 #[serde(default = "default_init_timeout")]
37 pub init_timeout_secs: u64,
38 #[serde(default)]
41 pub framing: Framing,
42}
43
44fn default_init_timeout() -> u64 {
45 30
46}
47
48#[derive(Debug, Clone, Default, Serialize, Deserialize)]
50pub struct McpConfig {
51 #[serde(default)]
53 pub servers: Vec<McpServerConfig>,
54}
55
56#[cfg(test)]
57#[path = "../../tests/unit/mcp/mod_test.rs"]
58mod tests;