{"record":{"id":"5c2f3ae2c222fe57","repo":"Mintplex-Labs/anything-llm","slug":"mcp-server-name-missing-required-url-for","errorCode":null,"errorMessage":"MCP server \"${name}\": missing required \"url\" for ${server.type || \"sse\"} transport","messagePattern":"MCP server \"(.+?)\": missing required \"url\" for (.+?) transport","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/utils/MCP/hypervisor/index.js","lineNumber":376,"sourceCode":"   * - 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 (\n        Object.prototype.hasOwnProperty.call(server, \"args\") &&\n        !Array.isArray(server.args)\n      )\n        throw new Error(\"MCP server args must be an array\");","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/MCP/hypervisor/index.js#L358-L394","documentation":"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\").","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add the full \"url\" (including scheme) to the http/sse/streamable server entry","If the server is actually a local process, remove \"type\" and use { \"command\": ..., \"args\": [...] } instead","Check for key typos — the hypervisor looks for exactly \"url\"","Re-boot MCP servers after fixing the JSON"],"exampleFix":"// before\n{ \"my-server\": { \"type\": \"streamable\" } }\n\n// after\n{ \"my-server\": { \"type\": \"streamable\", \"url\": \"https://example.com/mcp\" } }","handlingStrategy":"validation","validationCode":"function requireUrl(server) {\n  if (server.type !== 'stdio' && !server.url)\n    throw new Error('http/sse/streamable MCP servers require a \"url\" field');\n}","typeGuard":"function hasTransportField(server) {\n  return typeof server.url === 'string' || typeof server.command === 'string';\n}","tryCatchPattern":"try {\n  await addMcpServer(entry);\n} catch (err) {\n  if (err.message.includes('missing required \"url\"')) {\n    // prompt for the endpoint URL\n  }\n  throw err;\n}","preventionTips":["Require the url field in the MCP server form before submit","Validate JSON shape (url or command present) immediately after any manual edit","Document that only the exact key 'url' is recognized"],"tags":["mcp","config-validation","http-transport","missing-field"],"backgroundTag":"missing-config-field","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}