{"record":{"id":"2495292213c14de2","repo":"Hmbown/CodeWhale","slug":"unsupported-mcp-transport","errorCode":null,"errorMessage":"Unsupported MCP transport","messagePattern":"Unsupported MCP transport","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/mcp/external_import.rs","lineNumber":218,"sourceCode":"        if let Some(command) = &server.command {\n            anyhow::ensure!(\n                !command.trim().is_empty() && !command.chars().any(char::is_control),\n                \"Invalid MCP command\"\n            );\n        }\n        if let Some(url) = &server.url {\n            let parsed =\n                reqwest::Url::parse(url).map_err(|_| anyhow::anyhow!(\"Invalid MCP URL\"))?;\n            anyhow::ensure!(\n                matches!(parsed.scheme(), \"http\" | \"https\")\n                    && parsed.host_str().is_some()\n                    && parsed.username().is_empty()\n                    && parsed.password().is_none(),\n                \"Unsupported MCP URL\"\n            );\n        }\n        super::validate_mcp_transport(server.transport.as_deref())\n            .map_err(|_| anyhow::anyhow!(\"Unsupported MCP transport\"))?;\n        let hard_blocked = !server.is_enabled();\n        out.push(ImportCandidate {\n            summary: server_summary(&name, &server),\n            name,\n            source_kind: kind.clone(),\n            source_path: path.to_path_buf(),\n            content_hash: hash.clone(),\n            hard_blocked,\n            block_reason: hard_blocked.then(|| \"Disabled at its source; cannot import\".into()),\n            server,\n        });\n    }\n    Ok(out)\n}\n\nfn extract_servers_map(value: &Value) -> Vec<(String, Value)> {\n    // Claude / team: { \"mcpServers\": { name: {...} } }\n    // Marketplace catalog: { \"servers\": { name: {...} } } or array of {name, ...}","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/mcp/external_import.rs#L200-L236","documentation":"After target validation, the entry's optional `transport` field is checked with validate_mcp_transport; a value outside the supported set is rejected. The mapped error hides the unsupported value so untrusted source content is never echoed.","triggerScenarios":"An entry contains `transport` with a value the tool does not support, e.g. `\"stdio\"` on a url-based entry, `\"websocket\"`, or a typo like `\"streamable_http\"`.","commonSituations":"Copying entries from other MCP clients that support additional transports; case or spelling differences (\"SSE\" vs \"sse\"); mixing transport and target kinds the tool doesn't allow.","solutions":["Set transport to a supported value (omit it entirely for command/stdio entries; use a supported HTTP transport for url entries)","Check the tool's documentation for the exact accepted transport strings (case-sensitive)","Remove the transport field and let the tool infer it from command vs url"],"exampleFix":"// before\n{\"mcpServers\":{\"api\":{\"url\":\"https://mcp.example.com\",\"transport\":\"websocket\"}}}\n// after\n{\"mcpServers\":{\"api\":{\"url\":\"https://mcp.example.com\",\"transport\":\"sse\"}}}","handlingStrategy":"validation","validationCode":"const SUPPORTED = new Set([\"sse\",\"streamable-http\"]); // confirm exact values in tool docs\nfunction transportOk(t) { return t == null || SUPPORTED.has(t); }","typeGuard":null,"tryCatchPattern":"catch, then compare the entry's transport string (case-sensitively) against the documented set","preventionTips":["Omit `transport` for command entries and let the tool infer it","Copy transport values verbatim from the tool's docs, matching case","Drop transport fields copied from other clients"],"tags":["mcp","transport","config-validation"],"backgroundTag":"unsupported-enum-value","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"}