MCP & Agents

MCP Gateway Architecture for Enterprise AI Agents

Where an MCP gateway sits between AI agents and enterprise systems, what it should and should not do, and how to put one in front of existing APIs and integration flows.

The Model Context Protocol (MCP) gives AI agents a standard way to discover and call tools. That is exactly what makes it attractive for enterprise integration, and exactly what makes it risky: once an agent can call a tool, it can create sales orders, change employee records or release payments as fast as it can reason. An MCP gateway is the control point that lets you offer those tools to agents without handing every agent a direct line into ERP, HR and finance.

Why agents need a gateway

Integration teams have solved this problem before. Twenty years ago point-to-point interfaces gave way to middleware; later, API gateways put a managed front door on business services. Agentic integration repeats the pattern with a new kind of consumer, one that chooses its own calls at runtime instead of following a fixed interface specification.

Without a central point, each agent team ends up wiring its own MCP servers, credentials and logging. You get the familiar symptoms: duplicated connectors, inconsistent security, no single view of what agents actually did, and no fast way to switch a misbehaving tool off. A gateway gives you one place to answer the questions auditors and operations teams will ask: which agent, acting for which user, called which tool, with what result?

MCP in one minute

MCP is an open protocol built on JSON-RPC 2.0. An MCP client (inside an agent or AI application) connects to an MCP server, which exposes three kinds of capability:

Clients discover tools with tools/list and invoke them with tools/call. Servers run locally over standard input/output, or remotely over HTTP (the Streamable HTTP transport). For enterprise use the remote HTTP form matters most, because that is the one you can put behind a gateway, secure with OAuth and operate centrally.

Updated for MCP 2026-07-28. Since the July 2026 revision MCP is stateless: there is no initialize handshake or Mcp-Session-Id, every request carries its protocol version and client capabilities in _meta, and HTTP requests carry Mcp-Method and Mcp-Name headers a gateway can route and authorize on. Servers that need more input mid-call use Multi Round-Trip Requests instead of calling back into the client. Details in What MCP 2026-07-28 changes for integration architects.

Reference architecture

MCP gateway reference architectureAI agents connect to an MCP gateway, which applies identity, policy and audit, then routes to MCP servers that call an API gateway and integration services in front of ERP, HR, CRM and finance systems. AI agents & copilotsMCP clients Identity providerOAuth tokens, user context Policy engineallow / deny / approve MCP gatewayauthenticate · authorize per tool · route · rate-limit · redact · audit · kill switch MCP server: Ordersget_order_status MCP server: HRlookup_employee MCP server: Financecreate_payment_request API gateway & integration flowsmanaged APIs, mappings, retries Systems of recordERP · HR · CRM · Finance
Agents never call systems of record directly. Every tool call passes through the gateway, then through the same managed APIs that other consumers use.

The key design decision is the bottom half of the diagram. MCP servers should be thin adapters over your existing managed APIs and integration flows, not new back doors into the database. The mappings, retries, error handling and monitoring your integration platform already provides keep working, and the agent becomes one more governed consumer.

What the gateway should do

CapabilityWhy it matters for agents
Server registry and routingOne endpoint for agents; the gateway decides which MCP servers each agent may even see.
Per-tool authorizationAccess is granted per tool, per agent and per user, not per server. Reading an order and cancelling one are different permissions.
Filtered discoveryReturn only permitted tools from tools/list. A tool the agent cannot see is a tool it cannot be tricked into calling.
Approval gatesPause high-impact calls (payments, master-data changes) for human confirmation.
Rate limits and quotasAgents retry and loop. Limits protect back-end systems from runaway reasoning.
Payload inspection and redactionBlock secrets and mask personal data in both arguments and results before they reach the model or the logs.
Audit trailRecord agent, user, tool, arguments summary, decision and outcome with a correlation ID.
Kill switchDisable one tool or one agent instantly, without redeploying anything.

Equally important is what the gateway should not do. It should not hold business logic, transform payloads between systems, or become the only authorization check. Those belong in the integration layer and the systems of record.

