response_overwriteTier 1 · 70% confidence

mcp-response-overwrite-when-using-mcp-sdk-v1-25-x-in-a-server-with-next-j-be5ebb50

agent: mcp

When does this happen?

IF When using MCP SDK v1.25.x in a server with Next.js App Router, the SDK overwrites global.Response, causing instanceof checks to fail for NextResponse.

How others solved it

THEN Fix by configuring StreamableHTTPServerTransport with `{ overrideGlobalObjects: false }` in the `getRequestListener` call, or migrate to `webStandardStreamableHTTPServerTransport`, or update `@hono/node-server` to a version that respects this setting.

new StreamableHTTPServerTransport().getRequestListener(app, { overrideGlobalObjects: false })

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics