This page shows you how to connect your Cloud SQL instance to various AI
developer assistance tools, including the following:

- [Gemini CLI extension for Cloud SQL for PostgreSQL](https://docs.cloud.google.com/sql/docs/postgres/pre-built-tools-with-mcp-toolbox.md.txt#mcp-configure-your-mcp-client-geminicli)
- [Gemini CLI extension for PostgreSQL](https://docs.cloud.google.com/sql/docs/postgres/pre-built-tools-with-mcp-toolbox.md.txt#mcp-configure-your-mcp-client-geminicli-postgresql)

<!-- -->

- [Gemini Code Assist](https://docs.cloud.google.com/sql/docs/postgres/pre-built-tools-with-mcp-toolbox.md.txt#mcp-configure-your-mcp-client-gemini-code-assist)
- [Claude code](https://docs.cloud.google.com/sql/docs/postgres/pre-built-tools-with-mcp-toolbox.md.txt#mcp-configure-your-mcp-client-claude-code)
- [Claude desktop](https://docs.cloud.google.com/sql/docs/postgres/pre-built-tools-with-mcp-toolbox.md.txt#mcp-configure-your-mcp-client-claude-desktop)
- [Codex](https://docs.cloud.google.com/sql/docs/postgres/pre-built-tools-with-mcp-toolbox.md.txt#mcp-configure-your-mcp-client-codex)
- [Cline](https://docs.cloud.google.com/sql/docs/postgres/pre-built-tools-with-mcp-toolbox.md.txt#mcp-configure-your-mcp-client-cline) (VS Code extension)
- [Cursor](https://docs.cloud.google.com/sql/docs/postgres/pre-built-tools-with-mcp-toolbox.md.txt#mcp-configure-your-mcp-client-cursor)
- [Visual Studio Code](https://docs.cloud.google.com/sql/docs/postgres/pre-built-tools-with-mcp-toolbox.md.txt#mcp-configure-your-mcp-client-vscode) (Copilot)
- [Windsurf](https://docs.cloud.google.com/sql/docs/postgres/pre-built-tools-with-mcp-toolbox.md.txt#mcp-configure-your-mcp-client-windsurf) (Codeium)
- [Antigravity](https://docs.cloud.google.com/sql/docs/postgres/pre-built-tools-with-mcp-toolbox.md.txt#connect-antigravity)

For an integrated experience, we recommend using the dedicated
[Gemini CLI extension for Cloud SQL for PostgreSQL](https://docs.cloud.google.com/sql/docs/postgres/pre-built-tools-with-mcp-toolbox.md.txt#use-gemini-cli-extensions-in-cloud-sql).

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)](https://modelcontextprotocol.io/introduction),
you can connect by manually configuring the [MCP Toolbox for Databases (Toolbox)](https://github.com/googleapis/mcp-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](https://mcp-toolbox.dev/documentation/configuration/prebuilt-configs/)
and [MCP Toolbox for Databases on GitHub](https://github.com/googleapis/mcp-toolbox/pull/1495/files).

## About Gemini CLI and extensions

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.

## How extensions work

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.

## Use the Gemini CLI extensions in Cloud SQL for PostgreSQL

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 PostgreSQL](https://github.com/gemini-cli-extensions/cloud-sql-postgresql).

<br />

### Gemini CLI extension for Cloud SQL for PostgreSQL databases

The `cloud-sql-postgresql` extension includes skills for querying the database, managing Cloud SQL resources, and monitoring database health.

<br />

For all available skills, see the [Cloud SQL skills on GitHub](https://github.com/gemini-cli-extensions/cloud-sql-postgresql/tree/main/skills)

The `cloud-sql-postgresql-observability` extension provides a unified
interface for managing and monitoring database performance and health directly
from the Gemini CLI.

| Category | Tools |
|---|---|
| Observability | - `get_system_metrics`: Retrieves system metrics for a Cloud SQL instance. - `get_query_metrics`: Retrieves query-related metrics for a Cloud SQL instance. |

### Gemini CLI extension for PostgreSQL databases

For a list of those operations, see [MCP Toolbox for Databases](https://mcp-toolbox.dev/integrations/postgres/prebuilt-configs/)
and [Gemini CLI extension for PostgreSQL](https://github.com/gemini-cli-extensions/postgres).

## Before you begin

- In the Google Cloud console, on the [project selector page](https://console.cloud.google.com/projectselector2/home/dashboard),
  select or create a Google Cloud project.

- [Make sure that billing is enabled for your Google Cloud project](https://docs.cloud.google.com/billing/docs/how-to/verify-billing-enabled.md.txt#confirm_billing_is_enabled_on_a_project).

- [Enable the Cloud SQL Admin API in the Google Cloud project](https://console.cloud.google.com/apis/enableflow?apiid=sqladmin&redirect=%7Bconsole_url%7D).

- By default, Cloud SQL assigns a public IP address to a new instance. Depending
  on your use case, make sure either a [Public IP](https://docs.cloud.google.com/sql/docs/postgres/configure-ip.md.txt)
  or [Private IP](https://docs.cloud.google.com/sql/docs/postgres/configure-private-ip) is set up for your
  Cloud SQL instances. Toolbox connects securely using the [Cloud SQL Language Connectors](https://docs.cloud.google.com/sql/docs/postgres/language-connectors.md.txt).

- Grant the necessary [Identity and Access Management (IAM)](https://docs.cloud.google.com/sql/docs/postgres/roles-and-permissions.md.txt)
  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: - `get_instance` - `list_instances` - `list_databases` - `wait_for_operation` | 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: - All `viewer` tools - `create_database` | Cloud SQL Editor | `roles/cloudsql.editor` |
  | Provides full control over all resources, including the following: - All `viewer` and `editor` tools - `create_instance` - `create_user` | Cloud SQL Admin | `roles/cloudsql.admin` |

- Configure [Application Default Credentials (ADC)](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt)
  for your environment.

- Create or reuse [a database user](https://docs.cloud.google.com/sql/docs/postgres/create-manage-users.md.txt),
  and have the username and password ready.

## Connect with Data Agent Kit

The Google Cloud Data Agent Kit extension lets you connect to and query
Cloud SQL from Visual Studio Code or any IDE based on VS Code. It lets
you connect to MCP servers, query data, and run data engineering workloads from
your IDE. Data Agent Kit also provides
CLI plugins.

For more information, see [Data Agent Kit overview](https://docs.cloud.google.com/data-agent-kit/overview.md.txt).

## Connect with Antigravity

You can connect Cloud SQL for PostgreSQL to Antigravity in the following ways:

- Use the MCP Store
- Use a custom configuration

> [!NOTE]
> **Note:** You don't need to download the MCP Toolbox binary to use these methods.

### MCP Store

The most recommended method to connect to Cloud SQL for PostgreSQL in Antigravity is to use the built-in MCP Store.

1. Open [Antigravity](https://antigravity.google/docs/mcp) and open the editor's **agent panel**.
2. Click the **"..."** icon at the top of the panel and select **MCP Servers**.
3. Locate **Cloud SQL for PostgreSQL** in the list of available servers and click **Install**.
4. Follow the on-screen prompts to securely link your accounts where applicable.

After you install Cloud SQL for PostgreSQL in the MCP Store, resources and tools from the server are automatically available to the editor.

### Custom configuration

To connect to a custom MCP server, follow these steps:

1. Open [Antigravity](https://antigravity.google/docs/mcp) and open the editor's **agent panel**.
2. Click the **"..."** icon at the top of the panel and select **MCP Servers**.
3. Click **Manage MCP Servers \> View raw config** to open the `mcp_config.json` file.
4. Add the following configuration, replace the environment variables with your values, and save.

```
{
  "mcpServers": {
    "cloud-sql-postgres": {
      "command": "npx",
      "args": ["-y","@toolbox-sdk/server","--prebuilt","cloud-sql-postgres","--stdio"],
      "env": {
          "CLOUD_SQL_POSTGRES_PROJECT": "PROJECT_ID",
          "CLOUD_SQL_POSTGRES_REGION": "REGION",
          "CLOUD_SQL_POSTGRES_INSTANCE": "INSTANCE_ID",
          "CLOUD_SQL_POSTGRES_DATABASE": "DATABASE_NAME",
          "CLOUD_SQL_POSTGRES_USER": "USER_ID",
          "CLOUD_SQL_POSTGRES_PASSWORD": "PASSWORD"
      }
    }
  }
}
```

Once you configure the custom MCP server, the resources and tools from the Cloud SQL for PostgreSQL server are available to the editor.

## Install the MCP Toolbox

> [!NOTE]
> **Note:** This step isn't required for Gemini CLI extensions.

1. Download the binary that corresponds to your operating system and CPU architecture.

   ### linux/amd64

   ```
   curl -O https://storage.googleapis.com/genai-toolbox/v0.7.0/linux/amd64/toolbox
   ```

   ### darwin/arm64

   ```
   curl -O https://storage.googleapis.com/genai-toolbox/v0.7.0/darwin/arm64/toolbox
   ```

   ### darwin/amd64

   ```
   curl -O https://storage.googleapis.com/genai-toolbox/v0.7.0/darwin/amd64/toolbox
   ```

   ### windows/amd64

   ```
   curl -O https://storage.googleapis.com/genai-toolbox/v0.7.0/windows/amd64/toolbox
   ```
2. Make the binary executable:

   ```sh
   chmod +x toolbox
   ```
3. Verify the installation using the following command:

   ```sh
   ./toolbox --version
   ```

## Configure the MCP Client

This section describes how to configure various developer tools to connect to
your Cloud SQL instance using [Toolbox](https://github.com/googleapis/mcp-toolbox).
Toolbox acts as an open-source [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction)
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 CLI for Cloud SQL for PostgreSQL

<br />

<br />

1. Install the [Gemini CLI](https://github.com/google-gemini/gemini-cli?tab=readme-ov-file#quickstart).
2. Install the Cloud SQL for PostgreSQL extension for Gemini CLI from the GitHub repository using the following command:

   ```sh
   gemini extensions install https://github.com/gemini-cli-extensions/cloud-sql-postgresql
   ```
   While installing the extension, replace the following:
   - <var translate="no">PROJECT_NAME</var>: The Google Cloud project ID.
   - <var translate="no">REGION</var>: The region of your Cloud SQL instance.
   - <var translate="no">INSTANCE_NAME</var>: The ID of your Cloud SQL instance.
   - <var translate="no">DATABASE_NAME</var>: The name of the database to connect to.
   - <var translate="no">DATABASE_USER_NAME</var>: Optional: The database username. Defaults to IAM authentication if unspecified.
   - <var translate="no">PASSWORD</var>: Optional: The password for the database user. Defaults to IAM authentication if unspecified.
   - <var translate="no">IP_TYPE</var>: Optional: The IP type, such as "Public" (default) or "Private".
3. Start the Gemini CLI in interactive mode:

   ```sh
   gemini
   ```

   The CLI automatically loads the Gemini CLI extension for Cloud SQL
   and its skills, which you can use to interact with your database.

   In the Gemini CLI, use the [`/extensions`](https://github.com/google-gemini/gemini-cli/blob/bbcc90613390e4d3d3aed911fbc1535af80d643b/docs/cli/commands.md)
   command to verify the extension is installed and [`/mcp list`](https://github.com/google-gemini/gemini-cli/blob/bbcc90613390e4d3d3aed911fbc1535af80d643b/docs/cli/commands.md)
   command to see the tools.

<br />

<br />

### Gemini CLI for PostgreSQL

<br />

1. Install the [Gemini CLI](https://github.com/google-gemini/gemini-cli?tab=readme-ov-file#quickstart).
2. Install the PostgreSQL software extension for Gemini CLI from the GitHub repository using the following command:

   ```sh
   gemini extensions install https://github.com/gemini-cli-extensions/postgres
   ```
   While installing the extension, replace the following:

   ```sh
   export POSTGRES_HOST="HOST"
   export POSTGRES_PORT="PORT"
   export POSTGRES_DATABASE="DATABASE"
   export POSTGRES_USER="USER"
   export POSTGRES_PASSWORD="PASSWORD"
   export POSTGRES_QUERY_PARAMETERS="QUERY_PARAMETERS"
   ```
   Replace the following:
   - <var translate="no">HOST</var>: The hostname or IP address of the PostgreSQL server.
   - <var translate="no">PORT</var>: The port number for the PostgreSQL server.
   - <var translate="no">DATABASE</var>: The name of the database to connect to.
   - <var translate="no">USER</var>: The database username.
   - <var translate="no">PASSWORD</var>: The password for the database user.
   - <var translate="no">QUERY_PARAMETERS</var>: Optional: The raw query to be added to the `db` connection string.
3. Start the Gemini CLI in interactive mode:

   ```sh
   gemini
   ```

   The CLI automatically loads the Gemini CLI extension for PostgreSQL
   and its tools, which you can use to interact with your database.

### Gemini Code Assist

<br />

1. Install the [Gemini Code Assist](https://marketplace.visualstudio.com/items?itemName=Google.geminicodeassist) extension in Visual Studio Code.
2. Enable Agent Mode in Gemini Code Assist chat.
3. In your working directory, create a folder named `.gemini`. Within it, create a `settings.json` file.
4. Add the following configuration, replace the environment variables with your values, and then save:

   ```json
   {
     "mcpServers": {
       "cloud-sql-postgres": {
         "command": "./PATH/TO/toolbox",
         "args": ["--prebuilt","cloud-sql-postgres","--stdio"],
         "env": {
           "CLOUD_SQL_POSTGRES_PROJECT": "PROJECT_ID",
           "CLOUD_SQL_POSTGRES_REGION": "REGION",
           "CLOUD_SQL_POSTGRES_INSTANCE": "INSTANCE_ID",
           "CLOUD_SQL_POSTGRES_DATABASE": "DATABASE_NAME",
           "CLOUD_SQL_POSTGRES_USER": "USER_ID",
           "CLOUD_SQL_POSTGRES_PASSWORD": "PASSWORD"
         }
       }
     }
   }

   ```

### Claude code

<br />

1. Install [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview).
2. Set environment variables to connect to your Cloud SQL instance:

   ```sh
   export CLOUD_SQL_POSTGRES_PROJECT="PROJECT_NAME"
   export CLOUD_SQL_POSTGRES_REGION="REGION"
   export CLOUD_SQL_POSTGRES_INSTANCE="INSTANCE_NAME"
   export CLOUD_SQL_POSTGRES_DATABASE="DATABASE_NAME"
   export CLOUD_SQL_POSTGRES_USER="DATABASE_USER_NAME"
   export CLOUD_SQL_POSTGRES_PASSWORD="PASSWORD"
   export CLOUD_SQL_POSTGRES_IP_TYPE="IP_TYPE"
   ```
   Replace the following:
   - <var translate="no">PROJECT_NAME</var>: The Google Cloud project ID.
   - <var translate="no">REGION</var>: The region of your Cloud SQL instance.
   - <var translate="no">INSTANCE_NAME</var>: The ID of your Cloud SQL instance.
   - <var translate="no">DATABASE_NAME</var>: The name of the database to connect to.
   - <var translate="no">DATABASE_USER_NAME</var>: Optional: The database username. Defaults to IAM authentication if unspecified.
   - <var translate="no">PASSWORD</var>: Optional: The password for the database user. Defaults to IAM authentication if unspecified.
   - <var translate="no">IP_TYPE</var>: Optional: The IP type, such as "Public" (default) or "Private".
3. Start the agent:

   ```sh
   claude
   ```
4. Install the plugin:

   ```sh
   /plugin install cloud-sql-postgresql@claude-plugins-official
   ```

> [!TIP]
> **Tip:** Run `/plugin list` inside Claude Code to verify the plugin is active, or `/reload-plugins` if you just installed it.

### Claude desktop

<br />

1. Open [Claude Desktop](https://claude.ai/download) and navigate to **Settings**.
2. Under the **Developer** tab, tap **Edit Config** to open the configuration file.
3. Add the following to connect to the MCP server and set the environment variables:

   ```json
   {
     "mcpServers": {
       "cloud-sql-postgres": {
         "command": "./PATH/TO/toolbox",
         "args": ["--prebuilt","cloud-sql-postgres","--stdio"],
         "env": {
           "CLOUD_SQL_POSTGRES_PROJECT": "PROJECT_ID",
           "CLOUD_SQL_POSTGRES_REGION": "REGION",
           "CLOUD_SQL_POSTGRES_INSTANCE": "INSTANCE_ID",
           "CLOUD_SQL_POSTGRES_DATABASE": "DATABASE_NAME",
           "CLOUD_SQL_POSTGRES_USER": "USER_ID",
           "CLOUD_SQL_POSTGRES_PASSWORD": "PASSWORD"
       }
     }
   }
   }

   ```
4. Restart Claude Desktop. The new chat screen displays the MCP icon with the new MCP server available.

### Cline

<br />

1. Open [Cline](https://github.com/cline/cline) extension in VS Code and tap **MCP Servers** icon.
2. Tap **Configure MCP Servers** to open the configuration file.
3. Add the following configuration, replace the environment variables with your values, and save:

   ```json
   {
     "mcpServers": {
       "cloud-sql-postgres": {
         "command": "./PATH/TO/toolbox",
         "args": ["--prebuilt","cloud-sql-postgres","--stdio"],
         "env": {
           "CLOUD_SQL_POSTGRES_PROJECT": "PROJECT_ID",
           "CLOUD_SQL_POSTGRES_REGION": "REGION",
           "CLOUD_SQL_POSTGRES_INSTANCE": "INSTANCE_ID",
           "CLOUD_SQL_POSTGRES_DATABASE": "DATABASE_NAME",
           "CLOUD_SQL_POSTGRES_USER": "USER_ID",
           "CLOUD_SQL_POSTGRES_PASSWORD": "PASSWORD"
         }
       }
     }
   }

   ```
   A green active status appears after the server connects successfully.

### Codex

<br />

1. Install the Data Cloud Plugins marketplace:

   ```sh
   codex plugin marketplace add GoogleCloudPlatform/data-cloud-plugins
   ```
2. Install the plugin:

   ```sh
   codex plugin install cloud-sql-postgresql@data-cloud-plugins
   ```
3. Configure the environment variables to connect to your Cloud SQL instance:

   ```sh
   export CLOUD_SQL_POSTGRES_PROJECT="PROJECT_NAME"
   export CLOUD_SQL_POSTGRES_REGION="REGION"
   export CLOUD_SQL_POSTGRES_INSTANCE="INSTANCE_NAME"
   export CLOUD_SQL_POSTGRES_DATABASE="DATABASE_NAME"
   export CLOUD_SQL_POSTGRES_USER="DATABASE_USER_NAME"
   export CLOUD_SQL_POSTGRES_PASSWORD="PASSWORD"
   export CLOUD_SQL_POSTGRES_IP_TYPE="IP_TYPE"
   ```
   Replace the following:
   - <var translate="no">PROJECT_NAME</var>: The Google Cloud project ID.
   - <var translate="no">REGION</var>: The region of your Cloud SQL instance.
   - <var translate="no">INSTANCE_NAME</var>: The ID of your Cloud SQL instance.
   - <var translate="no">DATABASE_NAME</var>: The name of the database to connect to.
   - <var translate="no">DATABASE_USER_NAME</var>: Optional: The database username. Defaults to IAM authentication if unspecified.
   - <var translate="no">PASSWORD</var>: Optional: The password for the database user. Defaults to IAM authentication if unspecified.
   - <var translate="no">IP_TYPE</var>: Optional: The IP type, such as "Public" (default) or "Private".
4. Optional. Update the marketplace:

   ```
   codex plugin marketplace upgrade data-cloud-plugins
   ```
5. Run `codex plugin list` or use the `plugins` interactive menu to verify your installed plugins.

### Cline

<br />

1. Open [Cline](https://github.com/cline/cline) extension in VS Code and tap **MCP Servers** icon.
2. Tap **Configure MCP Servers** to open the configuration file.
3. Add the following configuration, replace the environment variables with your values, and save:

   ```json
   {
     "mcpServers": {
       "cloud-sql-postgres": {
         "command": "./PATH/TO/toolbox",
         "args": ["--prebuilt","cloud-sql-postgres","--stdio"],
         "env": {
           "CLOUD_SQL_POSTGRES_PROJECT": "PROJECT_ID",
           "CLOUD_SQL_POSTGRES_REGION": "REGION",
           "CLOUD_SQL_POSTGRES_INSTANCE": "INSTANCE_ID",
           "CLOUD_SQL_POSTGRES_DATABASE": "DATABASE_NAME",
           "CLOUD_SQL_POSTGRES_USER": "USER_ID",
           "CLOUD_SQL_POSTGRES_PASSWORD": "PASSWORD"
         }
       }
     }
   }

   ```
   A green active status appears after the server connects successfully.

### Cursor

<br />

1. Create `.cursor` directory in your project root if it does not exist.
2. Create `.cursor/mcp.json` file if it does not exist and open it.
3. Add the following configuration, replace the environment variables with your values, and save:

   ```json
   {
     "mcpServers": {
       "cloud-sql-postgres": {
         "command": "./PATH/TO/toolbox",
         "args": ["--prebuilt","cloud-sql-postgres","--stdio"],
         "env": {
           "CLOUD_SQL_POSTGRES_PROJECT": "PROJECT_ID",
           "CLOUD_SQL_POSTGRES_REGION": "REGION",
           "CLOUD_SQL_POSTGRES_INSTANCE": "INSTANCE_ID",
           "CLOUD_SQL_POSTGRES_DATABASE": "DATABASE_NAME",
           "CLOUD_SQL_POSTGRES_USER": "USER_ID",
           "CLOUD_SQL_POSTGRES_PASSWORD": "PASSWORD"
         }
       }
     }
   }

   ```
4. Open [Cursor](https://www.cursor.com/) and navigate to **Settings \> Cursor Settings \> MCP**. A green active status appears when the server connects.

### Visual Studio Code (Copilot)

<br />

1. Open [VS Code](https://code.visualstudio.com/docs/agents/overview) and create `.vscode` directory in your project root if it does not exist.
2. Create `.vscode/mcp.json` file if it does not exist, and open it.
3. Add the following configuration, replace the environment variables with your values, and save:

   ```json
   {
     "servers": {
       "cloud-sql-postgres": {
         "command": "./PATH/TO/toolbox",
         "args": ["--prebuilt","cloud-sql-postgres","--stdio"],
         "env": {
           "CLOUD_SQL_POSTGRES_PROJECT": "PROJECT_ID",
           "CLOUD_SQL_POSTGRES_REGION": "REGION",
           "CLOUD_SQL_POSTGRES_INSTANCE": "INSTANCE_ID",
           "CLOUD_SQL_POSTGRES_DATABASE": "DATABASE_NAME",
           "CLOUD_SQL_POSTGRES_USER": "USER_ID",
           "CLOUD_SQL_POSTGRES_PASSWORD": "PASSWORD"
         }
       }
     }
   }

   ```

### Windsurf

<br />

1. Open [Windsurf](https://docs.codeium.com/windsurf) and navigate to **Cascade assistant**.
2. Tap MCP icon, then tap **Configure** to open the configuration file.
3. Add the following configuration, replace the environment variables with your values, and save:

   ```json
   {
     "mcpServers": {
       "cloud-sql-postgres": {
         "command": "./PATH/TO/toolbox",
         "args": ["--prebuilt","cloud-sql-postgres","--stdio"],
         "env": {
           "CLOUD_SQL_POSTGRES_PROJECT": "PROJECT_ID",
           "CLOUD_SQL_POSTGRES_REGION": "REGION",
           "CLOUD_SQL_POSTGRES_INSTANCE": "INSTANCE_ID",
           "CLOUD_SQL_POSTGRES_DATABASE": "DATABASE_NAME",
           "CLOUD_SQL_POSTGRES_USER": "USER_ID",
           "CLOUD_SQL_POSTGRES_PASSWORD": "PASSWORD"
         }
       }
     }
   }

   ```