{"record":{"id":"f8d14831df95115e","repo":"Hmbown/CodeWhale","slug":"refusing-to-operation-mcp-server-server-name","errorCode":null,"errorMessage":"Refusing to {operation} MCP server '{server_name}' from plugin bundle `{}`: {reason}. {remediation}","messagePattern":"Refusing to (.+?) MCP server '(.+?)' from plugin bundle `(.+?)`: (.+?)\\. (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/mcp.rs","lineNumber":729,"sourceCode":"    fn required_capability(&self) -> crate::plugins::activation::PluginActivationCapability {\n        if self.approved_remote_endpoint.is_some() {\n            crate::plugins::activation::PluginActivationCapability::McpRemote\n        } else {\n            crate::plugins::activation::PluginActivationCapability::McpStdio\n        }\n    }\n\n    fn validate_before_use(&self, server_name: &str, operation: &str) -> Result<()> {\n        let remediation = format!(\n            \"Run `/plugin reload`, inspect `/plugin show {0}`, then repeat the displayed trust command and `/plugin enable {0}` before retrying\",\n            self.authority.plugin_name\n        );\n        crate::plugins::registry::verify_plugin_component_authority(\n            &self.authority,\n            self.required_capability(),\n        )\n        .map_err(|reason| {\n            anyhow::anyhow!(\n                \"Refusing to {operation} MCP server '{server_name}' from plugin bundle `{}`: {reason}. {remediation}\",\n                self.authority.plugin_name\n            )\n        })\n    }\n\n    fn validate_remote_endpoint(&self, server_name: &str, endpoint: &str) -> Result<()> {\n        let (endpoint, origin) = reviewed_remote_endpoint_identity(endpoint)?;\n        if self.approved_remote_endpoint.as_deref() != Some(endpoint.as_str())\n            || self.approved_remote_origin.as_deref() != Some(origin.as_str())\n        {\n            anyhow::bail!(\n                \"Refusing MCP server '{server_name}': its remote endpoint no longer matches the reviewed plugin origin\"\n            );\n        }\n        Ok(())\n    }\n","sourceCodeStart":711,"sourceCodeEnd":747,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/mcp.rs#L711-L747","documentation":"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.","triggerScenarios":"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.","commonSituations":"Fresh installs before completing the trust flow, plugin updates resetting authority, partial restores of config directories, capability changes between plugin versions.","solutions":["Follow the embedded remediation exactly: /plugin reload, /plugin show <name>, repeat the displayed trust command, /plugin enable <name>, then retry","Confirm the capability matches the server type: a remote endpoint needs the remote MCP capability, stdio needs stdio","If authority records were wiped, redo the review from scratch rather than bypassing the check","After major upgrades, reload and re-approve plugins so registry state matches bundle versions"],"exampleFix":"# error: Refusing to start MCP server 'x' from plugin bundle `p`: ...\n/plugin reload\n/plugin show p\n# repeat the displayed trust command, then:\n/plugin enable p","handlingStrategy":"validation","validationCode":"// Gate feature usage on trust state before invoking MCP operations\nfn plugin_ready(registry: &PluginRegistry, name: &str, cap: Capability) -> bool {\n    registry.is_enabled(name) && registry.has_capability(name, cap)\n}","typeGuard":null,"tryCatchPattern":"// Parse the refusal; only the documented re-trust flow may clear it\nif err.to_string().starts_with(\"Refusing to\") {\n    guide_user_through_retrust(name); // reload, show, trust, enable\n    return retry_once();\n}","preventionTips":["Complete the review/trust/enable flow immediately after installing or updating plugins","Keep plugin registry state versioned alongside the bundles","Never catch-and-continue on authority refusals; they gate a security boundary","Automate /plugin reload in deploy scripts after plugin updates"],"tags":["plugin","mcp","security","trust","authority"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}