Files
genai-toolbox/docs/en/how-to/connect-ide/cloud_sql_mssql_admin_mcp.md
nandinisaini-google 5e43630907 feat(prebuilt/cloud-sql): Add clone instance tool for cloud sql (#1845)
## Description

---
This pull request adds a new tool, cloud-sql-clone-instance, which
enables cloning a Cloud SQL instance from the toolbox using the Cloud
SQL Admin API. The tool supports both standard cloning and point-in-time
recovery (PITR). It also supports specifying preferred zones for cloned
instances via the preferredZone and preferredSecondaryZone fields.

Key Features:
Instance Cloning: The tool allows you to clone a Cloud SQL instance by
specifying the source and destination instance names.
Point-in-Time Recovery (PITR): By providing a pointInTime timestamp, you
can create a clone of an instance as it existed at a specific moment.
High Availability Configuration: The preferredZone and
preferredSecondaryZone parameters allow you to configure the cloned
instance for high availability.

Tested: 
<img width="1182" height="446" alt="Screenshot 2025-11-11 at 12 21
47 PM"
src="https://github.com/user-attachments/assets/7f39a5a3-3967-43d0-8041-f1d47b4fbcd9"
/>


## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [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)
- [ ] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #1915

Co-authored-by: prernakakkar-google <158031829+prernakakkar-google@users.noreply.github.com>
Co-authored-by: Averi Kitsch <akitsch@google.com>
2025-12-01 21:31:58 +00:00

8.8 KiB

title, type, weight, description
title type weight description
Cloud SQL for SQL Server Admin using MCP docs 5 Create and manage Cloud SQL for SQL Server (Admin) using Toolbox.

This guide covers how to use MCP Toolbox for Databases to expose your developer assistant tools to create and manage Cloud SQL for SQL Server instance, database and users:

Before you begin

  1. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

  2. Make sure that billing is enabled for your Google Cloud project.

  3. Grant the necessary IAM roles to the user that will be running the MCP server. The tools available will depend on the roles granted:

    • roles/cloudsql.viewer: Provides read-only access to resources.
      • get_instance
      • list_instances
      • list_databases
      • wait_for_operation
    • roles/cloudsql.editor: Provides permissions to manage existing resources.
      • All viewer tools
      • create_database
    • roles/cloudsql.admin: Provides full control over all resources.
      • All editor and viewer tools
      • create_instance
      • create_user
      • clone_instance

Install MCP Toolbox

  1. Download the latest version of Toolbox as a binary. Select the correct binary corresponding to your OS and CPU architecture. You are required to use Toolbox version V0.15.0+:

    {{< tabpane persist=header >}} {{< tab header="linux/amd64" lang="bash" >}} curl -O https://storage.googleapis.com/genai-toolbox/v0.15.0/linux/amd64/toolbox {{< /tab >}}

{{< tab header="darwin/arm64" lang="bash" >}} curl -O https://storage.googleapis.com/genai-toolbox/v0.15.0/darwin/arm64/toolbox {{< /tab >}}

{{< tab header="darwin/amd64" lang="bash" >}} curl -O https://storage.googleapis.com/genai-toolbox/v0.15.0/darwin/amd64/toolbox {{< /tab >}}

{{< tab header="windows/amd64" lang="bash" >}} curl -O https://storage.googleapis.com/genai-toolbox/v0.15.0/windows/amd64/toolbox.exe {{< /tab >}} {{< /tabpane >}}

  1. Make the binary executable:

    chmod +x toolbox
    
  2. Verify the installation:

    ./toolbox --version
    

Configure your MCP Client

{{< tabpane text=true >}} {{% tab header="Claude code" lang="en" %}}

  1. Install Claude Code.

  2. Create a .mcp.json file in your project root if it doesn't exist.

  3. Add the following configuration and save:

    {
      "mcpServers": {
        "cloud-sql-mssql-admin": {
          "command": "./PATH/TO/toolbox",
          "args": ["--prebuilt","cloud-sql-mssql-admin","--stdio"],
          "env": {
          }
        }
      }
    }
    
  4. Restart Claude code to apply the new configuration. {{% /tab %}}

{{% tab header="Claude desktop" lang="en" %}}

  1. Open Claude desktop and navigate to Settings.

  2. Under the Developer tab, tap Edit Config to open the configuration file.

  3. Add the following configuration and save:

    {
      "mcpServers": {
        "cloud-sql-mssql-admin": {
          "command": "./PATH/TO/toolbox",
          "args": ["--prebuilt","cloud-sql-mssql-admin","--stdio"],
          "env": {
          }
        }
      }
    }
    
  4. Restart Claude desktop.

  5. From the new chat screen, you should see a hammer (MCP) icon appear with the new MCP server available. {{% /tab %}}

{{% tab header="Cline" lang="en" %}}

  1. Open the Cline extension in VS Code and tap the MCP Servers icon.

  2. Tap Configure MCP Servers to open the configuration file.

  3. Add the following configuration and save:

    {
      "mcpServers": {
        "cloud-sql-mssql-admin": {
          "command": "./PATH/TO/toolbox",
          "args": ["--prebuilt","cloud-sql-mssql-admin","--stdio"],
          "env": {
          }
        }
      }
    }
    
  4. You should see a green active status after the server is successfully connected. {{% /tab %}}

{{% tab header="Cursor" lang="en" %}}

  1. Create a .cursor directory in your project root if it doesn't exist.

  2. Create a .cursor/mcp.json file if it doesn't exist and open it.

  3. Add the following configuration and save:

    {
      "mcpServers": {
        "cloud-sql-mssql-admin": {
          "command": "./PATH/TO/toolbox",
          "args": ["--prebuilt","cloud-sql-mssql-admin","--stdio"],
          "env": {
          }
        }
      }
    }
    
  4. Cursor and navigate to Settings > Cursor Settings > MCP. You should see a green active status after the server is successfully connected. {{% /tab %}}

{{% tab header="Visual Studio Code (Copilot)" lang="en" %}}

  1. Open VS Code and create a .vscode directory in your project root if it doesn't exist.

  2. Create a .vscode/mcp.json file if it doesn't exist and open it.

  3. Add the following configuration and save:

    {
      "servers": {
        "cloud-sql-mssql-admin": {
          "command": "./PATH/TO/toolbox",
          "args": ["--prebuilt","cloud-sql-mssql-admin","--stdio"],
          "env": {
          }
        }
      }
    }
    

{{% /tab %}}

{{% tab header="Windsurf" lang="en" %}}

  1. Open Windsurf and navigate to the Cascade assistant.

  2. Tap on the hammer (MCP) icon, then Configure to open the configuration file.

  3. Add the following configuration and save:

    {
      "mcpServers": {
        "cloud-sql-mssql-admin": {
          "command": "./PATH/TO/toolbox",
          "args": ["--prebuilt","cloud-sql-mssql-admin","--stdio"],
          "env": {
          }
        }
      }
    }
    

{{% /tab %}}

{{% tab header="Gemini CLI" lang="en" %}}

  1. Install the Gemini CLI.

  2. In your working directory, create a folder named .gemini. Within it, create a settings.json file.

  3. Add the following configuration and save:

    {
      "mcpServers": {
        "cloud-sql-mssql-admin": {
          "command": "./PATH/TO/toolbox",
          "args": ["--prebuilt","cloud-sql-mssql-admin","--stdio"],
          "env": {
          }
        }
      }
    }
    

{{% /tab %}}

{{% tab header="Gemini Code Assist" lang="en" %}}

  1. Install the Gemini Code Assist 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 and save:

    {
      "mcpServers": {
        "cloud-sql-mssql-admin": {
          "command": "./PATH/TO/toolbox",
          "args": ["--prebuilt","cloud-sql-mssql-admin","--stdio"],
          "env": {
          }
        }
      }
    }
    

{{% /tab %}} {{< /tabpane >}}

Use Tools

Your AI tool is now connected to Cloud SQL for SQL Server using MCP.

The cloud-sql-mssql-admin server provides tools for managing your Cloud SQL instances and interacting with your database:

  • create_instance: Creates a new Cloud SQL for SQL Server instance.
  • get_instance: Gets information about a Cloud SQL instance.
  • list_instances: Lists Cloud SQL instances in a project.
  • create_database: Creates a new database in a Cloud SQL instance.
  • list_databases: Lists all databases for a Cloud SQL instance.
  • create_user: Creates a new user in a Cloud SQL instance.
  • wait_for_operation: Waits for a Cloud SQL operation to complete.
  • clone_instance: Creates a clone of an existing Cloud SQL for SQL Server instance.

{{< notice note >}} Prebuilt tools are pre-1.0, so expect some tool changes between versions. LLMs will adapt to the tools available, so this shouldn't affect most users. {{< /notice >}}