MCPcopy Create free account
hub / github.com/AI45Lab/Code / get_status

Method get_status

core/src/mcp/manager.rs:356–383  ·  view source on GitHub ↗

Get status of all servers

(&self)

Source from the content-addressed store, hash-verified

354
355 /// Get status of all servers
356 pub async fn get_status(&self) -> HashMap<String, McpServerStatus> {
357 let configs = self.configs.read().await;
358 let clients = self.clients.read().await;
359 let errors = self.connect_errors.read().await;
360 let mut status = HashMap::new();
361
362 for (name, config) in configs.iter() {
363 let client = clients.get(name);
364 let (connected, tool_count) = if let Some(c) = client {
365 (c.is_connected(), c.get_cached_tools().await.len())
366 } else {
367 (false, 0)
368 };
369
370 status.insert(
371 name.clone(),
372 McpServerStatus {
373 name: name.clone(),
374 connected,
375 enabled: config.enabled,
376 tool_count,
377 error: errors.get(name).cloned(),
378 },
379 );
380 }
381
382 status
383 }
384
385 /// Get a specific client
386 pub async fn get_client(&self, name: &str) -> Option<Arc<McpClient>> {

Calls 6

get_cached_toolsMethod · 0.80
getMethod · 0.45
is_connectedMethod · 0.45
lenMethod · 0.45
insertMethod · 0.45
cloneMethod · 0.45