mastra-ai/mastra · error · Error

MCPClientServerProxy does not support Hono SSE transport

Error message

MCPClientServerProxy does not support Hono SSE transport

What it means

startHonoSSE() serves an MCP server over SSE inside a Hono app; MCPClientServerProxy is a client-side wrapper and cannot host any HTTP endpoint, so it throws unconditionally. It exists only to satisfy the MCPServer interface shape.

Solutions

  1. Call startHonoSSE() only on MCPServer instances
  2. Skip client proxies via instanceof check before mounting routes
  3. Remove the mount call — remote servers are already reachable via the proxy client

Example fix

// before
app.route('/mcp', createRoute(proxy.startHonoSSE.bind(proxy)));
// after
if (!(proxy instanceof MCPClientServerProxy)) proxy.startHonoSSE({ path: '/mcp' });
Defensive patterns

Strategy: validation

Validate before calling

if (proxy instanceof MCPClientServerProxy) throw new Error('startHonoSSE is only valid on MCPServer instances');

Type guard

function isHonoMountable(s: unknown): s is MCPServer {
  return !(s instanceof MCPClientServerProxy);
}

Try / catch

try {
  await maybeServer.startHonoSSE(opts);
} catch (e) {
  if (e instanceof Error && e.message.includes('does not support Hono SSE transport')) return undefined;
  throw e;
}

Prevention

When it happens

Trigger: Calling startHonoSSE(options) on an MCPClientServerProxy, typically when uniformly registering all servers (real and proxied) as Hono routes.

Common situations: Auto-mounting every entry of MCPClients.getStandardServers()/registry onto a Hono app; mixing client connections with server hosting in shared bootstrap code.

Related errors


AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30). Data as JSON: /api/errors/bcefe2ce93282f75. Report an issue: GitHub.

Appendix: source

Thrown at packages/mcp/src/client/server-proxy.ts:200

    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,
        release_date: this.releaseDate,
        is_latest: this.isLatest,
      },

View on GitHub (pinned to 75dd419e61)