Cloud SQL Auth Proxy
$ cloud-sql-proxy Official Low RiskCloud SQL Auth Proxy (cloud-sql-proxy) establishes secure TLS tunnels to Google Cloud SQL PostgreSQL, MySQL, and SQL Server instances using IAM credentials instead of IP allowlists or static SSL certs. Supports --port, --auto-iam-authn, and --structured-logs JSON output.
brew install cloud-sql-proxy cloud-sql-proxy binds a local TCP/Unix socket tunnel for database drivers and CLIs (psql/mysql); it is a network transport daemon rather than an MCP tool.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Deterministic non-interactive flags (--port, --structured-logs, --auto-iam-authn), though it runs as a persistent foreground tunnel daemon rather than a one-shot query CLI.
- Supports
--structured-logsfor JSON log entries - Long-running daemon requires background execution (
IsDaemon) by agents
Enforces mTLS + Google IAM authentication without exposing public database ports or static DB passwords.
- Replaces IP allowlisting with IAM-scoped TLS tunneling
Single static Go binary available via Homebrew and Google Cloud Storage downloads across macOS, Linux, and Windows.
- Available via
brew install cloud-sql-proxy
Standard local connector enabling psql, mysql, and migration tools to reach Cloud SQL safely.
- Supports automatic engine port detection and IAM DB login (
--auto-iam-authn)
Official Google Cloud Platform tool (GoogleCloudPlatform/cloud-sql-proxy) under Apache-2.0.
- Official GoogleCloudPlatform repository under Apache-2.0
Clear Cloud SQL docs and --help reference, though v1 vs v2 flag differences require attention.
- Official Google Cloud documentation and GitHub README
Security, Auth & Guardrails
Uses Google Application Default Credentials (GOOGLE_APPLICATION_CREDENTIALS, gcloud auth application-default login, or GCE/GKE workload identity).
Apache-2.0 open-source binary; connects to existing billable Cloud SQL instances.
# Cloud SQL Auth Proxy Agent Rules - Always start `cloud-sql-proxy` as a background daemon with explicit `--port` and `--structured-logs`. - Kill the proxy background task when finished; never hardcode service account JSON paths into repo files.
Agent-Ready Command Recipes
Safe Read-Only Queries
cloud-sql-proxy --version
Prints the v2 proxy version without opening network listeners.
cloud-sql-proxy my-project:us-central1:my-db --port 5432 --structured-logs --auto-iam-authn
Binds a local IAM-authenticated TLS tunnel on port 5432 emitting JSON log lines.
Strengths for Agents
- + Eliminates firewall allowlist sprawl using IAM-authenticated TLS tunnels.
- +
--structured-logsoutputs parseable JSON status and connection events. - + Zero-dependency static Go binary.
Caveats & Pitfalls
- ! Runs indefinitely as a network proxy daemon—agents must launch it in the background.
- ! v2 flag syntax (
cloud-sql-proxy <instance>) differs from legacy v1 (-instances=...).