Identity and authorization

MCP's authorization specification for HTTP transports is based on OAuth 2.1 (hardened in 2026-07-28 with issuer validation and Client ID Metadata Documents; see agent identity and authorization): the MCP server (or the gateway in front of it) acts as an OAuth resource server and validates access tokens issued by your identity provider. In practice, design for three identities on every call:

  1. The user the agent is acting for. Their permissions should cap what the agent can do, so an agent should never be able to read a salary its user could not.
  2. The agent itself, registered as a distinct client so you can rate-limit, audit and revoke it independently.
  3. The downstream service identity the MCP server uses to call your APIs, scoped to the minimum the tool needs.

Avoid passing the user's token straight through to back-end systems. Exchange it at the gateway or MCP server for a narrowly scoped downstream token, so a leaked token from an agent session cannot be replayed against unrelated APIs. And keep enforcing authorization in the downstream APIs too: the gateway is one layer of defence, not the only one.

Worked example: an order-status tool on existing APIs

Suppose sales copilots need to answer "where is order 4500012345?". The order data lives in ERP, and an integration flow already exposes it as a managed REST API used by the customer portal. Rather than letting the agent query ERP, wrap that API as an MCP tool.

The tool definition the server advertises:

{
  "name": "get_order_status",
  "description": "Return delivery and billing status for one sales order. Read-only.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "orderId": { "type": "string", "pattern": "^[0-9]{10}$" }
    },
    "required": ["orderId"],
    "additionalProperties": false
  },
  "annotations": { "readOnlyHint": true }
}

The request flow:

Agent ──tools/call get_order_status──▶ MCP gateway
  1. validate OAuth token → user = j.smith, agent = sales-copilot
  2. policy: sales-copilot may call get_order_status for sales org US01 ✔
  3. schema check: orderId matches ^[0-9]{10}$ ✔
  4. route ──▶ MCP server "orders"
                 └─▶ API gateway  GET /orders/4500012345/status
                       └─▶ integration flow ──▶ ERP
  5. redact fields not needed for the answer
  6. audit: correlationId, user, agent, tool, decision, latency, outcome
◀── structured result returned to the agent

Notice what the agent never sees: ERP hostnames, technical users, or any field the portal API does not already expose. If you are on SAP BTP, the same shape applies with an SAP Cloud Integration flow behind SAP API Management; on other stacks, substitute your own iPaaS and API gateway.

Designing enterprise tools agents can use safely

Observability and operations

Run agent traffic like any other production integration. Propagate a correlation ID from the agent session through the gateway, MCP server, API gateway and integration flow so one search reconstructs the whole chain. Track per-tool error rates, latency and denied calls; a sudden rise in denials often means a prompt-injection attempt or a mis-scoped agent. Set timeouts shorter than the agent's own, so slow back ends fail predictably instead of leaving the model waiting. Version tools explicitly, and when a schema changes, publish a new tool rather than silently breaking agents that cached the old definition.

Gateway products in 2026

Most enterprises do not build a gateway from scratch. Commonly evaluated options include SAP Integration Suite's MCP Gateway (the endorsed path for agents reaching SAP systems; see our SAP guide), Amazon Bedrock AgentCore Gateway, Azure API Management, Kong AI Gateway, the open-source agentgateway project hosted by the Agentic AI Foundation, IBM ContextForge and Microsoft's open-source MCP Gateway. Several of these also proxy A2A agent-to-agent traffic. Choose the one that sits closest to the APIs you already govern, and make sure whichever you pick supports the 2026-07-28 revision's header-based routing and per-user filtered tool lists.

Common pitfalls

Implementation checklist

A gateway does not make a tool safe on its own. Combine it with narrow tool design, downstream authorization and human approval for anything that moves money or changes master data.

Related guides

Rameshkumar Varanganti

Enterprise Integration Lead and Architect with 20+ years in SAP integration (BTP Integration Suite, CPI, PI/PO, API Management, Event Mesh). Writes about agentic integration, MCP and AI governance.

← Back to knowledge library