| 139 | |
| 140 | impl McpClient { |
| 141 | pub fn new(server_name: String, tool_registry: Arc<McpToolRegistry>) -> Self { |
| 142 | Self { |
| 143 | server_name, |
| 144 | transport: Mutex::new(None), |
| 145 | request_id: AtomicU64::new(0), |
| 146 | initialized: RwLock::new(false), |
| 147 | capabilities: RwLock::new(None), |
| 148 | tool_registry, |
| 149 | timeout_ms: 30000, |
| 150 | status: RwLock::new(McpStatus::Disabled), |
| 151 | oauth_manager: RwLock::new(None), |
| 152 | bus: None, |
| 153 | tools_changed: std::sync::atomic::AtomicBool::new(false), |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | pub fn with_timeout(mut self, timeout_ms: u64) -> Self { |
| 158 | self.timeout_ms = timeout_ms; |