AI Engineering••22 min read

MCP Gateway Compared: AgentCore vs Docker vs ContextForge

AgentCore Gateway, Docker, ContextForge, Microsoft, Kong, Cloudflare, LiteLLM and Obot MCP gateways compared on auth, tool search and hosting.

MCP Gateway Compared: AgentCore vs Docker vs ContextForge

TL;DR: An MCP gateway is a proxy that puts many Model Context Protocol servers behind one governed endpoint, handling authentication, tool filtering, credential injection and audit logs. AgentCore Gateway and Cloudflare MCP server portals are managed services. Docker, ContextForge, Microsoft, MetaMCP and Obot are open source you run yourself. Kong and LiteLLM add MCP to a gateway you may already operate.

Key Takeaways

  • MCP is easy to start with and hard to run at scale. Each new server brings its own credentials, tool list and failure modes. A gateway puts these at one choke point, so you can enforce policy there.
  • The MCP `2026-07-28` specification removed protocol sessions and the `initialize` handshake. Gateways can now route each request on its own, so check whether your gateway and clients support that revision.
  • Pick by where your agents already run. AWS-native agents fit AgentCore Gateway, Azure and Kubernetes fit Microsoft's MCP Gateway, Cloudflare Zero Trust shops fit MCP server portals, and existing Kong or LiteLLM deployments can add MCP as a plugin or feature.
  • Docker MCP Gateway is the best developer-workstation option. It runs each local server in its own container and shares one configuration across Cursor, VS Code and Claude Desktop.
  • IBM ContextForge and Obot are the broadest self-hosted governance platforms. ContextForge federates MCP, A2A and REST/gRPC. Obot adds virtual MCP servers, Git-backed catalogs and per-group tool profiles.
  • Tool search matters as much as auth. Three products in this comparison document a way to stop sending every tool definition into the model's context: AgentCore semantic search, Obot tool search, and Cloudflare Code Mode.

What is an MCP gateway, and why do agents need one?

An MCP gateway is a reverse proxy that speaks the Model Context Protocol on both sides. It looks like one MCP server to the client. Behind it sit many upstream MCP servers, REST APIs or Lambda functions. Requests come in on one endpoint, and the gateway then authenticates the caller, decides which tools that caller may see, injects the upstream credential, forwards the call and logs the result.

The need is obvious once an organisation has more than a handful of servers. Without a gateway, every developer's mcp.json holds its own list of servers and its own tokens, often as environment variables in plain text. Security teams cannot answer basic questions such as "which agents can call the Jira delete tool?" or "who ran this query against the production database?" A dev.to post trending this week, MCP Is Dead Simple. And That's Exactly the Problem, makes the same point from the builder's side. The protocol takes an afternoon, while safety, idempotency and access control take the rest of the project.

A gateway handles five jobs that individual MCP servers usually do not:

If you only need model routing, budgets and fallbacks, you want an LLM gateway instead. We compare those in LiteLLM vs Portkey vs OpenRouter. Several products now do both, which is part of why the market is confusing.

How did the MCP 2026-07-28 spec change gateway design?

The 2026-07-28 MCP specification is the biggest change for gateway builders since Streamable HTTP. It removes protocol-level sessions and the Mcp-Session-Id header. It also drops the initialize / notifications/initialized handshake. Every request now carries its protocol version and client capabilities in _meta. Servers must implement a server/discover RPC, and tools/list no longer varies per connection.

For a gateway, this changes three things:

  1. No sticky sessions. Under the 2025 revisions, a gateway in front of a stateful server had to pin a client to the same backend replica, or keep session state in Redis. Stateless requests can go to any healthy replica. Microsoft's gateway README says plainly that multiple router instances "can handle requests without transport-session affinity."
  2. Per-request authorization becomes natural. Each request is self-describing, so the gateway can evaluate policy on every call instead of once at session start. That closes the gap where a revoked user kept a live session.
  3. Version mismatches are explicit. Old and new clients will coexist for a while. A gateway that translates between revisions saves you from upgrading every client at once. Gateways that do not translate force a big-bang migration.

