{"record":{"id":"0725bf6f53c62163","repo":"BloopAI/vibe-kanban","slug":"missing-required-field-at-path-mcp-config-serve","errorCode":null,"errorMessage":"Missing required field at path: ${mcp_config.servers_path.join('.')}","messagePattern":"Missing required field at path: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/web-core/src/shared/lib/mcpStrategies.ts","lineNumber":43,"sourceCode":"      const lastKey = cfg.servers_path[cfg.servers_path.length - 1];\n      current[lastKey] = cfg.servers;\n    }\n    return fullConfig;\n  }\n  static validateFullConfig(\n    mcp_config: McpConfig,\n    full_config: JsonValue\n  ): void {\n    let current: JsonValue = full_config;\n    for (const key of mcp_config.servers_path) {\n      if (!isJsonObject(current)) {\n        throw new Error(\n          `Expected object at path: ${mcp_config.servers_path.join('.')}`\n        );\n      }\n      current = current[key];\n      if (current === undefined) {\n        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  }\n  static extractServersForApi(\n    mcp_config: McpConfig,\n    full_config: JsonValue\n  ): JsonObject {\n    let current: JsonValue = full_config;\n    for (const key of mcp_config.servers_path) {\n      if (!isJsonObject(current)) {\n        throw new Error(\n          `Expected object at path: ${mcp_config.servers_path.join('.')}`\n        );","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/BloopAI/vibe-kanban/blob/4deb7eca8f381f7cbc1f9d15515a9ab8f8009053/packages/web-core/src/shared/lib/mcpStrategies.ts#L25-L61","documentation":"While walking servers_path in validateFullConfig, if current[key] is undefined the required segment is absent from the full config, so this error is thrown. The MCP servers section expected at that path does not exist in the loaded config file.","triggerScenarios":"full_config lacks one of the intermediate/last keys of servers_path — e.g. path ['mcp','servers'] but the config has no 'mcp' key at all, or has 'mcp' without 'servers'; a freshly created/empty config file; wrong strategy's servers_path applied to this config.","commonSituations":"First run before the tool has ever written its config; user deleted keys by hand; switching between MCP clients (e.g. Claude Desktop vs Cursor) whose config shapes differ.","solutions":["Call McpConfigStrategyGeneral.createFullConfig(cfg) to build a config that contains the servers_path structure, then validate that.","Or merge missing intermediate objects into full_config before validation.","Verify you loaded the correct config file for this strategy (right app, right path).","Check servers_path in the McpConfig matches the target tool's documented schema."],"exampleFix":"// before: validating an empty config\nvalidateFullConfig(cfg, {}); // throws\n// after: construct the structure first\nconst full = McpConfigStrategyGeneral.createFullConfig(cfg);\nvalidateFullConfig(cfg, full);","handlingStrategy":"validation","validationCode":"function pathExists(full, path) {\n  let cur = full;\n  for (const k of path) {\n    if (typeof cur !== 'object' || cur === null || !(k in cur)) return false;\n    cur = cur[k];\n  }\n  return true;\n}\nif (!pathExists(fullConfig, cfg.servers_path)) {\n  fullConfig = McpConfigStrategyGeneral.createFullConfig(cfg);\n}","typeGuard":"function hasServersPath(full: unknown, path: string[]): boolean {\n  let cur: unknown = full;\n  for (const k of path) {\n    if (typeof cur !== 'object' || cur === null || Array.isArray(cur)) return false;\n    cur = (cur as Record<string, unknown>)[k];\n  }\n  return cur !== undefined;\n}","tryCatchPattern":"try {\n  McpConfigStrategyGeneral.validateFullConfig(cfg, fullConfig);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Missing required field at path')) {\n    fullConfig = McpConfigStrategyGeneral.createFullConfig(cfg); // seed missing sections\n  } else throw e;\n}","preventionTips":["Seed new/empty config files with createFullConfig before validating or saving","Verify the correct config file path is loaded for the intended MCP client","Re-check servers_path after app updates that change config layout","Back up config files before manual deletion of keys"],"tags":["config","validation","mcp","missing-field"],"backgroundTag":"missing-config-key","analyzedSha":"4deb7eca8f381f7cbc1f9d15515a9ab8f8009053","analyzedAt":"2026-08-29T09:24:13.446Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}