{"record":{"id":"0a75d3c0f04f8243","repo":"Hmbown/CodeWhale","slug":"provide-either-command-or-url-for-mcp-add","errorCode":null,"errorMessage":"Provide either --command or --url for `mcp add`.","messagePattern":"Provide either --command or --url for `mcp add`\\.","errorType":"error_code","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":10130,"sourceCode":"                        );\n                    }\n                }\n            }\n            Ok(())\n        }\n        McpCommand::Add {\n            name,\n            command,\n            url,\n            transport,\n            bearer_token_env_var,\n            oauth_client_id,\n            oauth_resource,\n            scopes,\n            args,\n        } => {\n            if command.is_none() && url.is_none() {\n                bail!(\"Provide either --command or --url for `mcp add`.\");\n            }\n            if let Some(transport) = transport.as_deref()\n                && !transport.trim().eq_ignore_ascii_case(\"sse\")\n            {\n                bail!(\"Unsupported MCP transport '{transport}'. Supported values: sse\");\n            }\n            let added_server = McpServerConfig {\n                command,\n                args,\n                env: std::collections::HashMap::new(),\n                cwd: None,\n                url,\n                transport,\n                connect_timeout: None,\n                execute_timeout: None,\n                read_timeout: None,\n                disabled: false,\n                enabled: true,","sourceCodeStart":10112,"sourceCodeEnd":10148,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lib.rs#L10112-L10148","documentation":"`codewhale mcp add` requires the MCP server to be defined either as a local command (--command) or a remote URL (--url). If both are absent, the configuration would be meaningless, so the CLI bails with this validation error.","triggerScenarios":"Running `codewhale mcp add <name>` (with only a name and possibly env/scopes) without --command or --url.","commonSituations":"Copy-pasting an add command from docs and dropping the flags; assuming a name alone is enough; writing a script that builds the command conditionally and skips both options.","solutions":["Add `--command <cmd> [args...]` for a stdio MCP server","Add `--url <https://...>` for a remote (SSE) MCP server","Re-check the intended server config and pass exactly one of the two"],"exampleFix":"// before\ncodewhale mcp add myserver\n// after\ncodewhale mcp add myserver --command npx -- some-mcp-server","handlingStrategy":"validation","validationCode":"if command.is_none() && url.is_none() {\n    eprintln!(\"mcp add needs --command or --url\");\n    std::process::exit(2);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat --command or --url as required for `mcp add` in scripts and docs","Use shell completion/help text to discover required flags","Validate the constructed CLI args in CI scripts before invoking"],"tags":["cli","mcp","validation","arguments"],"backgroundTag":"missing-required-flag","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"}