An MCP gateway is a proxy that sits between AI agents and the Model Context Protocol (MCP) servers that give them tools. Every tool call passes through it, so it can check who is calling, whether that tool and those arguments are allowed, whether sensitive data is leaving, and write a record of the decision. It is the main control point for MCP security, because the agent never talks to a tool directly.
What is MCP, and why does it need a gateway?
The Model Context Protocol is an open standard for connecting AI applications to external systems. An MCP server offers tools, such as "create a pull request" or "run this SQL", and an agent's MCP client calls them. The model decides which tool to call and with which arguments.
That is the problem. The model can be wrong, and it can be manipulated by text it reads, for example a web page or a ticket with hidden instructions. Without a control point, whatever the model asks for, the server does, with whatever credentials the agent holds. A gateway puts a decision between the request and the action, outside the agent's process, where the agent cannot switch it off.
What does an MCP gateway do?
Products differ, but a gateway built for security usually covers five jobs:
- Authentication. It verifies the caller's identity: which agent, which session and ideally which person the agent acts for. Credentials for the upstream server stay in the gateway, so the agent never holds a long-lived API key.
- Tool allow-lists. It decides which servers and tools each agent may see and call. Tools that are not allowed can be hidden from the tool list as well as refused.
- Per-argument policy. Allowing a tool is rarely enough. "Delete a pod" is fine in a test namespace and not in production. A good gateway matches rules on argument values, the user, the time and the session's history.
- Data loss prevention (DLP). It scans arguments and results for secrets and personal data, and redacts or blocks them before they cross the boundary.
- Audit. It records every decision, including denials, so you can show afterwards what each agent did and why it was allowed.
Some gateways add more: holding a call for human approval, rate limits and budgets, pinning tool definitions so a server cannot silently change a tool's description, and a kill switch.
Why not secure each MCP server on its own?
You should still harden servers. But per-server controls leave gaps. Each server implements authentication and logging differently, if at all. Policies end up scattered across teams. Nobody can answer "what did this agent do across all tools today?" from one place. And a rule like "after the agent reads an untrusted web page, it may not send email" spans two servers, so no single server can enforce it. A gateway sees the whole session, which is what makes cross-tool rules possible.
MCP gateway vs API gateway: what is the difference?
An API gateway routes and secures HTTP requests between clients and services. It knows paths, methods, API keys and rate limits. An MCP gateway speaks the Model Context Protocol, so it understands tools: which server, which tool, which arguments, and which agent session made the call. A governance gateway for agents goes one step further and decides on the action itself, with policy, human approval and an audit record that can be proved later.
| API gateway | MCP gateway | Governance gateway for agents | |
|---|---|---|---|
| Unit it sees | An HTTP request to a route | An MCP tool call to a server | Every agent action: tool, model and agent-to-agent calls |
| Identity | An API key or client token | The calling agent or client | The agent, its session and the person it acts for |
| Policy | Routes, methods, quotas | Which servers and tools are allowed | Tools, argument values, users, schedules and session history; default deny |
| Human in the loop | No | Sometimes | A call can wait for one or more approvers |
| Record | Access logs | Tool-call logs | A tamper-evident record of every decision, including denials |
They are not interchangeable, and they can work together: an API gateway can still sit in front of your services while an agent gateway decides what agents may ask those services to do.
What types of MCP gateway are on the market?
The market is young and crowded. Most offerings fall into one of three groups. The examples below are illustrations, not a ranking or a recommendation.
| API gateways adding MCP | Hosted and packaged MCP gateways | Agent runtimes with a gateway | |
|---|---|---|---|
| Starting point | An existing API or AI gateway extended to proxy MCP traffic | A service or tool built to aggregate and expose MCP servers | A platform that runs the agent and governs all of its calls |
| Examples | Kong | Amazon Bedrock AgentCore Gateway, Docker MCP Gateway | MAQPNA |
| Strengths | Reuses gateway skills, plugins and operations you may already have | Fast to adopt; one endpoint for many servers | Identity, isolation, policy, approvals and audit designed together |
| Questions to ask | Does policy understand tool names and arguments, or only HTTP routes? | Where does it run, and who holds the logs and credentials? | Does it fit your platform, and can you adopt it gradually? |
Whichever group you look at, ask the same questions. What happens when no rule matches: allow or deny? Can a call wait for a human? Can you prove the audit trail was not edited? Can you stop one agent within seconds? Where does it run, and does it send anything to the vendor?
How is the MAQPNA gateway different?
MAQPNA is an agent runtime, and its gateway is the part every call goes through: MCP tool calls, agent-to-agent calls, model calls and browser egress. Each agent session also runs in its own sandbox whose only network exit is the gateway, so the gateway cannot be bypassed by calling a tool directly. The differences that matter for MCP security:
- Default deny. If no policy applies to a call, it is denied. If a policy has no matching rule, its default action is deny unless you say otherwise. See policies, rules and decisions.
- Rules on arguments, users and history. Rules match on server, tool, argument values, the person the agent acts for, their groups, schedules and session taint, with three possible actions: allow, deny or require approval.
- Hold for approval. A rule can hold one call until a person approves it, with four-eyes quorum and no self-approval. See human-in-the-loop approval for AI agents.
- Credentials stay in the gateway. The agent holds a short-lived session token; upstream credentials are injected at the gateway and never reach the sandbox.
- Tool pinning. Tool definitions are hashed, and a changed definition can be hidden, held for approval or flagged. See MCP servers, tool pinning and A2A.
- DLP in-process. Deterministic detectors for secrets and personal data, with nothing sent to an outside classifier. DLP is off until you define a profile.
- A tamper-evident ledger. Every decision goes into a SHA-256 hash chain with signed checkpoints that you can verify offline. See tamper-evident audit trails for AI agents.
- Self-hosted. It runs on your Kubernetes cluster or laptop, with no vendor control plane and no phone-home.
What it does not do: MAQPNA does not stop a model from being fooled. It limits and records what a fooled agent can do. For the injection side, read prompt injection in agent tool calls. For how the pipeline runs step by step, see the gateway architecture and a governed tool call.
Related: how to stop an AI agent deleting a production database, AI agent governance and guardian agents.