Hmbown/CodeWhale · error

Refusing to {operation} MCP server '{server_name}' from plug

Error message

Refusing to {operation} MCP server '{server_name}' from plugin bundle `{}`: {reason}. {remediation}

What it means

Every operation on a plugin-contributed MCP server first verifies plugin component authority (trust state plus the required capability, e.g. stdio versus remote MCP). When verification fails, the operation is refused and the message embeds both the reason and a remediation string: /plugin reload, inspect /plugin show, repeat the displayed trust command, then /plugin enable before retrying.

Source

Thrown at crates/tui/src/mcp.rs:729

    fn required_capability(&self) -> crate::plugins::activation::PluginActivationCapability {
        if self.approved_remote_endpoint.is_some() {
            crate::plugins::activation::PluginActivationCapability::McpRemote
        } else {
            crate::plugins::activation::PluginActivationCapability::McpStdio
        }
    }

    fn validate_before_use(&self, server_name: &str, operation: &str) -> Result<()> {
        let remediation = format!(
            "Run `/plugin reload`, inspect `/plugin show {0}`, then repeat the displayed trust command and `/plugin enable {0}` before retrying",
            self.authority.plugin_name
        );
        crate::plugins::registry::verify_plugin_component_authority(
            &self.authority,
            self.required_capability(),
        )
        .map_err(|reason| {
            anyhow::anyhow!(
                "Refusing to {operation} MCP server '{server_name}' from plugin bundle `{}`: {reason}. {remediation}",
                self.authority.plugin_name
            )
        })
    }

    fn validate_remote_endpoint(&self, server_name: &str, endpoint: &str) -> Result<()> {
        let (endpoint, origin) = reviewed_remote_endpoint_identity(endpoint)?;
        if self.approved_remote_endpoint.as_deref() != Some(endpoint.as_str())
            || self.approved_remote_origin.as_deref() != Some(origin.as_str())
        {
            anyhow::bail!(
                "Refusing MCP server '{server_name}': its remote endpoint no longer matches the reviewed plugin origin"
            );
        }
        Ok(())
    }

View on GitHub (pinned to 8880682c63)

Solutions

  1. Follow the embedded remediation exactly: /plugin reload, /plugin show <name>, repeat the displayed trust command, /plugin enable <name>, then retry
  2. Confirm the capability matches the server type: a remote endpoint needs the remote MCP capability, stdio needs stdio
  3. If authority records were wiped, redo the review from scratch rather than bypassing the check
  4. After major upgrades, reload and re-approve plugins so registry state matches bundle versions

Example fix

# error: Refusing to start MCP server 'x' from plugin bundle `p`: ...
/plugin reload
/plugin show p
# repeat the displayed trust command, then:
/plugin enable p
Defensive patterns

Strategy: validation

Validate before calling

// Gate feature usage on trust state before invoking MCP operations
fn plugin_ready(registry: &PluginRegistry, name: &str, cap: Capability) -> bool {
    registry.is_enabled(name) && registry.has_capability(name, cap)
}

Try / catch

// Parse the refusal; only the documented re-trust flow may clear it
if err.to_string().starts_with("Refusing to") {
    guide_user_through_retrust(name); // reload, show, trust, enable
    return retry_once();
}

Prevention

When it happens

Trigger: Plugin not trusted or not enabled; the granted capability does not match the operation (a plugin reviewed for stdio MCP used for a remote endpoint or vice versa); registry or authority records deleted, stale after an update, or the bundle identity changed since approval.

Common situations: Fresh installs before completing the trust flow, plugin updates resetting authority, partial restores of config directories, capability changes between plugin versions.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16). Data as JSON: /api/errors/f8d14831df95115e. Report an issue: GitHub.