{"record":{"id":"39f4909ee12a1051","repo":"BloopAI/vibe-kanban","slug":"unknown-preconfigured-server-serverkey","errorCode":null,"errorMessage":"Unknown preconfigured server '${serverKey}'","messagePattern":"Unknown preconfigured server '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/web-core/src/shared/lib/mcpStrategies.ts","lineNumber":83,"sourceCode":"        throw new Error(\n          `Missing required field at path: ${mcp_config.servers_path.join('.')}`\n        );\n      }\n    }\n    if (!isJsonObject(current)) {\n      throw new Error('Servers configuration must be an object');\n    }\n    return current;\n  }\n\n  static addPreconfiguredToConfig(\n    mcp_config: McpConfig,\n    existingConfig: JsonValue,\n    serverKey: string\n  ): JsonObject {\n    const preconfVal = mcp_config.preconfigured;\n    if (!isJsonObject(preconfVal) || !(serverKey in preconfVal)) {\n      throw new Error(`Unknown preconfigured server '${serverKey}'`);\n    }\n\n    const updatedVal: JsonValue = JSON.parse(\n      JSON.stringify(existingConfig ?? {})\n    );\n    const updated: JsonObject = isJsonObject(updatedVal) ? updatedVal : {};\n    let current: JsonObject = updated;\n\n    for (let i = 0; i < mcp_config.servers_path.length - 1; i++) {\n      const key = mcp_config.servers_path[i];\n      const next = isJsonObject(current[key])\n        ? (current[key] as JsonObject)\n        : undefined;\n      if (!next) current[key] = {};\n      current = current[key] as JsonObject;\n    }\n\n    if (mcp_config.servers_path.length === 0) {","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/BloopAI/vibe-kanban/blob/4deb7eca8f381f7cbc1f9d15515a9ab8f8009053/packages/web-core/src/shared/lib/mcpStrategies.ts#L65-L101","documentation":"addPreconfiguredToConfig looks up serverKey in mcp_config.preconfigured (the catalog of built-in server templates for this strategy). If preconfigured is not an object or does not contain serverKey, it throws this error. It protects against adding a preconfigured server that the current MCP strategy does not offer.","triggerScenarios":"Adding a preconfigured server whose key is not in the strategy's catalog — stale UI list after the McpConfig changed, a typo'd serverKey, or a catalog from a different strategy/client.","commonSituations":"UI cached an older preconfigured list after an app update; user selected a server available in one MCP client but not the configured one; serverKey built from an untrusted/unsanitized source.","solutions":["Re-fetch/rebuild the McpConfig so the UI's preconfigured list matches the current strategy.","Check the exact key spelling against mcp_config.preconfigured before calling addPreconfiguredToConfig.","If the server isn't offered preconfigured, add it as a custom server entry via the servers object instead.","Update the strategy's preconfigured catalog if the server should legitimately exist."],"exampleFix":"// before\nstrategy.addPreconfiguredToConfig(cfg, existing, 'postgres'); // not in catalog -> throws\n// after\nconst keys = isJsonObject(cfg.preconfigured) ? Object.keys(cfg.preconfigured) : [];\nif (keys.includes('postgres')) {\n  strategy.addPreconfiguredToConfig(cfg, existing, 'postgres');\n} else {\n  servers.postgres = { /* custom entry */ };\n}","handlingStrategy":"validation","validationCode":"function preconfiguredExists(cfg, key) {\n  return typeof cfg.preconfigured === 'object' && cfg.preconfigured !== null && !Array.isArray(cfg.preconfigured) && key in cfg.preconfigured;\n}\nif (!preconfiguredExists(cfg, serverKey)) console.warn(`Server '${serverKey}' not offered by this strategy`);","typeGuard":"function hasPreconfigured(cfg: McpConfig, key: string): boolean {\n  const p: unknown = cfg.preconfigured;\n  return typeof p === 'object' && p !== null && !Array.isArray(p) && key in p;\n}","tryCatchPattern":"try {\n  McpConfigStrategyGeneral.addPreconfiguredToConfig(cfg, existing, serverKey);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Unknown preconfigured server')) {\n    console.warn(e.message, 'Available:', Object.keys(cfg.preconfigured ?? {}));\n  } else throw e;\n}","preventionTips":["Derive the selectable server list from cfg.preconfigured itself, never a hardcoded list","Refresh the McpConfig after app updates so the catalog matches","Validate serverKey against the catalog before invoking addPreconfiguredToConfig","Use custom-server entries for servers absent from the preconfigured catalog"],"tags":["config","mcp","validation","unknown-key"],"backgroundTag":"unknown-config-entry","analyzedSha":"4deb7eca8f381f7cbc1f9d15515a9ab8f8009053","analyzedAt":"2026-08-29T09:24:13.446Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}