What is an MCP gateway?

An MCP gateway is a single server that stands between AI agents and many MCP tools and presents them as a smaller surface. Because the calls pass through it, authentication, secrets and the evidence of what was called can sit in one place.

How it works

Without a gateway, an agent is connected to each MCP server and is exposed to every tool directly. A gateway puts one server in front of them. The agent gets fewer and clearer entry points, and the gateway passes each call to the tool behind it.

A remote gateway is also a system boundary. Most MCP work begins on a laptop, where a server runs over stdio. An agent in a cloud runtime cannot depend on that. So a remote gateway speaks Streamable HTTP, has an endpoint that can be registered for agents, and checks who is calling before anything runs. Secrets stay in the secret manager of the platform. Tool calls leave evidence that can be read after the run.

Where it shows up in real work

MetaMCP is my open-source gateway. It started as a way to reduce many MCP tools into a smaller tool surface. The next question was practical: can that surface live behind Cloud Run, be registered for agents and leave evidence after tool calls?

The answer kept stdio for local use and added Streamable HTTP for Cloud Run. Around it I added Docker and Cloud Build artifacts, a pipeline file, setup notes for IAM and Secret Manager, Agent Registry manifests and a Google ADK sample that consumes the registered toolset. Authentication combines the caller identity of Cloud Run with a bearer token checked by the application. Smoke tests cover health, authentication, initialization and the tools list.

What it is not

A gateway is not the permission model of your data. It decides who reaches the tools, while database grants and application authorization still decide what a caller may read or change. My case study is also not an independent security audit or a published concurrency benchmark.

When you need one

One server on one laptop does not need a gateway. You need one when agents run in a cloud runtime, when they would otherwise be exposed to every tool of every server, or when someone will ask what an agent did and the answer has to be evidence. That is the moment when agents stop living in a demo window. Then the boring parts become the product: endpoints, service accounts, secrets, deployment scripts, tests, logs, contracts and evidence.

Work and evidence

MetaMCP as a Cloud Run MCP gateway (opens in a new tab)

My contribution: Built and documented the cloud-facing gateway path, registration artifacts, smoke checks and evidence export.

What this supports: Public implementation account covering transport, caller identity, secrets and tool-call evidence.

What it does not establish: The case study is not an independent security audit or a published concurrency benchmark.

Source reviewed:

Common questions

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

An MCP server exposes the functions of one system. A gateway is a server placed in front of many tools, so agents get fewer, clearer entry points and do not see every tool directly. To the agent, the gateway is one MCP surface.

Can an MCP server run on Cloud Run?

Yes, over Streamable HTTP. A cloud agent cannot depend on local stdio, so the remote path needs an HTTP transport, an endpoint, caller identity and secrets managed by the platform. MetaMCP keeps stdio for local use and adds Streamable HTTP for Cloud Run.

How does authentication work in an MCP gateway?

In MetaMCP it has two layers: the caller identity that Cloud Run verifies and a bearer token that the application checks. A token must be intended for the service that receives it. The credentials of the databases behind the tools are a separate boundary and are never given to the model.

How do I know what an agent did through the gateway?

From the records kept around the call: logs, smoke tests, prompt fixtures and a ledger. MetaMCP keeps a ledger file and exports it as evidence, so important agent work can be reviewed after the run.

Open to senior AI engineering roles and contract engagements, remote in the US, Mexico and Latin America.