MCP security gateway
An MCP security gateway is an authorized mediation layer between MCP clients and registered servers that evaluates permitted protocol operations.
Verify identity and route
Validate token audience, issuer, expiry and scopes on each request. Route only to pre-registered upstreams. Never forward a client token to an unrelated server, and derive the tenant from trusted claims rather than a caller-supplied field.
- Bind credentials to the intended audience and use separate upstream credentials.
- Reject unknown origins and validate redirect and registration data.
- Apply per-tool and per-environment authorization in addition to transport authentication.
Inspect protocol operations
Apply authorization to discovery and invocation, resource reads and prompt retrieval. For HTTP transports, validate routing headers against the parsed body. Discovery is an authorization event, not a public directory listing.
| Surface | Decision point | Prototype status |
|---|---|---|
| tools/list | Filter tools by identity and scope | Local synthetic catalog |
| tools/call | Validate arguments and evaluate policy | Local synthetic lab, no forwarding |
| resources/read | Authorize each concrete URI or template expansion | One synthetic status resource |
| prompts/get | Treat prompt content as untrusted and scope by identity | One synthetic prompt |
| subscriptions | Bound fanout and authorize referenced resources | Not implemented |
| tasks | Bind task ownership, cancellation and expiry | Not implemented |
Support protocol revisions explicitly
The July 2026 MCP revision uses a stateless request model. Older initialization-based clients require a separately tested compatibility adapter. Pin the supported protocol and SDK revisions in a compatibility matrix, and reject unsupported versions rather than silently downgrading.
- Test header and body disagreement, invalid audience, cancellation and payload bounds.
- Never let a negotiated extension expand authority beyond the core policy decision.
- Treat tool annotations as untrusted hints, not security grants.
Questions and answers
Is the local MCP lab a production gateway?
No. It is a synthetic, localhost-only reference implementation with no authentication and no upstream forwarding. It must never be exposed remotely.
Which MCP versions are supported here?
The local lab supports a small legacy 2025-11-25 initialization subset, and the reference HTTP lab accepts a bounded 2026-07-28 stateless request shape for testing. Neither is a certified implementation.