(&self)
| 488 | } |
| 489 | |
| 490 | pub fn get_mcp_status(&self) -> anyhow::Result<Vec<McpStatusInfo>> { |
| 491 | let url = format!("{}/mcp", self.base_url); |
| 492 | |
| 493 | let response = self.client.get(&url).send()?; |
| 494 | |
| 495 | if !response.status().is_success() { |
| 496 | let status = response.status(); |
| 497 | let text = response.text().unwrap_or_default(); |
| 498 | anyhow::bail!("Failed to fetch MCP status: {} - {}", status, text); |
| 499 | } |
| 500 | |
| 501 | let mut servers: Vec<McpStatusInfo> = response |
| 502 | .json::<HashMap<String, McpStatusInfo>>()? |
| 503 | .into_values() |
| 504 | .collect(); |
| 505 | servers.sort_by(|a, b| a.name.cmp(&b.name)); |
| 506 | Ok(servers) |
| 507 | } |
| 508 | |
| 509 | pub fn start_mcp_auth(&self, name: &str) -> anyhow::Result<McpAuthStartInfo> { |
| 510 | let url = format!("{}/mcp/{}/auth", self.base_url, name); |
no test coverage detected