{"record":{"id":"9495b5d30fb26956","repo":"warpdotdev/warp","slug":"mcp-server-name-field-warp-id-must-be-non-em","errorCode":null,"errorMessage":"MCP server '{name}' field 'warp_id' must be non-empty","messagePattern":"MCP server '(.+?)' field 'warp_id' must be non-empty","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"app/src/ai/agent_sdk/config_file.rs","lineNumber":130,"sourceCode":") -> anyhow::Result<Vec<MCPSpec>> {\n    let mut uuids: Vec<uuid::Uuid> = Vec::new();\n    let mut well_known: Vec<String> = Vec::new();\n    let mut json_map: Map<String, Value> = Map::new();\n\n    for (name, config) in mcp_servers {\n        let obj = config\n            .as_object()\n            .ok_or_else(|| anyhow::anyhow!(\"MCP server '{name}' config must be a JSON object\"))?;\n\n        if let Some(warp_id) = obj.get(\"warp_id\").and_then(Value::as_str) {\n            if let Ok(uuid) = uuid::Uuid::parse_str(warp_id) {\n                uuids.push(uuid);\n            } else if !FeatureFlag::WellKnownMcpIds.is_enabled() {\n                return Err(anyhow::anyhow!(\n                    \"MCP server '{name}' field 'warp_id' must be a UUID\"\n                ));\n            } else if warp_id.trim().is_empty() {\n                return Err(anyhow::anyhow!(\n                    \"MCP server '{name}' field 'warp_id' must be non-empty\"\n                ));\n            } else {\n                well_known.push(warp_id.to_string());\n            }\n        } else {\n            json_map.insert(name.clone(), config.clone());\n        }\n    }\n\n    uuids.sort();\n    uuids.dedup();\n    well_known.sort();\n    well_known.dedup();\n\n    let mut specs: Vec<MCPSpec> = uuids.into_iter().map(MCPSpec::Uuid).collect();\n    specs.extend(well_known.into_iter().map(MCPSpec::WellKnown));\n","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/config_file.rs#L112-L148","documentation":"Thrown when an MCP server entry's warp_id is a string that trims to empty and the WellKnownMcpIds flag is enabled (with the flag off, an empty string fails UUID parsing and hits the UUID error instead). It guards the well-known-id bucket from blank values so empty slugs never silently match a server.","triggerScenarios":"Config contains {\"server\": {\"warp_id\": \"\"}} or {\"warp_id\": \"   \"} while FeatureFlag::WellKnownMcpIds is on: Uuid::parse_str fails, the flag branch is taken, and warp_id.trim().is_empty() routes to this error.","commonSituations":"Template-generated configs that leave warp_id as an empty placeholder; YAML-to-JSON conversion emitting an empty string for a null field; or an editor auto-completing the key without a value.","solutions":["Fill in a real warp_id value (UUID, or a well-known slug on builds that support it).","Remove the warp_id key entirely if the server should be treated as an inline command/url config.","Lint configs for empty-string values before shipping: jq '.mcp_servers | to_entries | map(select(.value.warp_id? == \"\")) | length == 0'."],"exampleFix":"// before\n\"mcp_servers\": { \"db\": { \"warp_id\": \"\" } }\n\n// after (inline server, no warp_id)\n\"mcp_servers\": { \"db\": { \"command\": \"npx\", \"args\": [\"-y\", \"@modelcontextprotocol/server-postgres\"] } }","handlingStrategy":"validation","validationCode":"if let Some(warp_id) = obj.get(\"warp_id\").and_then(Value::as_str) {\n    anyhow::ensure!(!warp_id.trim().is_empty(), \"warp_id must not be blank\");\n}","typeGuard":"fn is_non_blank(s: &str) -> bool {\n    !s.trim().is_empty()\n}","tryCatchPattern":"match mcp_specs_from_mcp_servers(&mcp_servers) {\n    Err(err) if err.to_string().contains(\"must be non-empty\") => fix_blank_warp_id_and_retry(&mcp_servers),\n    rest => rest,\n}","preventionTips":["Fill or remove placeholder warp_id keys before shipping configs.","Lint for empty-string values when generating configs from templates or YAML conversion.","Prefer omitting warp_id over blanking it — blank buys nothing and fails parsing."],"tags":["mcp","configuration","validation","rust"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}