독서리서치레이더투자 프레임워크
로그인 / 회원가입
← 읽기로 돌아가기
뉴스중대2 분 소요DisconfirmAI 편집부

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.

2026-11-20

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.

로그인 / 회원가입
독서리서치레이더투자 프레임워크

The third component handles authentication. Gemini Enterprise sends two distinct headers on every request: an X-Serverless-Authorization header containing a Google-signed OIDC ID token for the service agent, which Cloud Run IAM verifies at the serverless edge and strips before the request reaches the container; and an Authorization Bearer header containing the signed-in user's OAuth 2.0 access token, which passes untouched to the MCP application code for per-user permission enforcement. The provided Python middleware example shows how to validate the user token while allowing health checks to bypass authentication.

The architecture is documented in a companion GitHub repository with sequential setup scripts covering both the Private Google Access and global PSC endpoint options, along with Cloud Console instructions and Cloud Logging verification steps.

출처

  • developers.googleblog.com↗
리서치 계속하기 →