{"record":{"id":"fddb107804fb7601","repo":"mastra-ai/mastra","slug":"mcpclientserverproxy-does-not-support-sse-transpor","errorCode":null,"errorMessage":"MCPClientServerProxy does not support SSE transport","messagePattern":"MCPClientServerProxy does not support SSE transport","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/mcp/src/client/server-proxy.ts","lineNumber":197,"sourceCode":"\n  public async readResource(uri: string): Promise<{ contents: Array<{ uri: string; text?: string; blob?: string }> }> {\n    const client = await this.getClient();\n    const result = await client.resources.read(uri);\n    return {\n      contents: (result.contents ?? []).map((c: any) => ({\n        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,","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/mcp/src/client/server-proxy.ts#L179-L215","documentation":"MCPClientServerProxy represents a client connection to a remote MCP server, so it cannot act as an SSE server. startSSE() is part of the MCPServer interface and throws here by design to signal misuse of the proxy as a server.","triggerScenarios":"Calling startSSE(options) on an MCPClientServerProxy — e.g. generic server bootstrap code that starts SSE endpoints for every entry in a server registry.","commonSituations":"Mounting Mastra servers on a Hono/Express app by iterating a mixed registry of real MCPServers and client proxies; confusing MCPClient (consumer) with MCPServer (provider).","solutions":["Only call startSSE() on genuine MCPServer instances","Filter the registry with instanceof MCPClientServerProxy before starting transports","Drop the call — the proxy already communicates over its configured client transport"],"exampleFix":"// before\nawait proxy.startSSE({ path: '/mcp' });\n// after\nif (server instanceof MCPServer) await server.startSSE({ path: '/mcp' });","handlingStrategy":"validation","validationCode":"if (proxy instanceof MCPClientServerProxy) throw new Error('startSSE is only valid on MCPServer instances');","typeGuard":"function canStartSSE(s: unknown): s is MCPServer {\n  return !(s instanceof MCPClientServerProxy);\n}","tryCatchPattern":"try {\n  await maybeServer.startSSE(opts);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('does not support SSE transport')) return;\n  throw e;\n}","preventionTips":["Filter registries by instanceof before mounting SSE endpoints","Only host SSE on MCPServer, not on client proxies","Separate client-connection bootstrap from server-hosting bootstrap code"],"tags":["mcp","unsupported-transport","sse","client-proxy"],"backgroundTag":"unsupported-transport","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}