This is the first question to ask any vendor. Microsoft's MCP Gateway now requires 2026-07-28 clients and does not downgrade. Cloudflare's portals accept both stateless 2026-07-28 and 2025 Streamable HTTP clients and pick a version per connection. ContextForge lets you choose a protocol version per gateway. LiteLLM negotiates the version during initialize, which suggests it was still on the session-based model when we checked. Test your own clients before you commit.

How do the eight MCP gateways compare at a glance?

MetaMCP deserves a mention as a lightweight aggregator. It is MIT-licensed, ships in one Docker Compose stack, groups servers into namespaces and applies middleware. Its README also says maintenance has slowed, so weigh that before you depend on it in production.

How does Amazon Bedrock AgentCore Gateway work?

AgentCore Gateway is AWS's fully managed option. It has grown well past "MCP tool gateway". AWS now describes it as a single entry point for agent traffic to tools, to other agents (including A2A passthrough targets) and to LLMs, with a model-based routing endpoint. Our earlier AgentCore Gateway evaluation covers its architecture patterns in depth. Here we only place it against the field.

What sets it apart:

  • Targets that are not MCP servers. You point it at an OpenAPI spec, a Smithy model or a Lambda function, and it generates MCP tools. For enterprises with years of internal REST APIs, this saves the most work. Nobody has to write or host an MCP server.
  • Ingress and egress auth in one managed service. Inbound, it validates the agent's identity through IAM or an OAuth/JWT authorizer. Outbound, it fetches the downstream API key or OAuth token from AgentCore Identity. The agent never holds the Salesforce token.
  • Semantic tool search. When enabled, the gateway exposes a built-in `x_amz_bedrock_agentcore_search` tool. The agent describes its task, and the gateway returns only the relevant tools instead of the whole catalogue.
  • One-click SaaS integrations for Salesforce, Slack, Jira, Asana and Zendesk.

The trade-off is the usual managed-service one. It is excellent when your agents run on AgentCore Runtime or Lambda, and awkward when your agents run on a laptop in Cursor, or on another cloud. The gateway itself works with any MCP client, but IAM-based inbound auth assumes AWS principals. A multi-cloud estate will end up building an OAuth authorizer path anyway.

The snippet uses the 2025 session-style Python client API. Adjust it to whatever MCP revision your SDK version targets.

When is Docker MCP Gateway the right choice?

Docker MCP Gateway is the engine under Docker Desktop's MCP Toolkit, and it also runs on its own as a docker mcp CLI plugin. It is built for the developer's machine and for CI, not as a company-wide control plane, and it does that job better than anything else here.

Its core idea is isolation. Every local MCP server from the Docker MCP Catalog runs in its own container, and npx/uvx servers get minimal host privileges. The npx some-mcp-server habit, which runs unaudited code with your full user permissions, is one of the riskiest parts of today's MCP ecosystem. The gateway removes it. Secrets live in Docker Desktop's secret store instead of environment variables. OAuth flows for servers such as GitHub are handled by the gateway.

Servers are grouped into profiles. A profile can be connected to a client, exported as YAML, and pushed to or pulled from an OCI registry. That last feature is the useful one for teams: a platform team can publish a vetted dev-tools profile, and every developer pulls the same set.

Where it stops: there is no multi-tenant identity layer, no per-group RBAC and no central audit across a fleet of laptops. Use it for workstation hygiene and pair it with a central gateway for shared, production-facing tools.

What makes IBM ContextForge different?

ContextForge (formerly "MCP Context Forge") takes the widest scope of the self-hosted options. It describes itself as a registry and proxy that federates MCP, A2A and REST/gRPC APIs behind one endpoint. In practice it is three gateways in one:

  • Tools gateway. It federates MCP servers, wraps REST endpoints as MCP tools, and translates gRPC services into MCP through reflection-based discovery. It also offers TOON compression to shrink tool payloads.
  • Agent gateway. It routes A2A traffic plus OpenAI-compatible and Anthropic-style agent endpoints.
  • API gateway. It provides rate limiting, auth, retries and a reverse proxy for plain REST services.

