MCP Toolbox for Databases: Making BigQuery datasets available to MCP clients

MCP Toolbox for Databases:
Making BigQuery datasets available to MCP clients

About this codelab

subjectLast updated Apr 28, 2025
account_circleWritten by Romin Irani

1. Introduction

In this codelab, you will be utilizing the MCP Toolbox for Databases to make available your BigQuery datasets.

Through the codelab, you will employ a step by step approach as follows:

  1. Identify a specific BigQuery dataset ("Google Cloud Release Notes) from the public BigQuery datasets program.
  2. Setup MCP Toolbox for Databases, that connects to the BigQuery dataset.
  3. Explore various MCP clients and validate that they are able to access the BigQuery dataset MCP interface.

81c33b0f8af54b0c.png

What you'll do

  • Setup MCP Toolbox for Databases to expose Google Cloud Release notes, a public BigQuery dataset, as a MCP Interface to other MCP Clients (IDEs, Tools, etc).

What you'll learn

  • Explore BigQuery public datasets and choose a specific dataset.
  • Setup MCP Toolbox for Databases for the BigQuery public dataset that we want to make available to MCP clients.
  • Test out the configuration MCP Toolbox for Databases in the local environment.

What you'll need

  • Chrome web browser.
  • A local Python development environment.
  • A local Node.js environment with npm version 5.2.0 or later.

2. Before you begin

Create a project

  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 Cloud project. Learn how to check if billing is enabled on a project .
  3. You'll use Cloud Shell, a command-line environment running in Google Cloud that comes preloaded with bq. Click Activate Cloud Shell at the top of the Google Cloud console.

Activate Cloud Shell button image

  1. Once connected to Cloud Shell, you check that you're already authenticated and that the project is set to your project ID using the following command:
gcloud auth list
  1. Run the following command in Cloud Shell to confirm that the gcloud command knows about your project.
gcloud config list project
  1. If your project is not set, use the following command to set it:
gcloud config set project <YOUR_PROJECT_ID>

Refer documentation for gcloud commands and usage.

3. Google Release Notes Dataset and MCP clients

First up, let us take a look at Google Cloud Release notes that are regularly updated at the official Google Cloud Release Notes webpage, a screenshot of which is shown below:

2cccbd4bdddbd45f.png

You might subscribe to the feed URL but what if we could simply ask in our Agent Chat about these Release notes. Maybe a simple query like "Update me on Google Cloud Release Notes".

Let's look at the final goal and this is an actual screenshot of my Visual Studio Code running CoPilot and I am in Agent Mode, asking about Google Cloud Release Notes:

ccb6ce6e2272eab6.png

Let's get going on how to build this out and in the process learn about exposing your BigQuery datasets in various MCP Clients of your choice.

4. MCP Toolbox for Databases

MCP Toolbox for Databases is an open source MCP server for databases It was designed with enterprise-grade and production-quality in mind. It enables you to develop tools easier, faster, and more securely by handling the complexities such as connection pooling, authentication, and more.

Toolbox helps you build Gen AI tools that let your agents access data in your database. Toolbox provides:

  • Simplified development: Integrate tools to your agent in less than 10 lines of code, reuse tools between multiple agents or frameworks, and deploy new versions of tools more easily.
  • Better performance: Best practices such as connection pooling, authentication, and more.
  • Enhanced security: Integrated auth for more secure access to your data
  • End-to-end observability: Out of the box metrics and tracing with built-in support for OpenTelemetry.

Toolbox sits between your application's orchestration framework and your database, providing a control plane that is used to modify, distribute, or invoke tools. It simplifies the management of your tools by providing you with a centralized location to store and update tools, allowing you to share tools between agents and applications and update those tools without necessarily redeploying your application.

451145a011a4aa.png

To summarize in simple words:

  1. MCP Toolbox is available as a binary, container image or you can build it from source.
  2. It exposes a set of tools that you configure via a tools.yaml file. The tools can be thought of connecting to your data sources. You can see the various data sources that it supports : AlloyDB, BigQuery, etc.
  3. Since this toolbox now supports MCP, you automatically have a MCP Server endpoint that can then be consumed by the Agents (IDEs) or you can use them while developing your Agent Applications using various frameworks like Agent Development Kit (ADK).

Our focus in this blog post is going to be on the areas highlighted below:

ebf6447d2af2466.png

In summary, we are going to create a configuration in the MCP Toolbox for Databases, that knows how to connect to our BigQuery dataset. We will then use an IDE or any other Agent IDE (MCP clients) that will then talk to the MCP Toolbox endpoint and allow us to send natural queries to ask about our dataset. Think of it as a tool that you are configuring that knows how to talk to your BigQuery dataset and it runs some queries.

5. BigQuery Dataset for Google Cloud Release Notes

The Google Cloud Public Dataset Program is a program that makes available a range of datasets for your applications. One such dataset is the Google Cloud Release Notes database. This dataset provides you the same information as the official Google Cloud Release Notes webpage and it is available as a publicly queryable dataset.

2104010c05c87d0d.png

As a test, I simply validate the dataset by running a simple query shown below:

SELECT
       product_name,description,published_at
     FROM
       `bigquery-public-data`.`google_cloud_release_notes`.`release_notes`
     WHERE
       DATE(published_at) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
     GROUP BY product_name,description,published_at
     ORDER BY published_at DESC

This gets me a list of records from the Release Notes dataset that have been published in the last 7 days.

Substitute this with any other dataset of your choice and your respective queries and parameters that you'd like. All we need to do now is set this up as a Data Source and Tool in MCP Toolbox for Databases. Let's see how to do that.

6. Installing MCP Toolbox for Databases

Open a terminal on your local machine and create a folder named mcp-toolbox.

mkdir mcp-toolbox

Go to the mcp-toolbox folder via the command shown below:

cd mcp-toolbox

Install the binary version of the MCP Toolbox for Databases via the script given below. 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.

export VERSION=0.4.0
curl -O https://storage.googleapis.com/genai-toolbox/v$VERSION/linux/amd64/toolbox
chmod +x toolbox

We now have the binary version of the toolbox ready for our use. The next step is to configure the toolbox with our data sources and other configurations.

7. Configuring the MCP Toolbox for Databases

Now, we need to define our BigQuery dataset and tools in the tools.yaml file that is needed by the MCP Toolbox for Database. The file tools.yaml is the primary way to configure Toolbox.

Create a file named tools.yaml in the same folder i.e. mcp-toolbox, the contents of which is shown below.

You can use the nano editor that is available in Cloud Shell. The nano command is as follows: "nano tools.yaml".

Remember to replace the YOUR_PROJECT_ID value with your Google Cloud Project Id.

sources:
 my-bq-source:
   kind: bigquery
   project: gcp-experiments-349209

tools:
 search_release_notes_bq:
   kind: bigquery-sql
   source: my-bq-source
   statement: |
     SELECT
     product_name,description,published_at
    FROM
      `bigquery-public-data`.`google_cloud_release_notes`.`release_notes`
    WHERE
     DATE(published_at) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
    GROUP BY product_name,description,published_at
    ORDER BY published_at DESC
   description: |
    Use this tool to get information on Google Cloud Release Notes.

toolsets:
 my_bq_toolset:
   - search_release_notes_bq

Let us understand the file in brief:

  1. Sources represent your different data sources that a tool can interact with. A Source represents a data source that a tool can interact with. You can define Sources as a map in the sources section of your tools.yaml file. Typically, a source configuration will contain any information needed to connect with and interact with the database. In our case, we have defined a BigQuery source my-bq-source and you need to provide your Google Cloud Project Id. For more information, refer to the Sources reference.
  2. Tools define actions an agent can take – such as reading and writing to a source. A tool represents an action your agent can take, such as running a SQL statement. You can define Tools as a map in the tools section of your tools.yaml file. Typically, a tool will require a source to act on. In our case, we define a single tool search_release_notes_bq. This references the BigQuery source my-bq-source that we defined in the first step. It also has the statement and the instruction that will be used by the AI Agent clients. For more information, refer to the Tools reference.
  3. Finally, we have the Toolset, that allows you to define groups of tools that you want to be able to load together. This can be useful for defining different groups based on agent or application. In our case, we have a toolset definition where we have currently defined only one existing tool search_release_notes_bq that we defined. You can have more than one toolset, which has a combination of different tools.

So currently, we have defined only one tool that gets the release notes for the last 7 days as per the query. But you can have various combinations with parameters too.

Check out some more configuration details ( Source, Tools) in the BigQuery datasource configuration in MCP Toolbox for Databases.

8. Testing the MCP Toolbox for Databases

We have downloaded and configured the Toolbox with the tools.yaml file in the mcp-toolbox folder. Let's run it locally first.

Execute the following command:

$ ./toolbox --tools-file="tools.yaml" --port 7000

The MCP Toolbox Server runs by default on port 5000 but in this case we have specified it to run on 7000.

On successful execution, you should see a server startup with sample output similar to the one below:

2025-04-25T16:05:45.603871+05:30 INFO "Initialized 1 sources."
2025-04-25T16:05:45.603943+05:30 INFO "Initialized 0 authServices."
2025-04-25T16:05:45.604092+05:30 INFO "Initialized 1 tools."
2025-04-25T16:05:45.604105+05:30 INFO "Initialized 2 toolsets."
2025-04-25T16:05:45.604706+05:30 INFO "Server ready to serve!"

Just launch the browser and visit the following url:

http://127.0.0.1

This should bring the following output:

2fdcdac326034d41.png

In the browser URL, add the following to the end of the URL:

http://127.0.0.1/api/toolset

This should bring up the tools that are currently configured. A sample output is shown below:

53d9c9a3bb1c8494.png

The MCP Server as per the documentation is now available at the following URL:

http://127.0.0.1/mcp/sse

The output of which is shown below:

event: endpoint
data: https://<some-url-pattern>/mcp?sessionId=bf6bfb66-36fe-48a4-8340-ac68008ee873

Let's test out our MCP Server with MCP clients in the next section.

9. Testing the MCP Server with various MCP clients

Let's test out our newly minted MCP Server with a couple of MCP clients.

MCP Inspector with Toolbox

The first tool to use is the MCP Inspector with Toolbox. To do that, you will need npx installed. Cloud Shell will prompt you to install the package. Please go ahead and install it.

You need to give the following command:

npx @modelcontextprotocol/inspector

This will launch the server and you should see an output similar to the following:

Starting MCP inspector...
⚙️ Proxy server listening on port 6277
🔍 MCP Inspector is up and running at http://127.0.0.1:6274 🚀

Visit the MCP Inspector page as mentioned and the first thing that you need to do is to configure this client to talk to the MCP server.

228554583d5fa31a.png

Select the Transport Type as SSE and provide the URL as we earlier mentioned i.e. http://127.0.0.1:7000/mcp/sse. Click on Connect. If all goes well, you should see the status as connected as shown below:

f8b3cc6d6b3ae951.png

On the right side, you can now view the list of tools, by clicking on List Tools.

362a0c5cd6fe4eae.png

Then click on the search_release_notes_bq tool and since we do not have any parameters to pass, just click on the Run tool button. You should see it invoke the Toolbox, which in turn goes and connects to the BigQuery datasource and retrieves the data as shown below:

3db3e057763ecbef.png

VS Code in Agent mode with CoPilot

If you'd like to 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.

Assuming that you have launched VS Code, launch the Command Palette and give the following command:

4df742e8ef74b52.png

Next, select HTTP sse since we have the SSE URL.

1423ab084bfa2b79.png

It will ask for the SSE endpoint, which we will provide the same one:

b155684784fb15b0.png

Next, it will confirm a few other details. I have chosen to add it to my user settings, so it will open up the settings.json file, where I can see the configuration:

901cd7c7d9850ea3.png

I simply click on Start that I see above or I can do it via the Palette command also.

You can see that the status changes to Running and it has 1 Tool also.

b62eb21d1fd01cc1.png

Now, we can launch the CoPilot Chat mode and then in Agent mode, give the following query (notice that it shows 1 tool is configured):

260e0284441440c7.png

It responds back:

a96a7ce0425d43b1.png

10. Congratulations

Congratulations, you've successfully configured the MCP Toolbox for Databases and configured a BigQuery dataset for access within MCP clients.

Reference docs