{"record":{"id":"7ebe385a38fc3380","repo":"Mintplex-Labs/anything-llm","slug":"mcp-server-type-must-have-sse-or-streamable-value","errorCode":null,"errorMessage":"MCP server type must have sse or streamable value.","messagePattern":"MCP server type must have sse or streamable value\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/MCP/hypervisor/index.js","lineNumber":372,"sourceCode":"  }\n\n  /**\n   * Validate the server definition by type\n   * - Will throw an error if the server definition is invalid\n   * @param {string} name - The name of the MCP server\n   * @param {Object} server - The server definition\n   * @param {MCPServerTypes} type - The server type\n   * @returns {void}\n   */\n  #validateServerDefinitionByType(name, server, type) {\n    if (type === \"http\") {\n      // \"type\" is optional for http servers - when omitted, SSE is assumed\n      // (see createHttpTransport). An explicit unknown value is a config error.\n      if (\n        server.type !== undefined &&\n        ![\"sse\", \"streamable\", \"http\"].includes(server.type)\n      ) {\n        throw new Error(\"MCP server type must have sse or streamable value.\");\n      }\n\n      if (!server.url) {\n        throw new Error(\n          `MCP server \"${name}\": missing required \"url\" for ${server.type || \"sse\"} transport`\n        );\n      }\n\n      try {\n        new URL(server.url);\n      } catch {\n        throw new Error(`MCP server \"${name}\": invalid URL \"${server.url}\"`);\n      }\n      return;\n    }\n\n    if (type === \"stdio\") {\n      if (","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/MCP/hypervisor/index.js#L354-L390","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set server.type to 'sse', 'streamable', or 'http', or remove the type field entirely (defaults to SSE).","Check for typos — 'streamable' is the most commonly misspelled value.","Re-read createHttpTransport: 'streamable' and 'http' both select StreamableHTTPClientTransport; anything else/default selects SSEClientTransport."],"exampleFix":"// before\n{\n  \"myServer\": {\n    \"url\": \"https://mcp.example.com\",\n    \"type\": \"websocket\"\n  }\n}\n\n// after\n{\n  \"myServer\": {\n    \"url\": \"https://mcp.example.com\",\n    \"type\": \"streamable\"\n  }\n}","handlingStrategy":"validation","validationCode":"const ALLOWED_HTTP_TYPES = ['sse', 'streamable', 'http'];\nfunction validateHttpServerType(server) {\n  if (server.type !== undefined && !ALLOWED_HTTP_TYPES.includes(server.type)) {\n    throw new Error(`Invalid MCP http server type '${server.type}'. Allowed: ${ALLOWED_HTTP_TYPES.join(', ')} (or omit for SSE).`);\n  }\n}","typeGuard":"/** @param {unknown} s */\nfunction isValidHttpServerType(s) {\n  return s === undefined || ['sse', 'streamable', 'http'].includes(s);\n}","tryCatchPattern":"try {\n  hypervisor.#validateServerDefinitionByType(name, server, 'http'); // via public start path\n} catch (e) {\n  if (/MCP server type must have sse or streamable/.test(e.message)) {\n    throw new Error(`Fix server '${name}': set type to sse|streamable|http or remove it.`);\n  }\n  throw e;\n}","preventionTips":["Omit server.type entirely if you want the SSE default — only set it to switch to streamable/http.","Double-check spelling of 'streamable'.","Validate the MCP config JSON against an allowlist before passing it to the hypervisor.","Remember 'streamable' and 'http' both select StreamableHTTPClientTransport."],"tags":["mcp","configuration","validation","transport","config-schema"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}