Private MCP Connectivity for Gemini Enterprise: Egress Gateway, PSC Network Attachment, and FQDN-Scoped DNS
A Google Cloud engineer describes how to route Gemini Enterprise tool calls to internal Cloud Run MCP servers using three coordinated mechanisms — Egress Agent Gateway with PSC Network Attachment, FQDN-scoped Private Cloud DNS, and dual-header authentication — resolving simultaneous constraints on public exposure, identity verification, and Shared VPC DNS safety.
When an enterprise moves a custom MCP server from prototype to production on Cloud Run, three constraints collide simultaneously. Security policy demands internal-only ingress, blocking all public traffic. The platform requires both service-level and user-level authentication on every tool call. And in large Shared VPCs hosting hundreds of Cloud Run services, a naive DNS override can hijack resolution for every other service on the network. Neeraj Agrawal, a Forward Deployed Engineer at Google Cloud, describes a three-part architecture that resolves all three at once.
The first component is an Egress Agent Gateway in Agent-to-Anywhere mode, connected via a PSC Network Attachment to a regional subnet. This places a managed network interface inside the enterprise VPC without public IPs or inbound firewall rules — the packet enters the private network at the attachment point rather than traversing the public internet. From inside the VPC, the request reaches Cloud Run's serverless frontend through either Private Google Access virtual IPs (199.36.153.8/30) or a global PSC endpoint (240.0.0.10), depending on whether the subnet retains a default internet route.
The second component addresses the DNS problem specifically. Without Private Cloud DNS, public resolution maps .run.app domains to public IPs that time out because the PSC Network Attachment does not route to the internet. The intuitive fix — a wildcard *.run.app private zone — breaks every other Cloud Run service in the Shared VPC. The solution Agrawal describes is to create a Private Cloud DNS zone scoped exclusively to the single MCP service's exact fully qualified domain name, then peer only that domain with the Agent Gateway. Because Cloud DNS uses longest-suffix matching, all other services continue resolving through their normal paths.