Gemini Enterprise can now reach internal-only Cloud Run MCP servers
A Google Cloud engineer's guide shows how to keep a custom MCP server off the public internet while Gemini Enterprise still calls it, with service and user identity checked on every request.

Google has published a reference architecture for connecting Gemini Enterprise to custom Model Context Protocol (MCP) servers on Cloud Run that accept no public internet traffic, using Egress Agent Gateway and Private Service Connect.
The post, dated Nov. 20 and written by Google Cloud forward deployed engineer Neeraj Agrawal, targets a common enterprise snag. Cloud Run suits lightweight StreamableHTTP MCP servers, but once a team sets ingress to internal-only, Gemini Enterprise’s default public calls stop working. According to Google, they are rejected at its edge with an HTTP 404.

Two network bridges and one narrow DNS zone
Gemini Enterprise runs in a Google-managed tenant project, while Cloud Run is serverless and has no internal IP inside a customer subnet. Google’s answer is two hops. First, a regional Egress Agent Gateway in Agent-to-Anywhere mode attaches to a Private Service Connect (PSC) Network Attachment in the customer’s subnet, in us-central1 or europe-west1. That places a managed network interface in the VPC without public IPs or inbound firewall rules.
The second hop gets the traffic from the VPC to Cloud Run’s frontend privately, so the service sees a legitimate source network. Google offers two options. Option A uses the Private Google Access address range 199.36.153.8/30 and suits standard VPCs that keep a default internet route. Option B uses a global PSC endpoint for Google APIs at 240.0.0.10, and works in locked-down VPCs where that default route has been deleted.

The DNS design is aimed at large Shared VPC setups. A wildcard private zone for *.run.app would override resolution for every Cloud Run service on the network. Instead, the guide creates a private zone for the MCP service’s exact hostname and peers only that name with the gateway. Because Cloud DNS matches the longest suffix, other services keep resolving as before. The gateway connects to the private address while keeping the service hostname in the TLS SNI and HTTP Host header, so Cloud Run routes to the right container.
Two identity checks on every tool call
Each request carries two separate credentials. The X-Serverless-Authorization header holds a Google-signed OIDC token for the project’s Gemini Enterprise service agent. Cloud Run IAM checks it against the Invoker role and strips it before the container sees the request. The standard Authorization bearer header carries the signed-in user’s OAuth 2.0 access token untouched, and the sample Python middleware validates it, returning 401 when the token is missing or invalid and OAuth is required.

Google splits setup into five steps: lock down Cloud Run and grant the Invoker role; provision the VPC, network attachment and gateway; create the single-hostname DNS zone and peering; bind the gateway in the Gemini Enterprise console and register the custom MCP server; then confirm in Cloud Logging that calls passed both checks. A companion repository, ge-secure-cloud-run-mcp on GitHub, holds the sample server, Dockerfile, smoke tests and scripts for both routing options.
What the platform documentation adds
The guide leans on controls that already exist, and Google’s documentation sets some boundaries around them. Cloud Run’s ingress page lists three settings: Internal, Internal and Cloud Load Balancers, and All. Under Internal, it names Gemini Enterprise among Google products in the same project that can reach a service through the default run.app URL. The page says other sources, including the internet, cannot reach the service, but it does not name an HTTP status code, so the 404 detail rests on the blog post alone.
The Agent Gateway VPC connectivity documentation lists constraints the blog does not spell out. The network attachment subnet must be at least a /28, larger if several gateways share it. The VPC MTU is capped at 1,500 bytes unless Google’s support approves more. DNS peering is supported through only one transitive hop, or three VPC networks at most. The networkAttachment setting cannot be changed once set, so the subnet plan needs care before rollout. Connectivity templates apply only to Agent-to-Anywhere gateways, and VPC Service Controls perimeters require the ALL_TRAFFIC egress mode.
For security teams the design is notable less for novelty than for separation of duties. Network reachability, service identity and user identity are enforced at three different layers, so a stolen user token alone would not pass Cloud Run IAM, and a compromised caller inside the VPC would still lack a valid user credential. That reasoning is an inference from the described design, not a claim Google makes, and the post offers no penetration-test or audit evidence.
Open questions for teams planning a rollout
The post does not say whether Egress Agent Gateway or the custom MCP data store is in preview or generally available, and the documentation page read for this article does not state it either. Regions are another gap: the guide names us-central1 and europe-west1 for the attachment, but no full supported list was found. Pricing for the gateway and PSC endpoint is not covered. Customers should also check the guide’s claims against their own environment, since Google’s account of the setup is not independently verified.
The effort lands as agent tooling spreads inside companies. Our earlier coverage of Nvidia’s OpenShell blueprint looked at pushing agent security down into the chip, while a piece on tool retrieval for AI agents covered how to keep hundreds of tools affordable. Google’s guide addresses a more basic question: how an agent platform reaches a tool that sits behind a private perimeter.
Sign Up for the Daily AI Pulse
One email a day. All the stories that matter.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Alex CarterAI News & Big Tech CorrespondentAlex Carter writes for Aiholics, keeping readers updated on the fast-paced world of AI and Big Tech.



