Mintplex-Labs/anything-llm · error

MCP server type must have sse or streamable value.

Error message

MCP server type must have sse or streamable value.

What it means

The MCP hypervisor validates every entry in the MCP servers JSON before connecting. For http-type servers the optional "type" field must be one of "sse", "streamable", or "http" (the message names sse/streamable; http is also accepted). Any other explicit value for server.type throws during #validateServerDefinitionByType at boot.

Solutions

  1. Set "type" to "streamable" (modern servers) or "sse" (legacy) in the server entry, or remove the "type" key entirely to default to SSE
  2. Validate the JSON with the same allowlist (sse|streamable|http) before saving
  3. Confirm the server actually speaks the chosen transport (StreamableHTTP vs SSE endpoint)
  4. Restart the server / re-boot MCP servers after fixing the JSON

Example fix

// before (mcp_servers.json)
{ "my-server": { "type": "websocket", "url": "https://example.com/mcp" } }

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

Strategy: validation

Validate before calling

const VALID_HTTP_TYPES = ['sse', 'streamable', 'http'];
function validateMcpEntry(name, server) {
  if (server.type !== undefined && !VALID_HTTP_TYPES.includes(server.type))
    throw new Error(`Server "${name}": type must be one of ${VALID_HTTP_TYPES.join('|')} or omitted.`);
}

Type guard

function isValidHttpType(server) {
  return server.type === undefined || ['sse', 'streamable', 'http'].includes(server.type);
}

Try / catch

try {
  await hypervisor.bootMCPServers();
} catch (err) {
  if (err.message.includes('must have sse or streamable')) {
    // flag the offending entry in mcp_servers.json for the user
  }
  throw err;
}

Prevention

When it happens

Trigger: An entry in mcp_servers.json has "type": "websocket", "SSE" (wrong case), "stdio" on a url-based server, or any string outside the allowlist; #parseServerType then classified it as http via the type field and validation rejected the value.

Common situations: Hand-editing the MCP servers JSON and guessing a type value; copying a config snippet from docs of a different MCP client; case-sensitive value typos; leftover experimental type values.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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

Appendix: 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 3aec848f28)