Two features matter most for platform teams. Virtual servers let you compose a curated MCP server from tools spread across many backends, such as "the support-agent server" with eight tools drawn from four systems. A plugin system with more than 40 plugins lets you add guardrails, PII filters or extra transports without forking. Observability is OpenTelemetry-native, with documented exporters for Phoenix, Jaeger and Zipkin. If you already run Phoenix or Langfuse for agent traces, tool calls land in the same view as model calls.

It deploys from PyPI (uvx), as a container, or on Kubernetes with Redis-backed federation across clusters. It also includes an admin UI that supports air-gapped installs. The cost of that breadth is configuration surface. ContextForge rewards a team that will own it as a platform, and it is heavy for a team that just wants five servers behind one URL.

How does Microsoft's MCP Gateway fit Kubernetes platforms?

Microsoft's MCP Gateway is the most Kubernetes-native option. It splits cleanly into a data plane and a control plane:

  • The control plane deploys, updates and deletes MCP servers as Kubernetes workloads through `/adapters` and `/tools` CRUD APIs. You register a server image, and the gateway runs the pods.
  • The data plane routes requests either to a named adapter (`/adapters/{name}/mcp`) or through a tool gateway router at `/mcp`. The router looks up which registered server owns a tool and dispatches to it.

Authentication is bearer-token with RBAC on both planes, plus Entra ID app roles (such as mcp.admin) for per-server and per-tool authorization. Metadata lives in Redis locally or Cosmos DB in Azure. The proxy keeps no session state. As noted above, the current version requires MCP 2026-07-28 clients, which makes it the most forward-leaning gateway in this comparison, and the least forgiving if your client fleet lags.

It is the obvious choice for teams on AKS with Entra ID. Outside Azure it still runs on any Kubernetes cluster, but you lose the integrated identity story, and the optional "Agents & Sessions" preview depends on Azure AI Foundry. Microsoft labels that subsystem single-replica, so keep it out of production.

Should you add MCP to Kong or LiteLLM instead of a new gateway?

Often, yes. The cheapest gateway to operate is the one your platform team already runs.

Kong's AI MCP Proxy plugin (Kong Gateway 3.12+, AI Gateway Enterprise licence) works in three modes. It can proxy upstream MCP servers, convert an existing Kong-managed REST service into MCP tools by mapping tool calls to OpenAPI operations, or expose grouped tools as one MCP server. The payoff is that Kong's existing plugins now apply to MCP traffic: OpenID Connect, key auth, rate limiting, ACLs per consumer group, request transformation and logging. If your APIs are already behind Kong, agent access becomes a plugin configuration instead of a new system. Kong's documentation warns against mixing this plugin with other AI plugins on the same route or service.

LiteLLM's MCP Gateway adds a fixed /mcp endpoint to the LiteLLM proxy. It supports Streamable HTTP, SSE and stdio transports, and stdio is off by default unless LITELLM_ENABLE_MCP_STDIO=true, which is a sensible default. Tool access is controlled with the same virtual keys, teams and organisations that already govern model spend. Tools from several servers are namespaced by server-name prefix. A REST shortcut (/mcp-rest/tools/call) lets you test a tool with curl, no LLM required. For a team where LiteLLM already holds every provider key, putting MCP permissions in the same place is the natural move.

Neither is the strongest pure MCP governance product. Both avoid the operational cost of a new stateful service, a new admin UI and a new on-call rotation.

What do Cloudflare MCP server portals and Obot add for governance?

These two take an organisation-wide view: every employee's AI client, not just your production agents.

Cloudflare MCP server portals live inside Cloudflare One (Zero Trust). A portal puts many MCP servers behind one URL protected by Cloudflare Access. Users log in through the company IdP, then authorise separately to each upstream server that needs OAuth. Admins choose which tools and prompts each portal exposes, and can rename tools and rewrite descriptions without touching the upstream server. That matters more than it sounds, because tool descriptions are an injection surface, as we saw with WebMCP tool-description injection. Two features stand out:

  • Code Mode collapses all upstream tools into two tools, one for search and one for code execution. The agent writes JavaScript against typed methods, and the code runs in an isolated Dynamic Worker. For large tool estates it is a different answer to the context problem than semantic search.
  • DLP and logging. Portal traffic can be routed through Cloudflare Gateway for HTTP logs and data-loss-prevention scanning on tool arguments and results.

