{"record":{"id":"df9488f7aa6ea3b7","repo":"Kuberwastaken/claurst","slug":"mcpservers-name-is-missing-command-url","errorCode":null,"errorMessage":"mcpServers.{name} is missing command/url","messagePattern":"mcpServers\\.(.+?) is missing command/url","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-rust/crates/core/src/import_config.rs","lineNumber":663,"sourceCode":"    let Some(obj) = value.as_object() else {\n        return Err(anyhow!(\"mcpServers must be an object\"));\n    };\n\n    let mut servers = Vec::new();\n    for (name, entry) in obj {\n        let entry_obj = entry\n            .as_object()\n            .ok_or_else(|| anyhow!(\"mcpServers.{name} must be an object\"))?;\n        let command = entry_obj\n            .get(\"command\")\n            .and_then(Value::as_str)\n            .map(ToString::to_string);\n        let url = entry_obj\n            .get(\"url\")\n            .and_then(Value::as_str)\n            .map(ToString::to_string);\n        if command.is_none() && url.is_none() {\n            return Err(anyhow!(\"mcpServers.{name} is missing command/url\"));\n        }\n        let args = entry_obj\n            .get(\"args\")\n            .and_then(Value::as_array)\n            .map(|items| {\n                items\n                    .iter()\n                    .filter_map(Value::as_str)\n                    .map(ToString::to_string)\n                    .collect::<Vec<_>>()\n            })\n            .unwrap_or_default();\n        let env = entry_obj\n            .get(\"env\")\n            .and_then(Value::as_object)\n            .map(|map| {\n                map.iter()\n                    .filter_map(|(k, v)| v.as_str().map(|s| (k.clone(), s.to_string())))","sourceCodeStart":645,"sourceCodeEnd":681,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/core/src/import_config.rs#L645-L681","documentation":"parse_mcp_servers requires every MCP server entry to define at least one of \"command\" (stdio server) or \"url\" (HTTP/SSE server), both as strings. An object with neither is unusable and produces this error naming the server.","triggerScenarios":"Importing an mcpServers entry like {\"fs\": {\"args\": [\"x\"]}} or {\"fs\": {\"command\": 123}} (command present but not a string) so both extracted values are None.","commonSituations":"Config from another tool using different field names (e.g. \"cmd\", \"endpoint\", \"serverUrl\"), a server entry left empty after removing a key, or command defined as a non-string (number/array).","solutions":["Add \"command\": \"<executable>\" for a stdio server, or \"url\": \"<endpoint>\" for a remote server","Rename tool-specific keys (cmd/serverUrl/endpoint) to command/url expected by the importer","Quote the command value as a string rather than a number or array"],"exampleFix":"// before\n{ \"mcpServers\": { \"fs\": { \"cmd\": \"npx\" } } }\n// after\n{ \"mcpServers\": { \"fs\": { \"command\": \"npx\", \"args\": [\"-y\", \"@modelcontextprotocol/server-fs\"] } } }","handlingStrategy":"validation","validationCode":"for (const [name, e] of Object.entries(cfg.mcpServers ?? {})) {\n  if (typeof e.command !== 'string' && typeof e.url !== 'string') throw new Error(`mcpServers.${name} needs string \"command\" or \"url\"`);\n}","typeGuard":"const isRunnableServer = (e) => !!e && typeof e === 'object' && (typeof e.command === 'string' || typeof e.url === 'string');","tryCatchPattern":"try { importConfig(path) } catch (e) { if (String(e).includes('is missing command/url')) { console.error('Add a string \"command\" or \"url\" to the named server entry'); process.exitCode = 1; } else { throw e; } }","preventionTips":["Every server entry needs either command (stdio) or url (remote) as a plain string","Translate field names when copying from other tools (cmd -> command, serverUrl -> url)","Test-import each server entry individually before committing the config"],"tags":["config-import","validation","mcp","missing-field"],"backgroundTag":"missing-required-config-field","analyzedSha":"b0637c97ec34144387cbf2f74f65df6d16a6cef1","analyzedAt":"2026-09-10T00:24:58.650Z","contentChangedAt":"2026-09-10T00:24:58.650Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}