An MCP gateway is a proxy server that mediates all communication between an AI agent and the MCP (Model Context Protocol) servers it connects to. Instead of the agent talking directly to tool servers, every request passes through the gateway where it is evaluated against safety policies.
MCP lets AI agents discover and call tools from external servers. A filesystem MCP server exposes file read/write tools. A database MCP server exposes query tools. When an agent connects directly, it can call any tool the server exposes with any arguments.
This creates risk:
The gateway runs as an MCP server itself. You point your agent at the gateway, and the gateway connects to the upstream MCP servers on the agent's behalf.
Agent → MCP Gateway → [Policy Check] → Upstream MCP Server
→ [Content Scan]
→ [Audit Log]
On every tool call, the gateway:
You can also enforce policies in your application code using the SDK. The gateway approach has different tradeoffs:
Gateway advantages: Works with any MCP client without code changes. One enforcement point covers all connected agents. Easy to deploy as infrastructure.
SDK advantages: More control over escalation handling. Lower latency (no extra network hop). Can access application context.
In many deployments, both are used together. The gateway provides a baseline, and the SDK adds application-specific rules.
The gateway exposes the same tools as the upstream servers. Tool discovery (the listTools call) passes through unchanged. The agent sees the full tool catalog. Filtering happens at call time, not discovery time.
This is a deliberate design choice. If the agent cannot see a tool, it cannot explain to the user why an action is not available. By letting the agent see all tools but blocking calls that violate policy, the agent can provide useful error messages.
The Authensor MCP gateway supports stdio and SSE transports. For production, run it as a persistent service and configure your agents to connect to it instead of directly to upstream servers. See the setup guide for instructions.
Explore more guides on AI agent safety, prompt injection, and building secure systems.
View All Guides