AgentInterceptor / Field guide

MCP security gateway

An MCP security gateway is an authorized mediation layer between MCP clients and registered servers that evaluates permitted protocol operations.

PrototypeLast verified: Status: PUBLIC_PROTOTYPE

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.

MCP surfaces that need an authorization decision
SurfaceDecision pointPrototype status
tools/listFilter tools by identity and scopeLocal synthetic catalog
tools/callValidate arguments and evaluate policyLocal synthetic lab, no forwarding
resources/readAuthorize each concrete URI or template expansionOne synthetic status resource
prompts/getTreat prompt content as untrusted and scope by identityOne synthetic prompt
subscriptionsBound fanout and authorize referenced resourcesNot implemented
tasksBind task ownership, cancellation and expiryNot 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.

Work with your AI agent

Agent handoff

Copy a context-aware prompt naming this page and only the interfaces that actually exist in this package.

Open agent hub