{"record":{"id":"f0003646c97de371","repo":"continuedev/continue","slug":"invalid-mcp-server-configuration","errorCode":null,"errorMessage":"Invalid MCP server configuration","messagePattern":"Invalid MCP server configuration","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/config-yaml/src/schemas/mcp/convertJson.ts","lineNumber":103,"sourceCode":"\n    if (jsonConfig.type) {\n      sseOrHttpConfig.type =\n        jsonConfig.type === \"http\" ? \"streamable-http\" : \"sse\";\n    }\n\n    if (jsonConfig.headers) {\n      sseOrHttpConfig.requestOptions = {\n        headers: jsonConfig.headers,\n      };\n    }\n\n    return {\n      warnings,\n      yamlConfig: sseOrHttpConfig,\n    };\n  }\n\n  throw new Error(`Invalid MCP server configuration`);\n}\n\n/**\n * Convert from YAML schema (used in Continue) to JSON schema (e.g. used in Claude Desktop)\n */\nexport function convertYamlMcpConfigToJsonMcpConfig(yamlConfig: MCPServer): {\n  name: string;\n  jsonConfig: McpJsonConfig;\n  MCP_TIMEOUT?: string;\n  warnings: string[];\n} {\n  const { name, faviconUrl } = yamlConfig;\n\n  const warnings: string[] = [];\n  if (faviconUrl) {\n    warnings.push(\n      `\\`faviconUrl\\` from YAML MCP config not supported in Claude-style JSON, will be removed from server ${name}`,\n    );","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/packages/config-yaml/src/schemas/mcp/convertJson.ts#L85-L121","documentation":"Thrown by convertJsonMcpConfigToYamlMcpConfig when the input MCP server JSON config matches neither the stdio/sse nor the http configuration shape, so no conversion branch produced a result. The function walks known config variants and falls through to a final throw.","triggerScenarios":"Calling convertJsonMcpConfigToYamlMcpConfig with an MCP server JSON entry that has no recognized type discriminator (missing 'command' for stdio, missing 'url' for sse/http, or an unknown transport type field).","commonSituations":"Hand-editing mcpServers JSON (Claude Desktop format) with typos, migrating configs between versions where the schema changed, or passing a config object with extra/renamed keys so none of the internal shape checks match.","solutions":["Inspect the JSON server entry and confirm it is one of: stdio ({command, args?}), SSE ({url}), or HTTP ({url})","Fix or remove unknown/misspelled keys (e.g. 'type' values or missing 'command'/'url')","Validate the JSON against the Claude Desktop mcpServers schema before converting","Wrap the conversion call in try-catch and report the offending server entry to the user instead of crashing"],"exampleFix":"// before\nconst { yamlConfig } = convertJsonMcpConfigToYamlMcpConfig({ servers: { bad: { transpor: 'stdio' } } });\n\n// after\nconst { yamlConfig } = convertJsonMcpConfigToYamlMcpConfig({ servers: { good: { command: 'npx', args: ['-y', 'server'] } } });","handlingStrategy":"type-guard","validationCode":"const isValidJsonServer = (s: any) => Boolean(s && (typeof s.command === 'string' || typeof s.url === 'string'));","typeGuard":"function isConvertibleJsonServer(s: unknown): s is { command?: string; url?: string; [k: string]: unknown } { const o = s as any; return !!o && (typeof o.command === 'string' || typeof o.url === 'string'); }","tryCatchPattern":"try { const { yamlConfig } = convertJsonMcpConfigToYamlMcpConfig(cfg); } catch (e) { if (e.message === 'Invalid MCP server configuration') { /* skip/report bad server */ } else throw e; }","preventionTips":["Validate each mcpServers entry has command or url before converting","Run configs through the JSON schema before import","Log which server entry fails by converting one at a time"],"tags":["mcp","config","schema-validation","typescript"],"backgroundTag":"mcp-config-validation","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}