Obot is an open-source platform with both an MCP gateway and an LLM gateway. Its MCP gateway exposes virtual MCP servers (vMCPs) that combine catalog servers behind one endpoint. Each component is pinned to a catalog snapshot, so upstream catalog changes only take effect through an explicit upgrade. Access is set per IdP group through vMCP profiles. MCP tunnels reach servers on private networks over outbound-only connections. Request and response filters can inspect, reject or modify MCP traffic. Catalogs are Git-backed and also exposed through the standard MCP Registry API. Obot can host npx, uvx and container servers itself with domain-based egress rules, and it can turn any OpenAPI-described API into a hosted MCP server.

Pick Cloudflare if you are already a Cloudflare One customer and want zero new infrastructure. Pick Obot if you want the same kind of governance self-hosted, with catalogs under version control.

How do you solve the "too many tools" context problem?

Teams discover this problem after authentication. Connect 15 servers and you can easily expose 300+ tools. Every tool definition goes into the model's context on every turn. That costs tokens, and it measurably hurts tool selection: models pick wrong tools more often when the list is long and the descriptions overlap.

The gateways take four distinct approaches:

The approaches combine. A sound production pattern: curate statically per agent role, so the support agent never sees deploy tools, then add search inside that curated set. This mirrors the advice in our context engineering guide. The best context is the context you never load. If you are weighing skills against MCP tools for capability loading, see Skills vs MCP, which covers the same trade-off from the agent side.

What security controls should an MCP gateway enforce?

