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

Method start_mcp_auth

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

Source from the content-addressed store, hash-verified

507 }
508
509 pub fn start_mcp_auth(&self, name: &str) -> anyhow::Result<McpAuthStartInfo> {
510 let url = format!("{}/mcp/{}/auth", self.base_url, name);
511 let response = self.client.post(&url).send()?;
512 if !response.status().is_success() {
513 let status = response.status();
514 let text = response.text().unwrap_or_default();
515 anyhow::bail!("Failed to start MCP auth `{}`: {} - {}", name, status, text);
516 }
517 Ok(response.json::<McpAuthStartInfo>()?)
518 }
519
520 pub fn authenticate_mcp(&self, name: &str) -> anyhow::Result<McpStatusInfo> {
521 let url = format!("{}/mcp/{}/auth/authenticate", self.base_url, name);

Callers 1

handle_dialog_keyMethod · 0.80

Calls 3

sendMethod · 0.45
statusMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected