This page shows you how to connect your Cloud SQL instance to various AI developer assistance tools, including the following:
For an integrated experience, we recommend using the dedicated Gemini CLI extension for Cloud SQL for MySQL.
As Google Cloud's next-generation command-line interface, Gemini CLI bundles the underlying skills directly into the extension, which simplifies setup and configuration. You can configure Gemini Code Assist to use the Gemini CLI, offering similar setup benefits in your IDE.
For other developer tools that support the Model Context Protocol (MCP), you can connect by manually configuring the MCP Toolbox for Databases (Toolbox). Toolbox is an open-source MCP server that connects AI agents to your data by managing tasks such as authentication and connection pooling. This lets you interact with your data using natural language directly from your IDE. For these tools, this method provides core database interaction capabilities.
For more information, see Prebuilt tools and MCP Toolbox for Databases on GitHub.
Gemini CLI is an open-source AI agent designed to assist with development workflows by assisting with coding, debugging, data exploration, and content creation. It provides an agentic interface for interacting with database and analytics services and popular open-source databases.
Gemini CLI is highly extensible, allowing for the addition of new tools and capabilities through extensions. You can load the extensions from a GitHub URL, a local directory, or a configurable registry. They provide new tools, slash commands, skills, and prompts to assist with your workflow.
The Cloud SQL Gemini CLI extension is based on MCP Toolbox for Databases.
The integration with Gemini CLI is through a dedicated extension that offers additional capabilities compared to the standard Toolbox connection. The extension offers a streamlined installation process and a set of skills based on MCP Tools.
For more information, see GitHub documentation for the Gemini CLI extension for Cloud SQL for MySQL.cloud-sql-mysql extension includes skills for querying the database and monitoring database health.
For all available skills, see the Cloud SQL skills on GitHub
The cloud-sql-mysql-observability extension provides a unified
interface for managing and monitoring database performance and health directly
from the Gemini CLI.
| Category | Tools |
|---|---|
| Observability |
|
For a list of those operations, see MCP Toolbox for Databases and Gemini CLI extension for MySQL.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Make sure that billing is enabled for your Google Cloud project.
By default, Cloud SQL assigns a public IP address to a new instance. Depending on your use case, make sure either a Public IP or Private IP is set up for your Cloud SQL instances. Toolbox connects securely using the Cloud SQL Language Connectors.
Grant the necessary Identity and Access Management (IAM) roles to the user that will be running the MCP server. The tools available depends on the roles granted:
| Task | Role name | Required IAM role |
|---|---|---|
Provides read-only access to resources, including the following operations:
|
Cloud SQL Viewer | roles/cloudsql.viewer |
| Provides read-only access to monitoring data such as time series metrics. | Cloud Monitoring Viewer | roles/monitoring.viewer |
Provides permissions to manage existing resources, including the following:
|
Cloud SQL Editor | roles/cloudsql.editor |
Provides full control over all resources, including the following:
|
Cloud SQL Admin | roles/cloudsql.admin |
Configure Application Default Credentials (ADC) for your environment.
Create or reuse a database user, and have the username and password ready.
You can connect Cloud SQL for MySQL to Antigravity in the following ways:
The most recommended method to connect to Cloud SQL for MySQL in Antigravity is to use the built-in MCP Store.
After you install Cloud SQL for MySQL in the MCP Store, resources and tools from the server are automatically available to the editor.
To connect to a custom MCP server, follow these steps:
mcp_config.json file.
{
"mcpServers": {
"cloud-sql-mysql": {
"command": "npx",
"args": ["-y","@toolbox-sdk/server","--prebuilt","cloud-sql-mysql","--stdio"],
"env": {
"CLOUD_SQL_MYSQL_PROJECT": "PROJECT_ID",
"CLOUD_SQL_MYSQL_REGION": "REGION",
"CLOUD_SQL_MYSQL_INSTANCE": "INSTANCE_ID",
"CLOUD_SQL_MYSQL_DATABASE": "DATABASE_NAME",
"CLOUD_SQL_MYSQL_USER": "USER_ID",
"CLOUD_SQL_MYSQL_PASSWORD": "PASSWORD"
}
}
}
}
Once you configure the custom MCP server, the resources and tools from the Cloud SQL for MySQL server are available to the editor.
<div>
<devsite-selector>
<section>
<h3 id="linux-amd64">linux/amd64</h3>
<pre class="devsite-click-to-copy">curl -O https://storage.googleapis.com/genai-toolbox/v0.7.0/linux/amd64/toolbox</pre>
</section>
<section>
<h3 id="darwin-arm64">darwin/arm64</h3>
<pre class="devsite-click-to-copy">curl -O https://storage.googleapis.com/genai-toolbox/v0.7.0/darwin/arm64/toolbox</pre>
</section>
<section>
<h3 id="darwin-amd64">darwin/amd64</h3>
<pre class="devsite-click-to-copy">curl -O https://storage.googleapis.com/genai-toolbox/v0.7.0/darwin/amd64/toolbox</pre>
</section>
<section>
<h3 id="windows-amd64">windows/amd64</h3>
<pre class="devsite-click-to-copy">curl -O https://storage.googleapis.com/genai-toolbox/v0.7.0/windows/amd64/toolbox</pre>
</section>
</devsite-selector>
</div>
```bash
chmod +x toolbox
```
```bash
./toolbox --version
```
This section describes how to configure various developer tools to connect to your Cloud SQL instance using Toolbox. Toolbox acts as an open-source Model Context Protocol (MCP) server that sits between your IDE and your database, providing a secure and efficient control plane for your AI tools. Select the tab for your specific tool to see the configuration instructions.
gemini extensions install https://github.com/gemini-cli-extensions/cloud-sql-mysql
export CLOUD_SQL_MYSQL_PROJECT="PROJECT_NAME"
export CLOUD_SQL_MYSQL_REGION="REGION"
export CLOUD_SQL_MYSQL_INSTANCE="INSTANCE_NAME"
export CLOUD_SQL_MYSQL_DATABASE="DATABASE_NAME"
export CLOUD_SQL_MYSQL_USER="DATABASE_USER_NAME"
export CLOUD_SQL_MYSQL_PASSWORD="PASSWORD"
export CLOUD_SQL_MYSQL_IP_TYPE="IP_TYPE"
gemini
The CLI automatically loads the Gemini CLI extension for Cloud SQL and its tools, which you can use to interact with your database.
In the Gemini CLI, use the /extensions
command to verify the extension is installed and /mcp list
command to see the tools.
gemini extensions install https://github.com/gemini-cli-extensions/mysql
export MYSQL_HOST="HOST"
export MYSQL_PORT="PORT"
export MYSQL_DATABASE="DATABASE"
export MYSQL_USER="USER"
export MYSQL_PASSWORD="PASSWORD"
export MYSQL_QUERY_PARAMETERS="QUERY_PARAMETERS"
db connection string.
gemini
The CLI automatically loads the Gemini CLI extension for MySQL and its tools, which you can use to interact with your database.
.gemini. Within it, create a settings.json file.
{
"mcpServers": {
"cloud-sql-mysql": {
"command": "./PATH/TO/toolbox",
"args": ["--prebuilt","cloud-sql-mysql","--stdio"],
"env": {
"CLOUD_SQL_MYSQL_PROJECT": "PROJECT_ID",
"CLOUD_SQL_MYSQL_REGION": "REGION",
"CLOUD_SQL_MYSQL_INSTANCE":"INSTANCE_ID",
"CLOUD_SQL_MYSQL_DATABASE": "DATABASE_NAME",
"CLOUD_SQL_MYSQL_USER": "USER_ID",
"CLOUD_SQL_MYSQL_PASSWORD": "PASSWORD"
}
}
}
}
export CLOUD_SQL_MYSQL_PROJECT="PROJECT_NAME"
export CLOUD_SQL_MYSQL_REGION="REGION"
export CLOUD_SQL_MYSQL_INSTANCE="INSTANCE_NAME"
export CLOUD_SQL_MYSQL_DATABASE="DATABASE_NAME"
export CLOUD_SQL_MYSQL_USER="DATABASE_USER_NAME"
export CLOUD_SQL_MYSQL_PASSWORD="PASSWORD"
export CLOUD_SQL_MYSQL_IP_TYPE="IP_TYPE"
claude
/plugin marketplace add https://github.com/gemini-cli-extensions/cloud-sql-mysql.git#VERSION
/plugin install cloud-sql-mysql@cloud-sql-mysql-marketplace
{
"mcpServers": {
"cloud-sql-mysql": {
"command": "./PATH/TO/toolbox",
"args": ["--prebuilt","cloud-sql-mysql","--stdio"],
"env": {
"CLOUD_SQL_MYSQL_PROJECT": "PROJECT_ID",
"CLOUD_SQL_MYSQL_REGION": "REGION",
"CLOUD_SQL_MYSQL_INSTANCE":"INSTANCE_ID",
"CLOUD_SQL_MYSQL_DATABASE": "DATABASE_NAME",
"CLOUD_SQL_MYSQL_USER": "USER_ID",
"CLOUD_SQL_MYSQL_PASSWORD": "PASSWORD"
}
}
}
}
git clone --branch VERSION git@github.com:gemini-cli-extensions/cloud-sql-mysql.git
mkdir -p ~/.codex/plugins cp -R /absolute/path/to/cloud-sql-mysql ~/.codex/plugins/cloud-sql-mysql
export CLOUD_SQL_MYSQL_PROJECT="PROJECT_NAME"
export CLOUD_SQL_MYSQL_REGION="REGION"
export CLOUD_SQL_MYSQL_INSTANCE="INSTANCE_NAME"
export CLOUD_SQL_MYSQL_DATABASE="DATABASE_NAME"
export CLOUD_SQL_MYSQL_USER="DATABASE_USER_NAME"
export CLOUD_SQL_MYSQL_PASSWORD="PASSWORD"
export CLOUD_SQL_MYSQL_IP_TYPE="IP_TYPE"
{
"name": "my-data-cloud-google-marketplace",
"interface": {
"displayName": "Google Data Cloud Skills"
},
"plugins": [
{
"name": "cloud-sql-mysql",
"source": {
"source": "local",
"path": "./plugins/cloud-sql-mysql"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"category": "Database"
}
]
}
codex plugin list or use the plugins interactive menu to verify your installed plugins.
{
"mcpServers": {
"cloud-sql-mysql": {
"command": "./PATH/TO/toolbox",
"args": ["--prebuilt","cloud-sql-mysql","--stdio"],
"env": {
"CLOUD_SQL_MYSQL_PROJECT": "PROJECT_ID",
"CLOUD_SQL_MYSQL_REGION": "REGION",
"CLOUD_SQL_MYSQL_INSTANCE":"INSTANCE_ID",
"CLOUD_SQL_MYSQL_DATABASE": "DATABASE_NAME",
"CLOUD_SQL_MYSQL_USER": "USER_ID",
"CLOUD_SQL_MYSQL_PASSWORD": "PASSWORD"
}
}
}
}
.cursor directory in your project root if it does not exist..cursor/mcp.json file if it does not exist and open it.
{
"mcpServers": {
"cloud-sql-mysql": {
"command": "./PATH/TO/toolbox",
"args": ["--prebuilt","cloud-sql-mysql","--stdio"],
"env": {
"CLOUD_SQL_MYSQL_PROJECT": "PROJECT_ID",
"CLOUD_SQL_MYSQL_REGION": "REGION",
"CLOUD_SQL_MYSQL_INSTANCE":"INSTANCE_ID",
"CLOUD_SQL_MYSQL_DATABASE": "DATABASE_NAME",
"CLOUD_SQL_MYSQL_USER": "USER_ID",
"CLOUD_SQL_MYSQL_PASSWORD": "PASSWORD"
}
}
}
}
.vscode directory in your project root if it does not exist..vscode/mcp.json file if it does not exist, and open it.
{
"servers": {
"cloud-sql-mysql": {
"command": "./PATH/TO/toolbox",
"args": ["--prebuilt","cloud-sql-mysql","--stdio"],
"env": {
"CLOUD_SQL_MYSQL_PROJECT": "PROJECT_ID",
"CLOUD_SQL_MYSQL_REGION": "REGION",
"CLOUD_SQL_MYSQL_INSTANCE":"INSTANCE_ID",
"CLOUD_SQL_MYSQL_DATABASE": "DATABASE_NAME",
"CLOUD_SQL_MYSQL_USER": "USER_ID",
"CLOUD_SQL_MYSQL_PASSWORD": "PASSWORD"
}
}
}
}
{
"mcpServers": {
"cloud-sql-mysql": {
"command": "./PATH/TO/toolbox",
"args": ["--prebuilt","cloud-sql-mysql","--stdio"],
"env": {
"CLOUD_SQL_MYSQL_PROJECT": "PROJECT_ID",
"CLOUD_SQL_MYSQL_REGION": "REGION",
"CLOUD_SQL_MYSQL_INSTANCE":"INSTANCE_ID",
"CLOUD_SQL_MYSQL_DATABASE": "DATABASE_NAME",
"CLOUD_SQL_MYSQL_USER": "USER_ID",
"CLOUD_SQL_MYSQL_PASSWORD": "PASSWORD"
}
}
}
}
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-06-10 UTC.