{"record":{"id":"8d5e61f02113b0c9","repo":"mastra-ai/mastra","slug":"mcpclientserverproxy-does-not-support-http-transpo","errorCode":null,"errorMessage":"MCPClientServerProxy does not support HTTP transport","messagePattern":"MCPClientServerProxy does not support HTTP transport","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/mcp/src/client/server-proxy.ts","lineNumber":203,"sourceCode":"        uri: c.uri ?? uri,\n        ...(c.text !== undefined ? { text: c.text } : {}),\n        ...(c.blob !== undefined ? { blob: c.blob } : {}),\n      })),\n    };\n  }\n\n  // Transport methods — not applicable for client proxies\n  public async startStdio(): Promise<void> {\n    throw new Error('MCPClientServerProxy does not support stdio transport');\n  }\n  public async startSSE(_options: MCPServerSSEOptions): Promise<void> {\n    throw new Error('MCPClientServerProxy does not support SSE transport');\n  }\n  public async startHonoSSE(_options: MCPServerHonoSSEOptions): Promise<Response | undefined> {\n    throw new Error('MCPClientServerProxy does not support Hono SSE transport');\n  }\n  public async startHTTP(_options: MCPServerHTTPOptions): Promise<void> {\n    throw new Error('MCPClientServerProxy does not support HTTP transport');\n  }\n  public async close(): Promise<void> {\n    this.cachedClient = null;\n  }\n\n  public getServerInfo(): ServerInfo {\n    return {\n      id: this.id,\n      name: this.name,\n      description: this.description,\n      version_detail: {\n        version: this.version,\n        release_date: this.releaseDate,\n        is_latest: this.isLatest,\n      },\n    };\n  }\n","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/mcp/src/client/server-proxy.ts#L185-L221","documentation":"startHTTP() hosts an MCP server over streamable HTTP; MCPClientServerProxy is a client wrapper around a remote server and cannot serve HTTP itself, so it always throws. The throw marks the operation as unsupported rather than silently doing nothing.","triggerScenarios":"Calling startHTTP(options) on an MCPClientServerProxy — e.g. generic transport bootstrap that calls startHTTP on all registered servers.","commonSituations":"Uniform server startup code paths; mistaking a client proxy for a local MCPServer when wiring streamable HTTP endpoints.","solutions":["Call startHTTP() only on real MCPServer instances","Guard with instanceof MCPClientServerProxy and skip proxies","Delete the call — the proxy's remote server is already hosted elsewhere"],"exampleFix":"// before\nservers.forEach(s => s.startHTTP({ path: '/http' }));\n// after\nservers.filter(s => !(s instanceof MCPClientServerProxy)).forEach(s => s.startHTTP({ path: '/http' }));","handlingStrategy":"validation","validationCode":"if (proxy instanceof MCPClientServerProxy) throw new Error('startHTTP is only valid on MCPServer instances');","typeGuard":"function supportsHTTP(s: unknown): s is MCPServer {\n  return !(s instanceof MCPClientServerProxy);\n}","tryCatchPattern":"try {\n  await maybeServer.startHTTP(opts);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('does not support HTTP transport')) return;\n  throw e;\n}","preventionTips":["Guard transport startup with instanceof checks","Treat MCPClientServerProxy as read-only remote accessor — never host endpoints on it","Document in shared bootstrap code which server types support which transports"],"tags":["mcp","unsupported-transport","http","client-proxy"],"backgroundTag":"unsupported-transport","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}