MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / get_mcp_status

Function get_mcp_status

crates/opencode-server/src/routes.rs:2525–2538  ·  view source on GitHub ↗
(
    State(_state): State<Arc<ServerState>>,
)

Source from the content-addressed store, hash-verified

2523}
2524
2525async fn get_mcp_status(
2526 State(_state): State<Arc<ServerState>>,
2527) -> Json<HashMap<String, McpStatusInfo>> {
2528 let manager = get_mcp_oauth_manager();
2529 if let Err(error) = sync_mcp_from_disk(manager).await {
2530 tracing::warn!(%error, "failed to sync MCP servers from config");
2531 }
2532 let servers = manager.list_servers().await;
2533 let mut result = HashMap::new();
2534 for server in servers {
2535 result.insert(server.name.clone(), McpStatusInfo::from(server));
2536 }
2537 Json(result)
2538}
2539
2540#[derive(Debug, Deserialize)]
2541pub struct AddMcpRequest {

Callers

nothing calls this directly

Calls 5

get_mcp_oauth_managerFunction · 0.85
sync_mcp_from_diskFunction · 0.85
newFunction · 0.85
list_serversMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected