mastra-ai/mastra · error · Error
MCPClientServerProxy does not support SSE transport
Error message
MCPClientServerProxy does not support SSE transport
What it means
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.
Source
Thrown at packages/mcp/src/client/server-proxy.ts:197
public async readResource(uri: string): Promise<{ contents: Array<{ uri: string; text?: string; blob?: string }> }> {
const client = await this.getClient();
const result = await client.resources.read(uri);
return {
contents: (result.contents ?? []).map((c: any) => ({
uri: c.uri ?? uri,
...(c.text !== undefined ? { text: c.text } : {}),
...(c.blob !== undefined ? { blob: c.blob } : {}),
})),
};
}
// Transport methods — not applicable for client proxies
public async startStdio(): Promise<void> {
throw new Error('MCPClientServerProxy does not support stdio transport');
}
public async startSSE(_options: MCPServerSSEOptions): Promise<void> {
throw new Error('MCPClientServerProxy does not support SSE transport');
}
public async startHonoSSE(_options: MCPServerHonoSSEOptions): Promise<Response | undefined> {
throw new Error('MCPClientServerProxy does not support Hono SSE transport');
}
public async startHTTP(_options: MCPServerHTTPOptions): Promise<void> {
throw new Error('MCPClientServerProxy does not support HTTP transport');
}
public async close(): Promise<void> {
this.cachedClient = null;
}
public getServerInfo(): ServerInfo {
return {
id: this.id,
name: this.name,
description: this.description,
version_detail: {
version: this.version,View on GitHub (pinned to 75dd419e61)
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
Example fix
// before
await proxy.startSSE({ path: '/mcp' });
// after
if (server instanceof MCPServer) await server.startSSE({ path: '/mcp' }); Defensive patterns
Strategy: validation
Validate before calling
if (proxy instanceof MCPClientServerProxy) throw new Error('startSSE is only valid on MCPServer instances'); Type guard
function canStartSSE(s: unknown): s is MCPServer {
return !(s instanceof MCPClientServerProxy);
} Try / catch
try {
await maybeServer.startSSE(opts);
} catch (e) {
if (e instanceof Error && e.message.includes('does not support SSE transport')) return;
throw e;
} Prevention
- 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
When it happens
Trigger: Calling startSSE(options) on an MCPClientServerProxy — e.g. generic server bootstrap code that starts SSE endpoints for every entry in a server registry.
Common situations: 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).
Related errors
- MCPClientServerProxy does not support Hono SSE transport
- MCPClientServerProxy does not support stdio transport
- MCPClientServerProxy does not support HTTP transport
- Could not connect to server with any available HTTP transpor
- Tool '${toolId}' not found on remote MCP server '${this.name
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/fddb107804fb7601.
Report an issue: GitHub.