{"record":{"id":"6dc87dcb2c78c96c","repo":"Hmbown/CodeWhale","slug":"refusing-mcp-server-server-name-its-remote-en","errorCode":null,"errorMessage":"Refusing MCP server '{server_name}': its remote endpoint no longer matches the reviewed plugin origin","messagePattern":"Refusing MCP server '(.+?)': its remote endpoint no longer matches the reviewed plugin origin","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/mcp.rs","lineNumber":784,"sourceCode":"        );\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\n    fn catalog_is_current(&self) -> bool {\n        // Catalog exposure is an authority boundary too: stale tool, prompt,\n        // or resource descriptions can steer the model even when the later\n        // operation would be denied. Revalidate both the mutable reviewed\n        // source and the Codewhale-owned stage before publishing any entry.\n        crate::plugins::registry::verify_plugin_component_authority(\n            &self.authority,\n            self.required_capability(),\n        )\n        .is_ok()\n    }\n}","sourceCodeStart":766,"sourceCodeEnd":802,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/mcp.rs#L766-L802","documentation":"validate_remote_endpoint re-derives the reviewed plugin's remote MCP endpoint identity (canonical URL + origin) and compares it against what the user approved. This error is thrown when the endpoint or its origin differs from the approved values, i.e. the reviewed plugin now points somewhere it was not reviewed to point. It is a security tripwire preventing reviewed plugins from silently redirecting to a different remote server.","triggerScenarios":"validate_remote_endpoint is called when launching a reviewed-plugin MCP server; it bails when approved_remote_endpoint != canonical endpoint string or approved_remote_origin != derived origin. Any change to the plugin's declared remote URL after review triggers it.","commonSituations":"The plugin was updated upstream and changed its endpoint URL; the user edited the endpoint manually; URL canonicalization changes the stored string (scheme casing, default port, path normalization) so it no longer byte-matches the approved value.","solutions":["Re-review the plugin: remove it and re-approve the plugin with its new remote endpoint so the approved identity matches","Verify the new endpoint is legitimate (check the plugin vendor) before re-approving — a changed endpoint can indicate a supply-chain compromise","Restore the original endpoint value in the MCP server configuration to match what was reviewed"],"exampleFix":"// before\n\"endpoint\": \"https://api.newhost.example/mcp\"  // no longer matches approved origin\n// after\n\"endpoint\": \"https://api.reviewedhost.example/mcp\"  // matches approved_remote_endpoint/origin, or re-approve the plugin","handlingStrategy":"validation","validationCode":"fn endpoint_matches_approved(endpoint: &str, approved_endpoint: &str, approved_origin: &str) -> bool {\n    let url = reqwest::Url::parse(endpoint).ok()?;\n    if !url.username().is_empty() || url.password().is_some() { return false; }\n    if url.query().is_some() || url.fragment().is_some() { return false; }\n    url.as_str() == approved_endpoint\n        && url.origin().ascii_serialization() == approved_origin\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin plugins to reviewed versions so endpoint changes force explicit re-review","Diff a plugin update's endpoint against the approved origin before accepting it","Store the approved endpoint in version control alongside the plugin config to notice drift"],"tags":["security","mcp","endpoint-mismatch","plugin-review"],"backgroundTag":"invalid-url","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}