

This post looks at the latest release of MCP Toolbox for Databases, that allows for integration of the toolbox into MCP friendly AI Assistants (e.g. Visual Studio Code, Claude IDE, etc).
If you are a developer in today’s world, chances are high that you are used to working with an AI assistant while developing your code. If you are looking at writing code to integrate with Google Cloud databases, chances are high that you are moving between the IDE and the Google Cloud console or command line interfaces to check if the Database entries are fine or not.
You could argue that there are enough extensions available that one can integrate into modern IDEs like Visual Studio Code and get access to the database operations. This post is not about comparing the same but building upon my previous blog, where I have covered MCP Toolbox for databases and how it makes it dead simple to expose Google Cloud datasources like BigQuery, AlloyDB, Cloud SQL and other partner integrations, as MCP servers.
If you are not familiar with MCP Toolbox for Databases, I suggest that you try out the previous blog post, where I demonstrated how you can setup the MCP Toolbox to expose your BigQuery datasets.
The first step is always going to be about what we are going to achieve. We are having a sample Cloud SQL for PostgreSQL database instance in Google Cloud that has a database that contains a hotel table and a few records. Once we complete the integration, we can fire natural queries using the MCP Tools that we have configured and interact with the database like this via Natural Language query and no need to write SQLs.
Sounds good? Let’s see how to make that happen, step by step.
You can read the previous blog post for more information on MCP Toolbox for Databases but it is sufficient to mention here, as per the official documentation that “MCP Toolbox for Databases is an open source MCP server for databases. It enables you to develop tools easier, faster, and more securely by handling the complexities such as connection pooling, authentication, and more.”
An overall architecture diagram is shown below:
Since this open-source project originated at Google, there is a wide variety of Google Databases that are already integrated into the MCP Toolbox. The MCP Toolbox for Databases is now in its 0.6.0 release. The latest release introduced an interesting integration of the Toolbox with various MCP-friendly AI Assistants like VS Code, Claude, Cursor, etc. This means that you can be within your favourite AI Assistant and fire away natural queries against your databases and the MCP Toolbox will take care of the grunt work of request/response with those databases.
Our focus for this blog post will be Cloud SQL for PostgreSQL database.
But first, we need to do a few things around getting our Google Cloud Project ready and setting up the Cloud SQL for PostgreSQL database.
This blog post will not go into the details of setting up a Google Cloud Project, Cloud SQL for PostgreSQL instance, etc. If you are looking for specific instructions to do so, I would recommend taking a look at the following lab that I have co-authored.
Take a look at steps 2, 3 and 4 that detail how to setup a Google Cloud project, a Cloud SQL for PostgreSQL instance and populating it with sample hotels data.
The assumption moving forward is the following:
- You have a Google Cloud Project created with the right permissions and you have the project id with you.
- You have a Cloud SQL for PostgreSQL instance created with sample database, table and data in that table.
Our goal will be to see how to execute natural queries against those from a local AI Assistant (Visual Studio Code) that is integrated with the MCP Toolbox for Databases.
But first, we have to install the MCP Toolbox for Databases.
You can find the details of installing the database at the official MCP Toolbox for Database installation page, but here are the instructions again.
In your local machine, create a mcp-toolbox
folder and download the correct MCP Toolbox for Databases binary and make it an executable.
export VERSION=0.6.0
curl -O https://storage.googleapis.com/genai-toolbox/v$VERSION/linux/amd64/toolbox
chmod +x toolbox
The command given below is for Linux but if you are on Mac or Windows, ensure that you are downloading the correct binary. Check out the releases page for your Operation System and Architecture and download the correct binary.
The official documentation has the steps on how to connect to the Toolbox for various Data sources and IDEs over here.
In this section, we will check out how to configure and use MCP servers in VS Code. Note that it is available in Preview and the official documentation is exhaustive and available here. Ensure that you set it up as per the instructions here:
Let us assume that you have enabled it as per the above instructions, launched Visual Studio code and are in a specific workspace/ folder that has been opened in Visual Studio code.
Launch the Command Palette
and give the following command:
Next, select Command (stdio)
since we will be running this locally.
Next, it will ask you for the full path to where you have installed the toolbox
, give that. In my case, the full path is shown below but please choose the path as per your local installation of the toolbox.
For the server ID, let’s give the following:
Next, it will ask for the User or Workspace settings, let’s go with Workspace i.e. local to this workspace.
This will now create a folder inside your workspace named .vscode
and a file named mcp.json
. The contents of the file mcp.json
are shown below:
"servers": {
"cloudsql-postgres": {
"type": "stdio",
"command": "/Users/romin/mcp-toolbox-0.6.0/toolbox",
"args": []
}
}
We need to modify the above configuration to include the parameters that we need to provide while launching the toolbox
and also environmental variables that can point to our Google Cloud project, Cloud SQL for PostgreSQL details and more.
The final record in mcp.json
should look like this:
{
"servers": {
"cloudsql-postgres": {
"command": "/Users/romin/mcp-toolbox-0.6.0/toolbox",
"args": ["--port","7000","--prebuilt","cloud-sql-postgres","--stdio"],
"env": {
"CLOUD_SQL_POSTGRES_PROJECT": "YOUR_GOOGLE_CLOUD_PROJECT_ID",
"CLOUD_SQL_POSTGRES_REGION": "YOUR_GOOGLE_CLOUD_PROJECT_REGION",
"CLOUD_SQL_POSTGRES_INSTANCE": "YOUR_CLOUDSQL_INSTANCE_NAME",
"CLOUD_SQL_POSTGRES_DATABASE": "YOUR_CLOUDSQL_DATABASE_NAME",
"CLOUD_SQL_POSTGRES_USER": "YOUR_CLOUDSQL_DATABASE_USERNAME",
"CLOUD_SQL_POSTGRES_PASSWORD": "YOUR_CLOUDSQL_DATABASE_PASSWORD"
}
}}
}
You can see that we are providing the details on which port to start the toolbox
on. We are also using the new prebuilt
flag to point to which datasource type to connect to. You can look up more on this configuration over here.
You can now start the MCP Toolbox server for this integration as follows. From the Command Pallete in Visual Studio Code, provide the MCP:List Server
command as shown below:
Select the cloudsql-postgres
server and then Start
the server. It should ideally show an output as shown below:
If you do not see this or some exception is thrown, ensure that you have provided the correct values in the mcp.json
file and connectivity is present.
We are now in the final stages and will validate the same inside of a CoPilot chat session.
First up, launch CoPilot in Chat mode and then go into Agent mode as shown below:
Click on the Tools icon at the bottom left as shown below:
This will show a list of tools that the cloudsql-postgres
server provides:
This means that we can use the #execute_sql
and #list_tables
as two tools.
Give the following sample query in the chat:
#list_tables in the postgres database
This will provide the following response:
Click on Continue as you’d like and you find that the tool was invoked the the relevant metadata information was obtained:
We can now ask for the data in the hotels
table.
#execute_sql find all hotels
or
#execute_sql find all hotels in location Basel
This concludes how you can work with your database inside of MCP friendly AI clients like VS Code, Claude, etc. The blog demonstrated how this was made possible via the MCP Toolbox for Databases 0.6.0 release that allows you to connect your AI tools (IDEs) to Toolbox using MCP. For more information, read up here.
Source Credit: https://medium.com/google-cloud/boost-your-productivity-while-working-with-google-cloud-databases-in-visual-studio-code-47b73b3a8745?source=rss—-e52cf94d98af—4