GCP: Cloud Shell WebSocket-SSH, Antigravity CLI and gcloud-mcp default_deny
Public Discovery API, Cloud Shell transport, and @google-cloud/gcloud-mcp teardown: 528 API versions across 316 APIs, AddPublicKey HTTP 410 deprecation, 1,680s AuthorizeEnvironment credential keepalive, exact 10-command gcloud-mcp default_deny list, and Model Armor MCP filtering.
- Discovery + OIDC -> cloudshell v1 environment start
- WSS-SSH bearer tunnel + 28m AuthorizeEnvironment loop
- gcloud-mcp 10-cmd default_deny + Model Armor guard
Investigation question
How do GCP’s public Discovery APIs, Cloud Shell v1 REST/WebSocket-SSH transport, Antigravity CLI, and official Google Cloud MCP servers split control-plane access—and why does @google-cloud/gcloud-mcp deny Cloud Shell and SSH tunnels by default?
Observed
Cookie-free inspection of Google’s public APIs Discovery directory (528 versions across 316 unique APIs), 10 core Discovery specs (cloudshell v1, cloudresourcemanager v3, serviceusage v1, iam v1, cloudbilling v1, run v2, tpu v2, workstations v1, apihub v1, modelarmor v1), Google OIDC discovery, public Antigravity CLI manifests (antigravity.google/cli/install.sh), and pinned googleapis/gcloud-mcp source maps four distinct GCP agent boundaries. First, cloudshell.googleapis.com/v1 exposes 10 REST methods (Get, Start, Authorize, GenerateAccessToken, deprecated AddPublicKey returning HTTP 410 Gone, RemovePublicKey, and Operations polling at 500 ms). Both the browser terminal (shell.cloud.google.com) and gcloud cloud-shell ssh converge on the same Bearer-JWT WebSocket TCP tunnel (wss://{webHost}/_cloudshell/tcp/{22,2222}) into the VM’s persistent tmux daemon, while gcloud spawns a 1,680-second (28-minute) background AuthorizeEnvironment loop so short-lived 30-minute VM ADC tokens do not silently expire. Second, StartEnvironment errors with reason="ACCOUNT_UNVERIFIED" require human verification rather than retry loops. Third, pinned @google-cloud/gcloud-mcp hardcodes a 10-entry default_deny list blocking compute start-iap-tunnel, compute connect-to-serial-port, compute tpus tpu-vm ssh, compute tpus queued-resources ssh, compute ssh, cloud-shell ssh, workstations ssh, app instances ssh, interactive, and meta—while disabling a GA command denies alpha/beta/preview automatically. Fourth, gcloud services mcp enable is retired to a no-op while Model Armor (modelarmor/v1) governs MCP content security.
Inferred
Four design principles apply to GCP agent architectures: (1) pair typed or read-only MCP servers (@google-cloud/gcloud-mcp, observability-mcp, storage-mcp, backupdr-mcp, cloud-run-mcp, gke-mcp, genai-toolbox) with a fail-closed human gate on mutating/credential commands rather than expecting gcloud-mcp to drive Cloud Shell; (2) when bridging headless ACP or stream-json sessions into Cloud Shell over WSS-SSH, run non-PTY stdio outside tmuxId=0 to avoid ANSI corruption and human tab collision, and enforce 28-minute AuthorizeEnvironment refresh; (3) treat HTTP 410 on AddPublicKey as expected deprecation and rely on Bearer-JWT WebSocket tunneling; and (4) never parse Pantheon web console signed GraphQL hashes (@Signature) when public Discovery APIs and gcloud provide supported contracts.
Unknown & limitations
This public-specification and open-source MCP teardown does not expose Google’s internal Pantheon @Signature GraphQL server implementations, internal Borg/GCE scheduling internals, or live cloud billing mutations; no live GCP resources were modified or provisioned.
Architecture
GCP separates OnePlatform public REST/gRPC Discovery planes (*.googleapis.com with OIDC/PKCE auth), Cloud Shell’s 4-tier origin/OOPIF/WSS-SSH VM topology (shell.cloud.google.com -> 970-*.cloudshell.dev Code-OSS -> wss://{webHost}/_cloudshell/tcp/{22,2222} + 8080 file sidecar), Antigravity CLI binary distribution (agy acp, stream-json, remote-control), and official local/managed MCP servers.
Domain & data models
Core Discovery entities include cloudresourcemanager Organizations/Folders/Projects/Tags/Liens, iam Roles/ServiceAccounts/WorkloadIdentityPools, run Services/Revisions/Jobs, tpu Nodes/QueuedResources, modelarmor Templates/FloorSettings, and cloudshell Environment (SUSPENDED/PENDING/RUNNING/DELETING, webHost, deprecated publicKeys).
Workflows & state machines
Cloud Shell provisions via StartEnvironment -> 500 ms LRO poll (failing closed on ACCOUNT_UNVERIFIED) -> AuthorizeEnvironment (1,680s keepalive loop) -> GenerateAccessToken JWT -> 3-tier WSS-SSH fallback (port 22 Bearer JWT -> port 2222 Bearer JWT -> pubkey fallback, skipping HTTP 410 AddPublicKey).
API & protocol surfaces
528 Google API versions across 316 APIs in Discovery, cloudshell.googleapis.com/v1 (10 endpoints), modelarmor.googleapis.com/v1 (15 endpoints), Google OIDC PKCE/device endpoints, and the official Google Cloud MCP suite (@google-cloud/gcloud-mcp, observability-mcp, storage-mcp, backupdr-mcp, cloud-run-mcp, gke-mcp, genai-toolbox).