feat(tools): add cloud-sql-connect-gce for pg, mysql, mssql - #3740
Conversation
… Server Adds three new tools that help an LLM connect a Cloud SQL instance to a Google Compute Engine VM. Each tool validates network reachability between the instance and VM, recommends a connection method (Auth Proxy, Connector, or Direct Private IP), and returns setup steps plus an optional language-specific code snippet (Python, Node.js, Java, Go). - internal/tools/cloudsqlpg/cloudsqlpgconnectgce (cloud-sql-postgres-connect-gce) - internal/tools/cloudsqlmysql/cloudsqlmysqlconnectgce (cloud-sql-mysql-connect-gce) - internal/tools/cloudsqlmssql/cloudsqlmssqlconnectgce (cloud-sql-mssql-connect-gce) Shared logic (validation, recommendations, setup steps, code generation) lives in internal/util/cloudsqlconnect. All user-supplied identifiers (instance_connection_name, vm_name, vm_zone, database_name) are validated against GCP naming rules via regex whitelists in inputvalidate.go before they flow into shell commands, DSN/JDBC templates, or GCE list filters. Tools are registered in cmd/internal/imports.go and follow the upstream tools.ConfigBase / tools.BaseTool[Config] pattern with typed util.ToolboxError returns. Unit tests exercise YAML parsing; integration tests (behind //go:build integration) drive the tools end-to-end against a real Cloud SQL instance and GCE VM when the relevant env vars are set.
There was a problem hiding this comment.
Code Review
This pull request introduces three new tools (cloud-sql-mssql-connect-gce, cloud-sql-mysql-connect-gce, and cloud-sql-postgres-connect-gce) along with a shared cloudsqlconnect utility package to help connect Cloud SQL instances to GCE VMs. The feedback highlights a high-severity reliability risk in all three tools where a request-scoped context is used to initialize a global, shared computeService inside a sync.Once block, which could cause permanent failures if the initial request fails or times out. Additionally, the reviewer recommends refactoring several identical helper functions (such as getComputeService, extractSQLInfo, extractVMInfo, and findVM) from the individual tool packages into the shared cloudsqlconnect utility package to eliminate substantial code duplication.
…nnect Move getComputeService, extractSQLInfo, extractVMInfo, findVM, and the package-level compute-service singleton into internal/util/cloudsqlconnect/gce.go as exported GetComputeService, ExtractSQLInfo, ExtractVMInfo, FindVM. All three connect-gce tool packages (postgres, mysql, mssql) previously carried byte-identical copies (~450 lines total); each tool file drops from ~372 to ~230 lines. Also fixes a reliability bug flagged by review: the compute.NewService initializer inside sync.Once was using the request-scoped ctx from the first Invoke — if that first call cancelled or timed out, the cached error would poison every subsequent invocation. The shared GetComputeService now initializes with context.Background(); per-call cancellation still flows through Instances.Get(...).Context(ctx).Do(). Fixes gemini-code-assist review findings on googleapis#3740.
The header-check CI job on googleapis#3740 flagged all new files as having the wrong copyright year (2025 instead of 2026). This satisfies that check.
Adds a Diátaxis-compliant page for each of the three new tools under
docs/en/integrations/cloud-sql-admin/tools/ (colocated with the other
cloudsqladmin-backed tool docs like cloudsqlpgcreateinstances.md):
- cloudsqlpgconnectgce.md
- cloudsqlmysqlconnectgce.md
- cloudsqlmssqlconnectgce.md
Each page follows the CI-enforced structure: kebab-case title, no H1,
required H2 sections (About, Example) plus optional sections (Compatible
Sources with the {{< compatible-sources >}} shortcode, Requirements,
Parameters, Output Format, Reference).
|
Ready for re-review. Three follow-up commits on top of
Local
|
|
/gcbrun |
… style
Adjusts each of the three connect-gce tools to match the bigtable
reference layout Averi pointed at
(internal/tools/bigtable/bigtablecreatetable L80-L101):
- Add `var _ tools.Tool = Tool{}` compile-time interface assertion
immediately before the Tool struct, so any future change to the
tools.Tool interface is caught here instead of at a downstream call
site.
- Reorder Tool methods to GetSourceName → ValidateSource → ToConfig
and expand the one-line bodies to the standard multi-line form.
- Rename ValidateSource's parameter to `src` to match the rest of the
tree.
No behavior change; error messages retain the richer "invalid source
for %q tool: source %q is not a compatible type" wording (identifies
which tool and which configured source name).
averikitsch
left a comment
There was a problem hiding this comment.
I like the 3 tools but should we refactor to 1 tool that takes in 1 more input for the type of database?
|
/gcbrun |
@averikitsch this is an interesting idea and might be better for Agents as well since they don't have to select the tool based on engine and rather call the single tool. Let me plan the refactor - it shouldn't take much time. |
…ompute, floor-pinned deps Three additions to the shared cloudsqlconnect util that let the follow-up consolidation land cleanly and address earlier review notes. Engine auto-detect. Add ParseDatabaseTypeStrict which rejects unknown DatabaseVersion strings instead of silently falling back to PostgreSQL like ParseDatabaseType does. Consolidated tools call the strict variant right after Instances.Get so a future Cloud SQL engine surfaces a clear error rather than producing Postgres-shaped output. Token-scoped Compute Engine client. GetComputeService now takes (ctx, accessToken); a non-empty token builds a per-call client scoped to that OAuth credential so IAM decisions on the Compute API are evaluated as the caller (matching how cloudsqladmin.Source.GetService treats its accessToken). Empty token falls back to the existing shared ADC-backed singleton. Package doc updated. Floor-pinned code snippet dependencies. Every Dependencies list in codegen.go and codegen_sqlserver.go now carries a minimum-version suffix (pip >=, npm ^, Go @vx, Maven exact). GenerateCodeSnippet appends an install command note derived from Dependencies plus a one-line reminder that the pins are floors, not exact production pins. Removes AssertEngine and ToolSlug (only callers were the three per-engine connect-gce tools now being replaced by a single auto-detecting tool).
…d-sql-connect-gce
Replaces cloud-sql-{postgres,mysql,mssql}-connect-gce with a single
cloud-sql-connect-gce tool that auto-detects the engine from the
DatabaseVersion returned by the Cloud SQL Admin API. Callers no longer
have to know or pass the engine; the LLM cannot pick the wrong sibling
tool for a given instance.
The new tool lives in internal/tools/cloudsql/cloudsqlconnectgce
(alongside the other cloudsqladmin-backed tools) and:
- Runs the strict engine parse and rejects unknown DatabaseVersion
values up front.
- Uses the token-scoped GetComputeService, so both the Cloud SQL Admin
and Compute Engine calls run as the caller when useClientOAuth is
set on the source.
- Defaults database_name to the engine's conventional default
(postgres / mysql / master) after detection and always validates the
resolved value.
- Retains the same RequiredIAMRoles, RequiredAPIs, and result schema
the three prior tools returned.
Deletes internal/tools/cloudsqlpg/cloudsqlpgconnectgce,
internal/tools/cloudsqlmysql/cloudsqlmysqlconnectgce, and
internal/tools/cloudsqlmssql/cloudsqlmssqlconnectgce; updates
cmd/internal/imports.go accordingly.
Addresses googleapis#3740 review: 1-vs-3 tools thread and the auth-scoping
thread.
…gration tests
Replaces the three per-engine tool doc pages
(cloudsql{pg,mysql,mssql}connectgce.md) with a single cloudsqlconnectgce.md
matching the consolidated cloud-sql-connect-gce tool. New page documents
engine auto-detection, the caller-token identity boundary for the
Compute Engine call, and the floor-pin dependencies contract on
codeSnippet.dependencies.
Updates the three engine-scoped integration test files under tests/ to
target the new tool type. The per-engine file split remains so each
engine still gets exercised end-to-end when its dedicated env vars
(CLOUDSQL_POSTGRES_CONNECTION_NAME, CLOUDSQL_MYSQL_CONNECTION_NAME,
CLOUDSQL_MSSQL_CONNECTION_NAME) are set.
|
/gcbrun |
|
/gcbrun |
|
/gcbrun |
|
@mani-hari can you take a look at the lint issue? |
|
/gcbrun |
1 similar comment
|
/gcbrun |
|
/gcbrun |
|
/gcbrun |
…3740) ## Description Adds three tools that help an LLM connect a Cloud SQL instance to a Google Compute Engine VM, one per engine: - `cloud-sql-postgres-connect-gce` — `internal/tools/cloudsqlpg/cloudsqlpgconnectgce/` - `cloud-sql-mysql-connect-gce` — `internal/tools/cloudsqlmysql/cloudsqlmysqlconnectgce/` - `cloud-sql-mssql-connect-gce` — `internal/tools/cloudsqlmssql/cloudsqlmssqlconnectgce/` Each tool: 1. Reads the Cloud SQL instance via the `cloudsqladmin` source and the target GCE VM via the Compute Engine API (auto-discovering the zone with an `AggregatedList` filter when `vm_zone` is omitted). 2. Validates network reachability between the instance and the VM (same-VPC / private-IP / public-IP posture, SSL requirements). 3. Recommends a primary connection method (Auth Proxy, Connector, or Direct Private IP) plus ranked alternatives. 4. Returns ready-to-paste setup steps, environment/DSN/JDBC snippets, and — when `language` is set — a Python / Node.js / Java / Go code snippet using the appropriate driver or connector library. Shared logic (validation, method recommendation, setup steps, code generation) lives in `internal/util/cloudsqlconnect/` so upcoming GKE / Cloud Run / Local variants can reuse it without duplication. ### Scope evolution The original design in #2345 covered PostgreSQL only, across GCE, GKE, Cloud Run, and Local. After offline discussion, the plan evolved to slice by compute destination instead of by engine: **this PR ships the GCE destination for all three Cloud SQL engines (Postgres, MySQL, SQL Server)**. Follow-up PRs will do the same for GKE next, then Cloud Run and Local. Design approved offline by @averikitsch. ### Input validation All caller-supplied identifiers that flow into shell commands, DSN/JDBC templates, or the GCE list filter — `instance_connection_name`, `vm_name`, `vm_zone`, `database_name` — are validated against GCP naming rules via regex whitelists in `internal/util/cloudsqlconnect/inputvalidate.go` before use. ### Conventions - Follows the current `tools.ConfigBase` + `tools.BaseTool[Config]` pattern (see `internal/tools/postgres/postgressql`). - `Invoke` returns typed `util.ToolboxError` values via `NewAgentError` / `NewClientServerError` / `ProcessGcpError`. - Uses `sqladmin/v1` to match the upstream `cloudsqladmin` source. - Tools registered in `cmd/internal/imports.go`. ### Tests - Per-tool `_test.go` unit tests exercising YAML parsing via `server.UnmarshalPrimitiveConfig`. - Integration tests in `tests/cloudsql{pg,mysql,mssql}/` behind `//go:build integration`, driven end-to-end through `tests.StartCmd` and `/api/tool/.../invoke`; they self-skip when the required env vars (`CLOUDSQL_*_CONNECTION_NAME`, `CLOUDSQL_TEST_GCE_VM_NAME`, optional `_VM_ZONE`, `_DATABASE`) are unset. `go build ./...` and `go vet ./...` are clean. ## PR Checklist - [x] Make sure you reviewed [CONTRIBUTING.md](https://github.com/googleapis/mcp-toolbox/blob/main/CONTRIBUTING.md) - [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/mcp-toolbox/issues/new/choose) before writing your code! - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary) - [x] Make sure to add `!` if this involves a breaking change 🛠️ Fixes #2345 --------- Co-authored-by: Averi Kitsch <akitsch@google.com> Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com> ca58fa4
🤖 I have created a release *beep* *boop* --- ## [1.9.0](v1.8.0...v1.9.0) (2026-08-14) ### Features * **groups:** Add ttlMs and cacheScope customization to config ([#3805](#3805)) ([a5d4947](a5d4947)) * **migrate:** Convert toolset to group kind during migration ([#3704](#3704)) ([0adeaa5](0adeaa5)) * **server/mcp:** Introduce generic client extension registry ([#3723](#3723)) ([016245c](016245c)) * **skill:** Add review-prs skill for mcp-toolbox ([#3743](#3743)) ([5b7bacc](5b7bacc)) * **source/bigquery:** Add apiEndpoint field to override BigQuery API host ([#3437](#3437)) ([4da1600](4da1600)) * **source/databaseinsights:** Add databaseinsights source ([#3461](#3461)) ([3b9615d](3b9615d)) * **sources/spanner:** Rename execute_sql_dql to execute_sql_readonly ([#3776](#3776)) ([cf5a0c8](cf5a0c8)) * **tools/bigtable:** Add admin lifecycle and listing tools ([#3596](#3596)) ([801d589](801d589)) * **tools/bigtable:** Bigtable-list-schemas MCP tool ([#3683](#3683)) ([9228c61](9228c61)) * **tools/databaseinsights:** Add Advanced Query Insights tools for AlloyDB ([#3722](#3722)) ([74d18ae](74d18ae)) * **tools/looker:** Add additional tools to allow dashboards to be modified, and their layouts altered. ([#3597](#3597)) ([b2b80fb](b2b80fb)) * **tools:** Add cloud-sql-connect-gce for pg, mysql, mssql ([#3740](#3740)) ([ca58fa4](ca58fa4)) ### Bug Fixes * **auth/mcp:** Derive PRM URL from Toolbox URL ([#3765](#3765)) ([aa30842](aa30842)) * **config:** Ignore environment variables in YAML comments ([#3807](#3807)) ([79aa732](79aa732)), refs [#3793](#3793) * **mcp:** Return Tool execution error for invalid input param ([#3799](#3799)) ([8120197](8120197)) * **prebuilt/cloud-storage:** Declare tool collections as groups ([#3764](#3764)) ([7d468be](7d468be)) * **server/mcp:** Disallow client overriding URL bound parameters ([#3798](#3798)) ([f15a9c7](f15a9c7)) * **server:** Avoid a nil-flusher panic in the SSE handler ([#3520](#3520)) ([947f42f](947f42f)) * **tools/bigquery:** Keep the provider error classification in bigquery-execute-sql ([#3738](#3738)) ([42570b8](42570b8)) * **tools/looker:** Scope the filters quoting rule to values in query description ([#3788](#3788)) ([78eb0b8](78eb0b8)) * **util:** Convert exponent-form JSON numbers in ConvertNumbers ([#3730](#3730)) ([e9713ee](e9713ee)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [1.9.0](v1.8.0...v1.9.0) (2026-08-14) ### Features * **groups:** Add ttlMs and cacheScope customization to config ([#3805](#3805)) ([a5d4947](a5d4947)) * **migrate:** Convert toolset to group kind during migration ([#3704](#3704)) ([0adeaa5](0adeaa5)) * **server/mcp:** Introduce generic client extension registry ([#3723](#3723)) ([016245c](016245c)) * **skill:** Add review-prs skill for mcp-toolbox ([#3743](#3743)) ([5b7bacc](5b7bacc)) * **source/bigquery:** Add apiEndpoint field to override BigQuery API host ([#3437](#3437)) ([4da1600](4da1600)) * **source/databaseinsights:** Add databaseinsights source ([#3461](#3461)) ([3b9615d](3b9615d)) * **sources/spanner:** Rename execute_sql_dql to execute_sql_readonly ([#3776](#3776)) ([cf5a0c8](cf5a0c8)) * **tools/bigtable:** Add admin lifecycle and listing tools ([#3596](#3596)) ([801d589](801d589)) * **tools/bigtable:** Bigtable-list-schemas MCP tool ([#3683](#3683)) ([9228c61](9228c61)) * **tools/databaseinsights:** Add Advanced Query Insights tools for AlloyDB ([#3722](#3722)) ([74d18ae](74d18ae)) * **tools/looker:** Add additional tools to allow dashboards to be modified, and their layouts altered. ([#3597](#3597)) ([b2b80fb](b2b80fb)) * **tools:** Add cloud-sql-connect-gce for pg, mysql, mssql ([#3740](#3740)) ([ca58fa4](ca58fa4)) ### Bug Fixes * **auth/mcp:** Derive PRM URL from Toolbox URL ([#3765](#3765)) ([aa30842](aa30842)) * **config:** Ignore environment variables in YAML comments ([#3807](#3807)) ([79aa732](79aa732)), refs [#3793](#3793) * **mcp:** Return Tool execution error for invalid input param ([#3799](#3799)) ([8120197](8120197)) * **prebuilt/cloud-storage:** Declare tool collections as groups ([#3764](#3764)) ([7d468be](7d468be)) * **server/mcp:** Disallow client overriding URL bound parameters ([#3798](#3798)) ([f15a9c7](f15a9c7)) * **server:** Avoid a nil-flusher panic in the SSE handler ([#3520](#3520)) ([947f42f](947f42f)) * **tools/bigquery:** Keep the provider error classification in bigquery-execute-sql ([#3738](#3738)) ([42570b8](42570b8)) * **tools/looker:** Scope the filters quoting rule to values in query description ([#3788](#3788)) ([78eb0b8](78eb0b8)) * **util:** Convert exponent-form JSON numbers in ConvertNumbers ([#3730](#3730)) ([e9713ee](e9713ee)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com> 5de8f13
🤖 I have created a release *beep* *boop* --- ## [1.9.0](googleapis/mcp-toolbox@v1.8.0...v1.9.0) (2026-08-14) ### Features * **groups:** Add ttlMs and cacheScope customization to config ([googleapis#3805](googleapis#3805)) ([a5d4947](googleapis@a5d4947)) * **migrate:** Convert toolset to group kind during migration ([googleapis#3704](googleapis#3704)) ([0adeaa5](googleapis@0adeaa5)) * **server/mcp:** Introduce generic client extension registry ([googleapis#3723](googleapis#3723)) ([016245c](googleapis@016245c)) * **skill:** Add review-prs skill for mcp-toolbox ([googleapis#3743](googleapis#3743)) ([5b7bacc](googleapis@5b7bacc)) * **source/bigquery:** Add apiEndpoint field to override BigQuery API host ([googleapis#3437](googleapis#3437)) ([4da1600](googleapis@4da1600)) * **source/databaseinsights:** Add databaseinsights source ([googleapis#3461](googleapis#3461)) ([3b9615d](googleapis@3b9615d)) * **sources/spanner:** Rename execute_sql_dql to execute_sql_readonly ([googleapis#3776](googleapis#3776)) ([cf5a0c8](googleapis@cf5a0c8)) * **tools/bigtable:** Add admin lifecycle and listing tools ([googleapis#3596](googleapis#3596)) ([801d589](googleapis@801d589)) * **tools/bigtable:** Bigtable-list-schemas MCP tool ([googleapis#3683](googleapis#3683)) ([9228c61](googleapis@9228c61)) * **tools/databaseinsights:** Add Advanced Query Insights tools for AlloyDB ([googleapis#3722](googleapis#3722)) ([74d18ae](googleapis@74d18ae)) * **tools/looker:** Add additional tools to allow dashboards to be modified, and their layouts altered. ([googleapis#3597](googleapis#3597)) ([b2b80fb](googleapis@b2b80fb)) * **tools:** Add cloud-sql-connect-gce for pg, mysql, mssql ([googleapis#3740](googleapis#3740)) ([ca58fa4](googleapis@ca58fa4)) ### Bug Fixes * **auth/mcp:** Derive PRM URL from Toolbox URL ([googleapis#3765](googleapis#3765)) ([aa30842](googleapis@aa30842)) * **config:** Ignore environment variables in YAML comments ([googleapis#3807](googleapis#3807)) ([79aa732](googleapis@79aa732)), refs [googleapis#3793](googleapis#3793) * **mcp:** Return Tool execution error for invalid input param ([googleapis#3799](googleapis#3799)) ([8120197](googleapis@8120197)) * **prebuilt/cloud-storage:** Declare tool collections as groups ([googleapis#3764](googleapis#3764)) ([7d468be](googleapis@7d468be)) * **server/mcp:** Disallow client overriding URL bound parameters ([googleapis#3798](googleapis#3798)) ([f15a9c7](googleapis@f15a9c7)) * **server:** Avoid a nil-flusher panic in the SSE handler ([googleapis#3520](googleapis#3520)) ([947f42f](googleapis@947f42f)) * **tools/bigquery:** Keep the provider error classification in bigquery-execute-sql ([googleapis#3738](googleapis#3738)) ([42570b8](googleapis@42570b8)) * **tools/looker:** Scope the filters quoting rule to values in query description ([googleapis#3788](googleapis#3788)) ([78eb0b8](googleapis@78eb0b8)) * **util:** Convert exponent-form JSON numbers in ConvertNumbers ([googleapis#3730](googleapis#3730)) ([e9713ee](googleapis@e9713ee)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com> 5de8f13
🤖 I have created a release *beep* *boop* --- ## [1.9.0](googleapis/mcp-toolbox@v1.8.0...v1.9.0) (2026-08-14) ### Features * **groups:** Add ttlMs and cacheScope customization to config ([googleapis#3805](googleapis#3805)) ([a5d4947](googleapis@a5d4947)) * **migrate:** Convert toolset to group kind during migration ([googleapis#3704](googleapis#3704)) ([0adeaa5](googleapis@0adeaa5)) * **server/mcp:** Introduce generic client extension registry ([googleapis#3723](googleapis#3723)) ([016245c](googleapis@016245c)) * **skill:** Add review-prs skill for mcp-toolbox ([googleapis#3743](googleapis#3743)) ([5b7bacc](googleapis@5b7bacc)) * **source/bigquery:** Add apiEndpoint field to override BigQuery API host ([googleapis#3437](googleapis#3437)) ([4da1600](googleapis@4da1600)) * **source/databaseinsights:** Add databaseinsights source ([googleapis#3461](googleapis#3461)) ([3b9615d](googleapis@3b9615d)) * **sources/spanner:** Rename execute_sql_dql to execute_sql_readonly ([googleapis#3776](googleapis#3776)) ([cf5a0c8](googleapis@cf5a0c8)) * **tools/bigtable:** Add admin lifecycle and listing tools ([googleapis#3596](googleapis#3596)) ([801d589](googleapis@801d589)) * **tools/bigtable:** Bigtable-list-schemas MCP tool ([googleapis#3683](googleapis#3683)) ([9228c61](googleapis@9228c61)) * **tools/databaseinsights:** Add Advanced Query Insights tools for AlloyDB ([googleapis#3722](googleapis#3722)) ([74d18ae](googleapis@74d18ae)) * **tools/looker:** Add additional tools to allow dashboards to be modified, and their layouts altered. ([googleapis#3597](googleapis#3597)) ([b2b80fb](googleapis@b2b80fb)) * **tools:** Add cloud-sql-connect-gce for pg, mysql, mssql ([googleapis#3740](googleapis#3740)) ([ca58fa4](googleapis@ca58fa4)) ### Bug Fixes * **auth/mcp:** Derive PRM URL from Toolbox URL ([googleapis#3765](googleapis#3765)) ([aa30842](googleapis@aa30842)) * **config:** Ignore environment variables in YAML comments ([googleapis#3807](googleapis#3807)) ([79aa732](googleapis@79aa732)), refs [googleapis#3793](googleapis#3793) * **mcp:** Return Tool execution error for invalid input param ([googleapis#3799](googleapis#3799)) ([8120197](googleapis@8120197)) * **prebuilt/cloud-storage:** Declare tool collections as groups ([googleapis#3764](googleapis#3764)) ([7d468be](googleapis@7d468be)) * **server/mcp:** Disallow client overriding URL bound parameters ([googleapis#3798](googleapis#3798)) ([f15a9c7](googleapis@f15a9c7)) * **server:** Avoid a nil-flusher panic in the SSE handler ([googleapis#3520](googleapis#3520)) ([947f42f](googleapis@947f42f)) * **tools/bigquery:** Keep the provider error classification in bigquery-execute-sql ([googleapis#3738](googleapis#3738)) ([42570b8](googleapis@42570b8)) * **tools/looker:** Scope the filters quoting rule to values in query description ([googleapis#3788](googleapis#3788)) ([78eb0b8](googleapis@78eb0b8)) * **util:** Convert exponent-form JSON numbers in ConvertNumbers ([googleapis#3730](googleapis#3730)) ([e9713ee](googleapis@e9713ee)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com> 5de8f13
🤖 I have created a release *beep* *boop* --- ## [1.9.0](googleapis/mcp-toolbox@v1.8.0...v1.9.0) (2026-08-14) ### Features * **groups:** Add ttlMs and cacheScope customization to config ([googleapis#3805](googleapis#3805)) ([a5d4947](googleapis@a5d4947)) * **migrate:** Convert toolset to group kind during migration ([googleapis#3704](googleapis#3704)) ([0adeaa5](googleapis@0adeaa5)) * **server/mcp:** Introduce generic client extension registry ([googleapis#3723](googleapis#3723)) ([016245c](googleapis@016245c)) * **skill:** Add review-prs skill for mcp-toolbox ([googleapis#3743](googleapis#3743)) ([5b7bacc](googleapis@5b7bacc)) * **source/bigquery:** Add apiEndpoint field to override BigQuery API host ([googleapis#3437](googleapis#3437)) ([4da1600](googleapis@4da1600)) * **source/databaseinsights:** Add databaseinsights source ([googleapis#3461](googleapis#3461)) ([3b9615d](googleapis@3b9615d)) * **sources/spanner:** Rename execute_sql_dql to execute_sql_readonly ([googleapis#3776](googleapis#3776)) ([cf5a0c8](googleapis@cf5a0c8)) * **tools/bigtable:** Add admin lifecycle and listing tools ([googleapis#3596](googleapis#3596)) ([801d589](googleapis@801d589)) * **tools/bigtable:** Bigtable-list-schemas MCP tool ([googleapis#3683](googleapis#3683)) ([9228c61](googleapis@9228c61)) * **tools/databaseinsights:** Add Advanced Query Insights tools for AlloyDB ([googleapis#3722](googleapis#3722)) ([74d18ae](googleapis@74d18ae)) * **tools/looker:** Add additional tools to allow dashboards to be modified, and their layouts altered. ([googleapis#3597](googleapis#3597)) ([b2b80fb](googleapis@b2b80fb)) * **tools:** Add cloud-sql-connect-gce for pg, mysql, mssql ([googleapis#3740](googleapis#3740)) ([ca58fa4](googleapis@ca58fa4)) ### Bug Fixes * **auth/mcp:** Derive PRM URL from Toolbox URL ([googleapis#3765](googleapis#3765)) ([aa30842](googleapis@aa30842)) * **config:** Ignore environment variables in YAML comments ([googleapis#3807](googleapis#3807)) ([79aa732](googleapis@79aa732)), refs [googleapis#3793](googleapis#3793) * **mcp:** Return Tool execution error for invalid input param ([googleapis#3799](googleapis#3799)) ([8120197](googleapis@8120197)) * **prebuilt/cloud-storage:** Declare tool collections as groups ([googleapis#3764](googleapis#3764)) ([7d468be](googleapis@7d468be)) * **server/mcp:** Disallow client overriding URL bound parameters ([googleapis#3798](googleapis#3798)) ([f15a9c7](googleapis@f15a9c7)) * **server:** Avoid a nil-flusher panic in the SSE handler ([googleapis#3520](googleapis#3520)) ([947f42f](googleapis@947f42f)) * **tools/bigquery:** Keep the provider error classification in bigquery-execute-sql ([googleapis#3738](googleapis#3738)) ([42570b8](googleapis@42570b8)) * **tools/looker:** Scope the filters quoting rule to values in query description ([googleapis#3788](googleapis#3788)) ([78eb0b8](googleapis@78eb0b8)) * **util:** Convert exponent-form JSON numbers in ConvertNumbers ([googleapis#3730](googleapis#3730)) ([e9713ee](googleapis@e9713ee)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com> 5de8f13
Description
Adds three tools that help an LLM connect a Cloud SQL instance to a
Google Compute Engine VM, one per engine:
cloud-sql-postgres-connect-gce—internal/tools/cloudsqlpg/cloudsqlpgconnectgce/cloud-sql-mysql-connect-gce—internal/tools/cloudsqlmysql/cloudsqlmysqlconnectgce/cloud-sql-mssql-connect-gce—internal/tools/cloudsqlmssql/cloudsqlmssqlconnectgce/Each tool:
cloudsqladminsource and thetarget GCE VM via the Compute Engine API (auto-discovering the zone
with an
AggregatedListfilter whenvm_zoneis omitted).(same-VPC / private-IP / public-IP posture, SSL requirements).
Direct Private IP) plus ranked alternatives.
and — when
languageis set — a Python / Node.js / Java / Go codesnippet using the appropriate driver or connector library.
Shared logic (validation, method recommendation, setup steps, code
generation) lives in
internal/util/cloudsqlconnect/so upcomingGKE / Cloud Run / Local variants can reuse it without duplication.
Scope evolution
The original design in #2345 covered PostgreSQL only, across GCE, GKE,
Cloud Run, and Local. After offline discussion, the plan evolved to
slice by compute destination instead of by engine: this PR ships the
GCE destination for all three Cloud SQL engines (Postgres, MySQL, SQL
Server). Follow-up PRs will do the same for GKE next, then Cloud Run
and Local. Design approved offline by @averikitsch.
Input validation
All caller-supplied identifiers that flow into shell commands, DSN/JDBC
templates, or the GCE list filter —
instance_connection_name,vm_name,vm_zone,database_name— are validated against GCPnaming rules via regex whitelists in
internal/util/cloudsqlconnect/inputvalidate.gobefore use.Conventions
tools.ConfigBase+tools.BaseTool[Config]pattern (see
internal/tools/postgres/postgressql).Invokereturns typedutil.ToolboxErrorvalues viaNewAgentError/
NewClientServerError/ProcessGcpError.sqladmin/v1to match the upstreamcloudsqladminsource.cmd/internal/imports.go.Tests
_test.gounit tests exercising YAML parsing viaserver.UnmarshalPrimitiveConfig.tests/cloudsql{pg,mysql,mssql}/behind//go:build integration, driven end-to-end throughtests.StartCmdand
/api/tool/.../invoke; they self-skip when the required envvars (
CLOUDSQL_*_CONNECTION_NAME,CLOUDSQL_TEST_GCE_VM_NAME,optional
_VM_ZONE,_DATABASE) are unset.go build ./...andgo vet ./...are clean.PR Checklist
!if this involves a breaking change🛠️ Fixes #2345