{"record":{"id":"7d8c7e2f4a1305a6","repo":"sipeed/picoclaw","slug":"mcp-server-server-name-requires-a-command","errorCode":null,"errorMessage":"MCP server ${server.name} requires a command.","messagePattern":"MCP server (.+?) requires a command\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"web/frontend/src/components/config/config-page.tsx","lineNumber":520,"sourceCode":"                  headers: buildStringMapMergePatch(\n                    shouldValidateServer\n                      ? parseJSONObjectField(\n                          server.headersText,\n                          `MCP server ${server.name} headers`,\n                        )\n                      : baselineHeaders,\n                    baselineHeaders,\n                  ),\n                  command: null,\n                  args: null,\n                  env: null,\n                  env_file: null,\n                },\n              ] as const\n            }\n\n            if (shouldValidateServer && server.command === \"\") {\n              throw new Error(`MCP server ${server.name} requires a command.`)\n            }\n\n            const baselineEnv = baselineServer\n              ? parseJSONObjectField(\n                  baselineServer.envText,\n                  `Saved MCP server ${server.name} env`,\n                )\n              : {}\n\n            return [\n              server.name,\n              {\n                ...deferredPatch,\n                enabled: server.enabled,\n                type: \"stdio\",\n                command: server.command,\n                args: parseMultilineList(server.argsText),\n                env: buildStringMapMergePatch(","sourceCodeStart":502,"sourceCodeEnd":538,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/web/frontend/src/components/config/config-page.tsx#L502-L538","documentation":"Validation error thrown in handleSave (web/frontend/src/components/config/config-page.tsx:520) when an enabled stdio-type MCP server has an empty command after trimming. It is the stdio counterpart of the URL check: local process servers need the executable name, while URL/command fields are nulled out in the patch for remote servers and vice versa. Disabled servers (enabled=false) skip validation.","triggerScenarios":"Adding an enabled stdio server, entering a name and args but leaving the command empty, then saving; clearing the command of a saved stdio server.","commonSituations":"User fills 'args' (e.g. dist/index.js) before the command (e.g. node) and forgets the command; command field contains only spaces; user expects the URL field to matter for stdio servers.","solutions":["Enter the executable to run, e.g. node, npx, uvx, or an absolute binary path","Put flags and script paths in the args field, not the command field","If the server is not ready, disable it — disabled stdio servers are exempt from the command check"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (form.mcpServers.some((s) => s.type === \"stdio\" && s.enabled && s.command.trim() === \"\")) {\n  setFieldError(\"Enabled stdio MCP servers require a command.\")\n  return\n}","typeGuard":null,"tryCatchPattern":"try {\n  await handleSave()\n} catch (err) {\n  if (err instanceof Error) setError(err.message)\n}","preventionTips":["Mark the command field required for enabled stdio rows","Placeholder examples like 'npx -y @modelcontextprotocol/server-...' teach the expected split between command and args","Trim on blur; disable save while a required command is empty"],"tags":["validation","frontend","mcp","stdio","config"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}