Skip to content

feat: add quiet option to suppress DNS rebinding warning#1751

Open
LikiosSedo wants to merge 1 commit intomodelcontextprotocol:mainfrom
LikiosSedo:fix/suppress-dns-rebinding-warning
Open

feat: add quiet option to suppress DNS rebinding warning#1751
LikiosSedo wants to merge 1 commit intomodelcontextprotocol:mainfrom
LikiosSedo:fix/suppress-dns-rebinding-warning

Conversation

@LikiosSedo
Copy link

Summary

  • Add quiet option to createMcpExpressApp and createMcpHonoApp
  • When true, suppresses the console.warn about missing DNS rebinding protection when binding to 0.0.0.0 or ::
  • Useful for servers behind a reverse proxy or in containerized environments where the warning is not meaningful

Test plan

  • Added tests for both express and hono middleware confirming no warning when quiet: true
  • All existing tests continue to pass (warning still fires by default)

Closes #1515

When binding to 0.0.0.0 or :: without allowedHosts, the server logs a
warning about missing DNS rebinding protection. This is noisy for users
who intentionally bind to all interfaces (e.g. behind a reverse proxy
in a container). The new quiet option lets them opt out.

Closes modelcontextprotocol#1515
@LikiosSedo LikiosSedo requested a review from a team as a code owner March 25, 2026 14:21
@changeset-bot
Copy link

changeset-bot bot commented Mar 25, 2026

⚠️ No Changeset found

Latest commit: 4feacb5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 25, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1751

@modelcontextprotocol/server

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1751

@modelcontextprotocol/express

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@1751

@modelcontextprotocol/hono

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@1751

@modelcontextprotocol/node

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@1751

commit: 4feacb5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log pollution by unrequested warning output

1 participant