{"record":{"id":"1eeefce162ddcf19","repo":"Hmbown/CodeWhale","slug":"mcp-server-name-config-must-have-either-comma","errorCode":null,"errorMessage":"MCP server '{name}' config must have either 'command' or 'url'","messagePattern":"MCP server '(.+?)' config must have either 'command' or 'url'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/mcp.rs","lineNumber":1816,"sourceCode":"                if let Err(e) = http.try_establish_session().await {\n                    tracing::debug!(\n                        target: \"mcp\",\n                        server = %name,\n                        error = %e,\n                        \"session-establishment GET skipped; proceeding with POST initialize\"\n                    );\n                }\n                Box::new(http)\n            }\n        } else if let Some(command) = &config.command {\n            Box::new(StdioTransport::spawn(\n                &name,\n                command,\n                &config,\n                cancel_token.clone(),\n            )?)\n        } else {\n            anyhow::bail!(\"MCP server '{name}' config must have either 'command' or 'url'\");\n        };\n        // Revalidate after transport construction as well: remote setup may\n        // await DNS/TLS/SSE preflight, and a concurrent process can revoke the\n        // receipt during that interval. Initialization and catalog discovery\n        // never start under a stale generation.\n        if let Some(source) = config.reviewed_plugin.as_ref() {\n            source.validate_before_use(&name, \"initialize\")?;\n        }\n        let authority_watch = authority_watch.map(PendingAuthorityWatch::disarm);\n\n        let mut conn = Self {\n            name: name.clone(),\n            transport,\n            tools: Vec::new(),\n            resources: Vec::new(),\n            resource_templates: Vec::new(),\n            prompts: Vec::new(),\n            request_id: AtomicU64::new(1),","sourceCodeStart":1798,"sourceCodeEnd":1834,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/mcp.rs#L1798-L1834","documentation":"Every MCP server config must specify exactly one launch mechanism: a local 'command' (stdio transport) or a remote 'url' (HTTP/SSE transport). When neither field is present the server cannot be constructed, and the setup bails naming the server.","triggerScenarios":"Defining an MCP server entry that lacks both 'command' and 'url'; e.g. an entry with only 'name'/'headers'/'env' or an empty object in the mcpServers map.","commonSituations":"Copy-pasting a config fragment and dropping the command/url line; YAML/TOML nesting mistakes that put command under the wrong key; a partially edited config saved mid-way.","solutions":["Add a 'command' array for a local stdio server","Add a 'url' string for a remote HTTP/SSE server","Validate the mcpServers config structure (each entry needs exactly one of command/url)","Check nesting/indentation so the field actually lands on the server entry"],"exampleFix":"// before\n[config.mcpServers.myserver]\nenv = { API_KEY = \"...\" }\n// after\n[config.mcpServers.myserver]\ncommand = \"npx\"\nargs = [\"-y\", \"@modelcontextprotocol/server-xyz\"]\nenv = { API_KEY = \"...\" }","handlingStrategy":"validation","validationCode":"for (name, cfg) in &config.mcpServers {\n    if cfg.command.is_none() && cfg.url.is_none() {\n        return Err(format!(\"MCP server '{name}' needs either 'command' or 'url'\"));\n    }\n}","typeGuard":"fn is_launchable(cfg: &McpServerConfig) -> bool {\n    cfg.command.is_some() || cfg.url.is_some()\n}","tryCatchPattern":null,"preventionTips":["Validate mcpServers entries at config load","Template new server entries with command/url pre-filled","Watch for indentation mistakes in TOML/YAML configs"],"tags":["mcp","config","missing-field"],"backgroundTag":"missing-required-config-field","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"}