A gateway is only as useful as the policies it enforces. Whichever product you choose, check these controls:

  1. The agent never holds upstream secrets. Credentials are injected at the gateway (AgentCore Identity, Obot secret bindings, Docker's secret store, Kong vaults). If a prompt injection leaks the agent's context, it should leak nothing reusable.
  2. Authorization is deterministic, not LLM-judged. Decide tool access with IAM, RBAC, ACLs or Cedar-style policies. Never ask a model whether a call is allowed. We argue this in detail in LLM vs policy engine for agent authorization.
  3. Tool descriptions are pinned and reviewed. A server update can change a tool's description to include instructions to the model, a "rug pull". Obot's catalog snapshots, Cloudflare's description overrides and Docker's versioned profiles all reduce this risk. Unpinned `latest` servers do not.
  4. Local servers run sandboxed. Containers (Docker, Obot hosted servers) or isolates (Cloudflare Workers), with egress restricted to the domains each server needs.
  5. Destructive tools need a second gate. Rate-limit or require human approval for write and delete tools at the gateway, not in the prompt. A prompt instruction is a request, while a gateway rule is enforced on every call.
  6. Every call is logged with identity. User, agent, tool, arguments hash and result status, exported to your SIEM. This is what lets you answer an incident question in minutes instead of days, as our GitLost repo-leak analysis showed.

Which MCP gateway should you choose?

Start from where your agents and identities already live, not from feature lists:

  • Agents on AWS (AgentCore Runtime, Lambda, ECS) with internal REST APIs → AgentCore Gateway. The OpenAPI/Smithy/Lambda-to-MCP conversion plus managed egress credentials removes the most custom code. Our AgentCore best-practices guide covers the surrounding setup.
  • Developers using Cursor, VS Code or Claude Desktop with local servers → Docker MCP Gateway, with profiles published to your registry.
  • AKS and Entra ID, and you can move clients to MCP 2026-07-28 → Microsoft MCP Gateway.
  • Many protocols to unify (MCP, A2A, REST, gRPC), self-hosted, possibly air-gapped → IBM ContextForge.
  • Company-wide governance of every employee's AI client, self-hosted → Obot. Choose Cloudflare MCP server portals if you are already on Cloudflare One.
  • APIs already behind Kong → Kong AI MCP Proxy. Model traffic already through LiteLLM → LiteLLM's MCP gateway.

Many organisations will end up with two layers: Docker (or Obot's CLI) on the workstation for isolation, and one central gateway for shared, production-facing tools. That is fine as long as the central gateway is the only path to production credentials. Whatever you choose, prove one thing before rollout: run a client against the gateway with a token that should not see a tool, and confirm the tool is absent from the list, not just refused when called. Hiding the tool prevents the model from trying it at all, while a refusal still tells it the tool exists.

Frequently Asked Questions

What is the difference between an MCP gateway and an LLM gateway?

An MCP gateway governs tool traffic: which tools an agent can list and call, with what credentials, and with what logging. An LLM gateway governs model traffic: routing, fallbacks, budgets and provider keys. Products such as Obot, LiteLLM and AgentCore Gateway now offer both, but the policies are separate concerns and should be configured separately.

What are the best alternatives to AWS AgentCore Gateway?

For self-hosted deployments, IBM ContextForge and Obot are the closest in scope. Both can turn REST APIs into MCP tools and centralise credentials. Kong's AI MCP Proxy suits teams with existing Kong estates. Cloudflare MCP server portals are the main managed alternative outside AWS, and Microsoft's MCP Gateway fits Azure and Kubernetes platforms.

Is Docker MCP Gateway suitable for production?

It is production-quality for what it targets: isolated execution of MCP servers on workstations and in CI, with shared profiles and secret handling. It lacks multi-tenant identity, group-level RBAC and fleet-wide audit. For shared production tools, put a central gateway such as ContextForge, Obot or AgentCore Gateway in front, and keep Docker for local isolation.

Do MCP gateways support the stateless MCP 2026-07-28 specification?

Support varies. Microsoft's MCP Gateway requires 2026-07-28 clients and offers no downgrade. Cloudflare MCP server portals accept both 2026-07-28 and 2025 Streamable HTTP clients. ContextForge lets you choose the protocol version per gateway. Check each gateway's release notes and test your actual clients, because mixed fleets are normal during the transition.

How does an MCP gateway reduce tool-definition context bloat?

It limits what the model sees. Static curation exposes only the tools a role needs. Semantic search, offered by AgentCore Gateway and Obot, returns task-relevant tools on demand. Cloudflare's Code Mode replaces all tools with a search tool and a code-execution tool. Combining curation with search usually gives the best accuracy per token.

Can an MCP gateway stop prompt injection through tool results?

Not on its own. A gateway can block calls the caller is not authorised to make, filter or redact responses, and pin tool descriptions so they cannot change silently. It cannot make the model ignore malicious text inside a legitimate result. Treat tool output as untrusted input, and keep destructive tools behind deterministic approval gates.

Sources

📬 Get this weekly →

Subscribe to the newsletter

By subscribing, you agree to our Terms of Service and Privacy Policy.

About the Author

Aaron is an engineering leader, software architect, and founder with 18 years building distributed systems and cloud infrastructure. Now focused on LLM-powered platforms, agent orchestration, and production AI. He shares hands-on technical guides and framework comparisons at fp8.co.

Cite this Article

Aaron. "MCP Gateway Compared: AgentCore vs Docker vs ContextForge." fp8.co, November 18, 2026. https://fp8.co/articles/MCP-Gateway-Comparison-AgentCore-vs-Docker-vs-ContextForge

Related Articles

AWS Bedrock AgentCore Gateway vs Enterprise AI Gateways

AgentCore Gateway evaluation: compare AWS managed MCP integration, tool discovery, authentication, and deployment against self-hosted alternatives.

AI Engineering

MCP Explained: Complete Protocol Guide 2026

Claude MCP explained: JSON-RPC tools/list and tools/call, a Streamable HTTP client guide, and authorization and security best practices from the spec.

AI Development Tools

LLM Gateway Compared: LiteLLM vs Portkey vs OpenRouter

LiteLLM, Portkey, OpenRouter, Cloudflare and Vercel AI Gateway compared on fallbacks, fees, self-hosting and lock-in. Which LLM gateway fits your stack?

AI Engineering