{"record":{"id":"a2271b8c8ed30a2c","repo":"Hmbown/CodeWhale","slug":"reviewed-plugin-mcp-server-returned-an-error-in","errorCode":null,"errorMessage":"Reviewed plugin MCP server returned an error in '{method}' (server details suppressed to protect environment-backed credentials)","messagePattern":"Reviewed plugin MCP server returned an error in '(.+?)' \\(server details suppressed to protect environment-backed credentials\\)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/mcp.rs","lineNumber":1227,"sourceCode":"impl McpServerCapabilities {\n    fn from_initialize_response(response: &serde_json::Value) -> Option<Self> {\n        let capabilities = response.get(\"result\")?.get(\"capabilities\")?.as_object()?;\n        Some(Self {\n            tools: capabilities.contains_key(\"tools\"),\n            resources: capabilities.contains_key(\"resources\"),\n            prompts: capabilities.contains_key(\"prompts\"),\n        })\n    }\n}\n\nfn response_result<'a>(\n    response: &'a serde_json::Value,\n    method: &str,\n    suppress_server_details: bool,\n) -> Result<Option<&'a serde_json::Value>> {\n    if let Some(error) = response.get(\"error\") {\n        if suppress_server_details {\n            anyhow::bail!(\n                \"Reviewed plugin MCP server returned an error in '{method}' (server details suppressed to protect environment-backed credentials)\"\n            );\n        }\n        anyhow::bail!(\"MCP error in '{method}': {error}\");\n    }\n    Ok(response.get(\"result\"))\n}\n\nasync fn run_optional_discovery<F>(server: &str, method: &str, timeout: Duration, discovery: F)\nwhere\n    F: Future<Output = Result<()>>,\n{\n    match tokio::time::timeout(timeout, discovery).await {\n        Ok(Ok(())) => {}\n        Ok(Err(error)) => {\n            tracing::warn!(\n                target: \"mcp\",\n                server,","sourceCodeStart":1209,"sourceCodeEnd":1245,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/mcp.rs#L1209-L1245","documentation":"response_result inspects every JSON-RPC response for an `error` member during initialize and catalogue discovery (tools/list, resources/list, resources/templates/list, prompts/list). When the server belongs to a reviewed plugin, the error body is dropped and replaced with this generic message (crates/tui/src/mcp.rs:1225-1230), because a reviewed plugin may hold environment-backed credentials whose values could be echoed in server error text. The method name is kept; the payload is not.","triggerScenarios":"The reviewed plugin's remote MCP server returns a JSON-RPC error for initialize or one of the */list discovery calls: bad path, expired or insufficient token, a 4xx/5xx mapped to a protocol error, or an unimplemented method.","commonSituations":"Provider endpoint rotated or credentials expired after the plugin was trusted; server version drift; scopes missing for catalogue methods.","solutions":["Check the plugin MCP server's own logs - the suppressed detail exists only there.","Temporarily register the same endpoint as a plain (non-reviewed) MCP server to see the full `MCP error in '...'` body, then remove it.","Verify the endpoint and credentials out-of-band (curl the MCP endpoint) and fix the server.","After fixing server-side state, retry; re-trust only if the plugin's own bytes changed."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if let Err(err) = initialize_and_discover(&mut conn).await {\n    if err.to_string().starts_with(\"Reviewed plugin MCP server returned an error\") {\n        // Detail is intentionally suppressed; the answer lives in the plugin\n        // server's own logs, not in this error chain.\n        tracing::warn!(server = %name, \"reviewed plugin server error; check server-side logs\");\n    }\n    return Err(err);\n}","preventionTips":["Keep plugin MCP server logs reachable where you run the TUI.","Test reviewed plugins against a staging endpoint before trusting.","Keep server-side credentials/endpoint current so discovery methods succeed."],"tags":["mcp","jsonrpc","plugin","error-suppression"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}