MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / remove_mcp_auth

Method remove_mcp_auth

crates/opencode-tui/src/api.rs:536–554  ·  view source on GitHub ↗
(&self, name: &str)

Source from the content-addressed store, hash-verified

534 }
535
536 pub fn remove_mcp_auth(&self, name: &str) -> anyhow::Result<bool> {
537 let url = format!("{}/mcp/{}/auth", self.base_url, name);
538 let response = self.client.delete(&url).send()?;
539 if !response.status().is_success() {
540 let status = response.status();
541 let text = response.text().unwrap_or_default();
542 anyhow::bail!(
543 "Failed to remove MCP auth `{}`: {} - {}",
544 name,
545 status,
546 text
547 );
548 }
549 let value = response.json::<serde_json::Value>()?;
550 Ok(value
551 .get("success")
552 .and_then(|v| v.as_bool())
553 .unwrap_or(true))
554 }
555
556 pub fn connect_mcp(&self, name: &str) -> anyhow::Result<bool> {
557 let url = format!("{}/mcp/{}/connect", self.base_url, name);

Callers 1

handle_dialog_keyMethod · 0.80

Calls 5

sendMethod · 0.45
deleteMethod · 0.45
statusMethod · 0.45
textMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected