NousResearch/hermes-agent · warning · Error

URL required

Error message

URL required

What it means

For an MCP server with transport 'http', buildMcpServerCreate requires a non-empty URL (trimmed) — it becomes the `url` field of the McpServerCreate payload. Thrown client-side before the API call when the URL field is blank on the HTTP transport branch.

Source

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

  for (const rawLine of raw.split("\n")) {
    const line = rawLine.trim();
    if (!line) continue;
    const separator = line.indexOf("=");
    if (separator === -1) continue;
    const key = line.slice(0, separator).trim();
    const value = line.slice(separator + 1).trim();
    if (key) env[key] = value;
  }
  return env;
}

export function buildMcpServerCreate(draft: McpServerDraft): McpServerCreate {
  const name = draft.name.trim();
  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;

View on GitHub (pinned to c896c09c42)

Solutions

  1. Enter the server's HTTP endpoint (e.g. https://mcp.example.com/sse) and resubmit.
  2. If you meant a local process, switch the transport to stdio/command instead of http.
  3. Gate the submit action on url.trim() when transport === 'http'.
Defensive patterns

Strategy: validation

Validate before calling

const requiredFields = draft.transport === 'http' ? ['url'] : ['command']
const missing = requiredFields.filter(f => !String(draft[f] ?? '').trim())
if (missing.length) { setFieldErrors(missing); return }

Type guard

function hasHttpUrl(d: McpServerDraft): boolean {
  return d.transport === 'http' && d.url.trim().length > 0
}

Try / catch

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

Prevention

When it happens

Trigger: Selecting the HTTP/SSE transport in the add-server form but leaving the URL field empty; a draft defaulting transport to 'http' with url: ''; whitespace-only input.

Common situations: Form state initialized with transport 'http' while the user fills in command/args fields instead (intending stdio); UI not resetting fields when the transport toggles.

Related errors


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