Mintplex-Labs/anything-llm · error

MCP server " ": missing required "url" for transport

Error message

MCP server "${name}": missing required "url" for ${server.type || "sse"} transport

What it means

During hypervisor boot, an http-classified MCP server entry (has url or type sse/streamable/http) must contain a non-empty "url" property. #validateServerDefinitionByType throws this templated message when server.url is missing, interpolating the declared transport (defaulting to "sse").

Solutions

  1. Add the full "url" (including scheme) to the http/sse/streamable server entry
  2. If the server is actually a local process, remove "type" and use { "command": ..., "args": [...] } instead
  3. Check for key typos — the hypervisor looks for exactly "url"
  4. Re-boot MCP servers after fixing the JSON

Example fix

// before
{ "my-server": { "type": "streamable" } }

// after
{ "my-server": { "type": "streamable", "url": "https://example.com/mcp" } }
Defensive patterns

Strategy: validation

Validate before calling

function requireUrl(server) {
  if (server.type !== 'stdio' && !server.url)
    throw new Error('http/sse/streamable MCP servers require a "url" field');
}

Type guard

function hasTransportField(server) {
  return typeof server.url === 'string' || typeof server.command === 'string';
}

Try / catch

try {
  await addMcpServer(entry);
} catch (err) {
  if (err.message.includes('missing required "url"')) {
    // prompt for the endpoint URL
  }
  throw err;
}

Prevention

When it happens

Trigger: mcp_servers.json entry classified as http (e.g. { "type": "sse" } with no url, or { "url": "" }) — #parseServerType returned "http" via the type field but the required url is absent or empty.

Common situations: Entry written with only a command but a type of sse; url key typo'd as "endpoint", "uri", or "base_url"; empty-string url left after an incomplete edit; copy-paste from a config that used a different key name.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/5c2f3ae2c222fe57. Report an issue: GitHub.

Appendix: source

Thrown at server/utils/MCP/hypervisor/index.js:376

   * - Will throw an error if the server definition is invalid
   * @param {string} name - The name of the MCP server
   * @param {Object} server - The server definition
   * @param {MCPServerTypes} type - The server type
   * @returns {void}
   */
  #validateServerDefinitionByType(name, server, type) {
    if (type === "http") {
      // "type" is optional for http servers - when omitted, SSE is assumed
      // (see createHttpTransport). An explicit unknown value is a config error.
      if (
        server.type !== undefined &&
        !["sse", "streamable", "http"].includes(server.type)
      ) {
        throw new Error("MCP server type must have sse or streamable value.");
      }

      if (!server.url) {
        throw new Error(
          `MCP server "${name}": missing required "url" for ${server.type || "sse"} transport`
        );
      }

      try {
        new URL(server.url);
      } catch {
        throw new Error(`MCP server "${name}": invalid URL "${server.url}"`);
      }
      return;
    }

    if (type === "stdio") {
      if (
        Object.prototype.hasOwnProperty.call(server, "args") &&
        !Array.isArray(server.args)
      )
        throw new Error("MCP server args must be an array");

View on GitHub (pinned to 3aec848f28)