{"record":{"id":"dc011539c96782f7","repo":"chatboxai/chatbox","slug":"unknown-transport-type","errorCode":null,"errorMessage":"Unknown transport type","messagePattern":"Unknown transport type","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/renderer/packages/mcp/controller.ts","lineNumber":70,"sourceCode":"            type: 'sse',\n            url: transportConfig.url,\n            headers: transportConfig.headers,\n          },\n          onUncaughtError(error: unknown) {\n            console.error('mcp:client:onUncaughtError', error)\n          },\n        })\n      } catch (fallbackError) {\n        const streamableMessage = err instanceof Error ? err.message : String(err)\n        const fallbackMessage = fallbackError instanceof Error ? fallbackError.message : String(fallbackError)\n        throw new Error(\n          `Streamable HTTP connection failed: ${streamableMessage}\\nLegacy SSE fallback failed: ${fallbackMessage}`,\n          { cause: err }\n        )\n      }\n    }\n  }\n  throw new Error('Unknown transport type')\n}\n\nexport class MCPServer extends Emittery<{ status: MCPServerStatus }> {\n  private _status: MCPServerStatus = { state: 'idle' }\n  private client?: MCPClient\n  private tools?: ToolSet\n\n  constructor(private readonly transportConfig: TransportConfig) {\n    super()\n  }\n\n  get status() {\n    return this._status\n  }\n\n  set status(status: MCPServerStatus) {\n    this._status = status\n    this.emit('status', status)","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/chatboxai/chatbox/blob/81571269addb6bafb589a920b2883f1e1e084fd1/src/renderer/packages/mcp/controller.ts#L52-L88","documentation":"Thrown at the end of createClient() when transportConfig.type matches neither 'stdio' nor 'http'. It is a defensive guard marking an unsupported/unknown transport configuration as a programming or config error rather than silently doing nothing.","triggerScenarios":"An MCP server config whose transport.type is a value other than 'stdio' or 'http' (e.g. a typo like 'sse' as a top-level type, 'ws', or undefined). The function's two if-blocks for 'stdio' and 'http' both fall through.","commonSituations":"Manual edit of MCP config JSON with a wrong transport type; migration from an older config schema that used a different type name; corrupted/defaulted config object with type undefined.","solutions":["Set transport.type to either 'stdio' (for local command-based servers) or 'http' (for remote HTTP/SSE servers).","If you need pure SSE, use type 'http' — the controller auto-falls back to SSE (see error 185).","Recreate the server entry through the UI rather than hand-editing JSON to avoid schema drift."],"exampleFix":"// before\n{ \"transport\": { \"type\": \"sse\", \"url\": \"https://...\" } }\n\n// after\n{ \"transport\": { \"type\": \"http\", \"url\": \"https://...\" } }","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['stdio', 'http'] as const\ntype SupportedTransport = typeof SUPPORTED[number]\nfunction assertSupportedTransport(t: string): asserts t is SupportedTransport {\n  if (!SUPPORTED.includes(t as SupportedTransport)) {\n    throw new Error(`transport.type must be one of ${SUPPORTED.join(', ')}, got: ${t}`)\n  }\n}\nassertSupportedTransport(config.transport.type)","typeGuard":"function isSupportedTransportType(t: unknown): t is 'stdio' | 'http' {\n  return t === 'stdio' || t === 'http'\n}","tryCatchPattern":"try {\n  await createClient(config.transport)\n} catch (e) {\n  if (e instanceof Error && e.message === 'Unknown transport type') {\n    // reset config.transport.type to 'http' or 'stdio' and re-prompt\n  }\n}","preventionTips":["Validate transport.type against the supported set at config-load time.","Prefer the UI's MCP server editor over hand-editing JSON.","Run a schema validator (zod/json-schema) over the MCP config on startup."],"tags":["mcp","config","transport","validation"],"backgroundTag":null,"analyzedSha":"81571269addb6bafb589a920b2883f1e1e084fd1","analyzedAt":"2026-08-12T21:51:44.981Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}