fix: prevent Hono from overriding global Response object (v1.x)#1411
Merged
mattzcarey merged 3 commits intov1.xfrom Jan 20, 2026
Merged
fix: prevent Hono from overriding global Response object (v1.x)#1411mattzcarey merged 3 commits intov1.xfrom
mattzcarey merged 3 commits intov1.xfrom
Conversation
|
commit: |
Pass `overrideGlobalObjects: false` to `getRequestListener()` calls in StreamableHTTPServerTransport to prevent Hono from overwriting the global Response object. This fixes an issue where frameworks like Next.js whose response classes extend the native Response would break after initializing MCP transport, as `instanceof Response` checks would fail. Also bumps @hono/node-server to ^1.19.9. Fixes #1369
5cd5d70 to
223d7ff
Compare
pcarleton
approved these changes
Jan 20, 2026
sgmakgg
added a commit
to boringstudio-org/mcp-gitea
that referenced
this pull request
Mar 13, 2026
…#17) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@modelcontextprotocol/sdk](https://modelcontextprotocol.io) ([source](https://github.com/modelcontextprotocol/typescript-sdk)) | dependencies | patch | [`1.25.2` → `1.25.3`](https://renovatebot.com/diffs/npm/@modelcontextprotocol%2fsdk/1.25.2/1.25.3) | --- ### Release Notes <details> <summary>modelcontextprotocol/typescript-sdk (@​modelcontextprotocol/sdk)</summary> ### [`v1.25.3`](https://github.com/modelcontextprotocol/typescript-sdk/releases/tag/v1.25.3) [Compare Source](modelcontextprotocol/typescript-sdk@v1.25.2...v1.25.3) #### What's Changed - \[v1.x backport] Use correct schema for client sampling validation when tools are present by [@​olaservo](https://github.com/olaservo) in [#​1407](modelcontextprotocol/typescript-sdk#1407) - fix: prevent Hono from overriding global Response object (v1.x) by [@​mattzcarey](https://github.com/mattzcarey) in [#​1411](modelcontextprotocol/typescript-sdk#1411) **Full Changelog**: <modelcontextprotocol/typescript-sdk@v1.25.2...v1.25.3> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45NC4zIiwidXBkYXRlZEluVmVyIjoiNDIuOTQuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: Renovate Bot <renovate@boringstudio.by> Co-authored-by: ChubbChubbs <sgmakgg@gmail.com> Reviewed-on: https://git.boringstudio.by/BoringStudio/mcp-gitea/pulls/17 Co-authored-by: boring-bot <bot@boringstudio.by> Co-committed-by: boring-bot <bot@boringstudio.by>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
overrideGlobalObjects: falsetogetRequestListener()calls inStreamableHTTPServerTransportResponseobjectResponseis preserved after transport initializationProblem
When
StreamableHTTPServerTransportis instantiated, Hono'sgetRequestListener()overwrites the globalResponseobject with its own implementation (by default). This breaks frameworks like Next.js whoseNextResponseclass extends the nativeResponse, causinginstanceof Responsechecks to fail.Fixes #1369
Test plan
Responseis not overwritten after transport constructionResponseis not overwritten afterhandleRequestis called