NousResearch/hermes-agent · warning · Error

Command required

Error message

Command required

What it means

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.

Solutions

  1. Enter the launch command (e.g. npx, uvx, or a binary path) in the command field.
  2. If configuring a remote server, switch the transport to http and fill the URL instead.
  3. Validate command.trim() client-side before calling buildMcpServerCreate on the stdio branch.
Defensive patterns

Strategy: validation

Validate before calling

if (draft.transport !== 'http' && !draft.command.trim()) {
  setFieldError('command', 'Command is required for stdio servers')
  return
}

Type guard

function hasStdioCommand(d: McpServerDraft): boolean {
  return d.transport !== 'http' || d.command.trim().length > 0
}

Try / catch

try {
  const payload = buildMcpServerCreate(draft)
} catch (err) {
  if (String(err) === 'Command required') { focusField('command'); return }
  throw err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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`.

Related errors


AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14). Data as JSON: /api/errors/b22e1f30d83c0fce. Report an issue: GitHub.

Appendix: source

Thrown at web/src/lib/mcp-server-create.ts:70

  if (!name) throw new Error("Name required");

  if (draft.transport === "http") {
    const url = draft.url.trim();
    if (!url) throw new Error("URL required");
    if (draft.httpAuth === "header" && !draft.bearerToken.trim()) {
      throw new Error("Bearer token required");
    }

    const server: McpServerCreate = { name, url };
    if (draft.httpAuth !== "none") server.auth = draft.httpAuth;
    if (draft.httpAuth === "header") {
      server.bearer_token = draft.bearerToken;
    }
    return server;
  }

  const command = draft.command.trim();
  if (!command) throw new Error("Command required");

  const server: McpServerCreate = { name, command };
  const args = parseArgs(draft.args);
  if (args.length) server.args = args;
  const env = parseEnv(draft.env);
  if (Object.keys(env).length) server.env = env;
  return server;
}

View on GitHub (pinned to c896c09c42)