Skip to content

docs: make DNS rebinding protection more prominent in server.md#1586

Merged
pcarleton merged 6 commits intomainfrom
paulc/pcp-57-dns-rebinding-docs
Feb 26, 2026
Merged

docs: make DNS rebinding protection more prominent in server.md#1586
pcarleton merged 6 commits intomainfrom
paulc/pcp-57-dns-rebinding-docs

Conversation

@pcarleton
Copy link
Member

@pcarleton pcarleton commented Feb 25, 2026

Summary

Make DNS rebinding protection guidance more prominent in docs/server.md to help developers secure localhost MCP servers.

Changes

  1. Added WARNING callout after the first Streamable HTTP example (NodeStreamableHTTPServerTransport) with links to the recommended alternatives.

  2. Expanded DNS rebinding section with:

    • Context on what DNS rebinding attacks are and why they matter
    • Explicit recommendation that all localhost MCP servers should use DNS rebinding protection
    • Mention of createMcpHonoApp() for Hono/Web Standard runtimes alongside the existing Express example
    • Guidance for custom framework users to implement Host header validation themselves

- Add WARNING callout after the first Streamable HTTP example noting that
  NodeStreamableHTTPServerTransport does not include DNS rebinding protection
- Link to createMcpExpressApp()/createMcpHonoApp() as recommended alternatives
- Expand the DNS rebinding section with context on the attack vector
- Mention createMcpHonoApp() for Web Standard runtimes
- Add guidance for custom framework users to implement Host header validation

Closes PCP-57
@pcarleton pcarleton requested a review from a team as a code owner February 25, 2026 19:29
@changeset-bot
Copy link

changeset-bot bot commented Feb 25, 2026

⚠️ No Changeset found

Latest commit: 8cd92e4

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 Feb 25, 2026

Open in StackBlitz

@modelcontextprotocol/client

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

@modelcontextprotocol/server

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

@modelcontextprotocol/express

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

@modelcontextprotocol/hono

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

@modelcontextprotocol/node

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

commit: 8cd92e4

Replace the minimal stateful example (which wasn't self-contained anyway)
with a minimal stateless example using createMcpExpressApp(), which includes
DNS rebinding protection by default. Link to simpleStreamableHttp.ts for
the full stateful pattern.
@pcarleton pcarleton merged commit 3391bfb into main Feb 26, 2026
18 of 19 checks passed
@pcarleton pcarleton deleted the paulc/pcp-57-dns-rebinding-docs branch February 26, 2026 16:58
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.

3 participants