Mintplex-Labs/anything-llm · error · Error

MCP server type must have sse or streamable value.

Error message

MCP server type must have sse or streamable value.

What it means

Thrown by MCP hypervisor #validateServerDefinitionByType when a server is classified as http (it has a url, or transport/headers but no command) and the optional server.type field is present but not one of the allowed values 'sse', 'streamable', or 'http'. The field is optional — omitting it defaults to SSE — but an explicit invalid value is treated as a config error.

Source

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

  }

  /**
   * Validate the server definition by type
   * - 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 (

View on GitHub (pinned to 526360e320)

Solutions

  1. Set server.type to 'sse', 'streamable', or 'http', or remove the type field entirely (defaults to SSE).
  2. Check for typos — 'streamable' is the most commonly misspelled value.
  3. Re-read createHttpTransport: 'streamable' and 'http' both select StreamableHTTPClientTransport; anything else/default selects SSEClientTransport.

Example fix

// before
{
  "myServer": {
    "url": "https://mcp.example.com",
    "type": "websocket"
  }
}

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

Strategy: validation

Validate before calling

const ALLOWED_HTTP_TYPES = ['sse', 'streamable', 'http'];
function validateHttpServerType(server) {
  if (server.type !== undefined && !ALLOWED_HTTP_TYPES.includes(server.type)) {
    throw new Error(`Invalid MCP http server type '${server.type}'. Allowed: ${ALLOWED_HTTP_TYPES.join(', ')} (or omit for SSE).`);
  }
}

Type guard

/** @param {unknown} s */
function isValidHttpServerType(s) {
  return s === undefined || ['sse', 'streamable', 'http'].includes(s);
}

Try / catch

try {
  hypervisor.#validateServerDefinitionByType(name, server, 'http'); // via public start path
} catch (e) {
  if (/MCP server type must have sse or streamable/.test(e.message)) {
    throw new Error(`Fix server '${name}': set type to sse|streamable|http or remove it.`);
  }
  throw e;
}

Prevention

When it happens

Trigger: An MCP server config entry with a url and a type set to something like 'websocket', 'ws', 'rpc', or a typo like 'streamble'. The server is detected as http (via the url presence) but the explicit type fails the allowlist check.

Common situations: Misreading the MCP transport spec and setting type to an unsupported transport name; typos in 'streamable'; copy-pasting a config from a different MCP client that uses different type names; confusing the openrouter/chat 'type' with MCP transport type.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13). Data as JSON: /api/errors/7ebe385a38fc3380. Report an issue: GitHub.