modelcontextprotocol / modelcontextprotocol/typescript-sdk
Proposal: warn when a network-facing MCP server starts without authentication
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.4k
- Forks
- 2.2k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 4
Description
Summary
Consider having the SDK warn when a network-facing MCP server is started without any authentication, with an explicit opt-out. Today the SDK ships auth middleware (bearerAuth), but nothing signals when a server is exposed over HTTP with no auth at all — and that turns out to be extremely common.
Motivation (data)
I ran a full census of the official MCP Registry — every server exposing an HTTP endpoint (6,700 endpoints; 3,658 reachable). ~51% completed an unauthenticated initialize handshake (i.e. no auth at all), and independent scans (BlueRock, 2026) put OAuth adoption at ~8.5%. So this isn't an edge case — a majority of network-facing MCP servers ship with no auth, and many appear to do so unintentionally.
The SDK is the natural place to nudge the default, because it's where the server author actually stands up the transport.
Proposal
When a Streamable HTTP server transport is connected and no auth handler/middleware is detected, emit a one-time console.warn linking to the auth docs — with an explicit opt-out for intentionally-public servers, e.g.:
new StreamableHTTPServerTransport({ allowUnauthenticated: true }) // silences the warning
- Non-breaking — a warning, not enforcement.
- Opt-out keeps intentionally-public/localhost-dev servers quiet.
- Could also be scoped to non-loopback binds only (warn when listening on
0.0.0.0/public, stay silent on127.0.0.1).
Alternatives considered
- Docs only — lowest friction, but clearly not moving the needle given the numbers.
- A startup banner /
getting-startedguard. - External linting — I built an open-source checker for this (
npx @andreolf/mcpaudit <url>grades a server A–F on auth/SSRF/injection surface), but a signal inside the SDK reaches authors far earlier.
Offer
Happy to open a PR if there's appetite — I'd start with the warning + opt-out on the Streamable HTTP server transport and wire it against the existing bearerAuth middleware detection. Wanted to check on the desired shape (warn vs. docs vs. loopback-scoped) before writing code.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Streamable HTTP server transport entry point and inspect how the existing bearerAuth middleware is detected. Clarify whether the warning should depend on non-loopback binding, how the explicit opt-out is shaped, and what documentation it links to before implementing; done means the agreed warning is emitted once and intentional unauthenticated servers can silence it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100