{"record":{"id":"b22e1f30d83c0fce","repo":"NousResearch/hermes-agent","slug":"command-required","errorCode":null,"errorMessage":"Command required","messagePattern":"Command required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"web/src/lib/mcp-server-create.ts","lineNumber":70,"sourceCode":"  if (!name) throw new Error(\"Name required\");\n\n  if (draft.transport === \"http\") {\n    const url = draft.url.trim();\n    if (!url) throw new Error(\"URL required\");\n    if (draft.httpAuth === \"header\" && !draft.bearerToken.trim()) {\n      throw new Error(\"Bearer token required\");\n    }\n\n    const server: McpServerCreate = { name, url };\n    if (draft.httpAuth !== \"none\") server.auth = draft.httpAuth;\n    if (draft.httpAuth === \"header\") {\n      server.bearer_token = draft.bearerToken;\n    }\n    return server;\n  }\n\n  const command = draft.command.trim();\n  if (!command) throw new Error(\"Command required\");\n\n  const server: McpServerCreate = { name, command };\n  const args = parseArgs(draft.args);\n  if (args.length) server.args = args;\n  const env = parseEnv(draft.env);\n  if (Object.keys(env).length) server.env = env;\n  return server;\n}\n","sourceCodeStart":52,"sourceCodeEnd":79,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/web/src/lib/mcp-server-create.ts#L52-L79","documentation":"For stdio-transport MCP servers (the non-http branch of buildMcpServerCreate), the command to launch is required; args and env are optional. A trimmed-empty command throws before the payload is built. The command is the executable the gateway will spawn for this MCP server.","triggerScenarios":"Leaving the command field blank on the stdio branch; a draft with transport undefined/null falling through to the stdio path while only URL was filled; whitespace-only command.","commonSituations":"Transport selector defaulting to stdio while the user filled the HTTP URL field; form fields not cleared/swapped when toggling transport; scripts creating servers from templates missing `command`.","solutions":["Enter the launch command (e.g. npx, uvx, or a binary path) in the command field.","If configuring a remote server, switch the transport to http and fill the URL instead.","Validate command.trim() client-side before calling buildMcpServerCreate on the stdio branch."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (draft.transport !== 'http' && !draft.command.trim()) {\n  setFieldError('command', 'Command is required for stdio servers')\n  return\n}","typeGuard":"function hasStdioCommand(d: McpServerDraft): boolean {\n  return d.transport !== 'http' || d.command.trim().length > 0\n}","tryCatchPattern":"try {\n  const payload = buildMcpServerCreate(draft)\n} catch (err) {\n  if (String(err) === 'Command required') { focusField('command'); return }\n  throw err\n}","preventionTips":["Default the transport selector explicitly and re-validate on change.","Show only the fields relevant to the chosen transport.","For scripted creation, build drafts from a checked template with command preset."],"tags":["validation","mcp","stdio-transport","form"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}