{"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":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":8624,"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":8606,"sourceCodeEnd":8642,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/lib.rs#L8606-L8642","documentation":"Argument validation for `mcp add`: neither --command (stdio transport) nor --url (remote transport) was supplied, so the server definition has nothing to connect to. Exactly one of the two must be present.","triggerScenarios":"`codewhale mcp add my-server` with neither --command nor --url; flags lost to shell quoting or a typo'd flag name.","commonSituations":"Copy/pasting multi-line examples that dropped the flag line; forgetting which field the new server needs; unquoted multi-word commands splitting into positional args.","solutions":["Add --command \"npx -y @some/mcp-server .\" for a local server, or --url https://host/sse for a remote one","Check `codewhale mcp add --help` for exact flag names","Quote multi-word commands as one argument"],"exampleFix":"# before\ncodewhale mcp add fs\n# Provide either --command or --url for `mcp add`.\n\n# after\ncodewhale mcp add fs --command \"npx -y @modelcontextprotocol/server-filesystem $PWD\"","handlingStrategy":"validation","validationCode":"# before wrapping `codewhale mcp add` in a script:\n[ -n \"$SERVER_CMD\" ] || [ -n \"$SERVER_URL\" ] || { echo 'need --command or --url'; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build mcp add invocations from variables you have already asserted are set","Quote the full server command as a single shell string"],"tags":["mcp","cli-usage","argument-validation"],"backgroundTag":"missing-required-argument","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}