1. Why Static Bearer Tokens Fail in Multi-User MCP Deployments
Modern cloud MCP clients (such as Claude Organization Connectors and ChatGPT Connectors) expect standards-compliant OAuth 2.1 discovery. When an unauthenticated request hits `/mcp` or `/sse`, your server must return `HTTP 401` with `WWW-Authenticate: Bearer resource_metadata="..."` pointing to `/.well-known/oauth-protected-resource`.
Pairing `/.well-known/oauth-authorization-server`, `POST /auth/register` (RFC 7591 Dynamic Client Registration), and `S256` PKCE verification lets your team sign in with 1 click using corporate Google or Microsoft SSO—enforcing domain restrictions (`@yourcompany.com`) automatically.
2. Six-Layer Production MCP Hardening Matrix
Before exposing any internal CRM, billing, or SQL tool over HTTPS, verify all six controls below:
| Security Layer | Naive Prototype Pattern | Production HandworkBridge Standard |
|---|---|---|
| Transport & Discovery | Unauthenticated SSE URL | HTTPS + HTTP 401 RFC 9728 Challenge + PKCE S256 |
| Session Binding | Shared global session dictionary | Session IDs cryptographically bound to user identity |
| Scale-to-Zero Resilience | Container restart breaks active chats | Stateless session auto-rehydration ($0 idle compute) |
| URL / Fetch Tools | Unrestricted `fetch(url)` | DNS-resolved private-IP & cloud-metadata SSRF blocklist |
| Database Access | Raw SQL string pass-through | Parameterized read-only views + 5s timeout + row caps |
| Mutating Tools | Immediate execution | `validate_only` preview + 1-click human approval + audit log |