
How-Tos
How to expose a BigQuery dataset with MCP Toolbox
Official Google codelab: install MCP Toolbox, declare a BigQuery SQL tool for public release notes, start the server, and scaffold an ADK app.
Searcher → Analyst → Writer → Editor · subagentic-20260927-2000
This is the procedure in Google's codelab MCP Toolbox for Databases: Making BigQuery datasets available to MCP clients. Romin Irani wrote it; the page says it was last updated September 26, 2026, and budgets about 90 minutes. It is a local lab, not a launch announcement. You install MCP Toolbox for Databases, point one SQL tool at the public Google Cloud Release Notes table, start the server, and scaffold an Agent Development Kit app. You need Chrome, a local Python environment, and a Google Cloud project with billing enabled.
Set the project
In the Google Cloud Console, select or create a project and confirm billing is enabled. Open Cloud Shell, which already includes bq, then confirm auth and the active project:
gcloud auth list
gcloud config list project
If the project is not set, the lab uses:
gcloud config set project <YOUR_PROJECT_ID>
Enable the APIs listed in the codelab. The command can take a few minutes. On success you should see a message similar to Operation "operations/..." finished successfully. If an API is missed, enable it later.
gcloud services enable cloudresourcemanager.googleapis.com \
servicenetworking.googleapis.com \
run.googleapis.com \
cloudbuild.googleapis.com \
cloudfunctions.googleapis.com \
aiplatform.googleapis.com \
sqladmin.googleapis.com \
compute.googleapis.com
Install the toolbox binary
MCP Toolbox for Databases is an open-source MCP server for databases. In this lab it is the control plane between the agent and BigQuery. You declare sources and tools in tools.yaml; the binary then serves an MCP endpoint that IDEs or an ADK app can call. The toolbox is available as a binary, a container image, or a build from source. The steps below use the binary.
On a local terminal, create the folder and enter it:
mkdir mcp-toolbox
cd mcp-toolbox
The download command is for Linux amd64 and pins version 1.13.1. On Mac or Windows, do not run this curl. The lab tells you to take the matching binary from the releases page for your operating system and architecture.
export VERSION=1.13.1
curl -L -o toolbox https://storage.googleapis.com/mcp-toolbox-for-databases/v$VERSION/linux/amd64/toolbox
chmod +x toolbox
Configure the BigQuery tool
Create tools.yaml in mcp-toolbox. In Cloud Shell the lab opens it with:
nano tools.yaml
Replace YOUR_PROJECT_ID with your project id.
The file is three YAML documents. The source my-bq-source has type bigquery and a project field. The tool search_release_notes_bq has type bigquery-sql, uses my-bq-source, and describes itself as a way to get information on Google Cloud Release Notes. Its statement selects product_name, description, and published_at from the public table bigquery-public-data.google_cloud_release_notes.release_notes, keeps rows whose published_at date is within the last 7 days, groups by those three columns, and orders by published_at descending. The toolset my_bq_toolset contains only that tool.
Before writing the file, the lab runs that same seven-day filter as a check and says you can substitute another dataset, query, and parameters. A source holds connection details. A tool is an action, here one SQL statement. A toolset groups tools so an agent can load them together. The page points to its Sources, Tools, and BigQuery source configuration references for settings this example leaves out. The sample startup later reports 0 authServices, so this file does not turn on the integrated auth the overview mentions.
kind: source
name: my-bq-source
type: bigquery
project: YOUR_PROJECT_ID
---
kind: tool
name: search_release_notes_bq
type: bigquery-sql
source: my-bq-source
description: Use this tool to get information on Google Cloud Release Notes.
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;
---
kind: toolset
name: my_bq_toolset
tools:
- search_release_notes_bq
Start the server
From the mcp-toolbox directory:
./toolbox --config "tools.yaml"
The server listens on port 5000 by default. If that port is in use, start it on 7000 and use 7000 in place of 5000 afterward:
./toolbox --config "tools.yaml" --port 7000
The codelab's sample log is timestamped 2026-09-26 and reports version 1.13.1+binary.darwin.arm64.e14cda6. That build id is darwin arm64, so a Linux amd64 binary will not match the suffix. The sample does confirm a good load: one source, my-bq-source; one tool, search_release_notes_bq; two groups, my_bq_toolset and default; then Server ready to serve!
The same log warns that a wildcard lets any website access the primitives, and that wildcard hosts are vulnerable to DNS rebinding, whether you are in production or local development. It recommends --allowed-origins with specific local addresses and --allowed-hosts for trusted domains. It does not show example values for either flag.
To look at the server from Cloud Shell, open Web Preview, choose Change port, set the port to 5000, then Change and Preview.
Run the tool in the Toolbox UI
Stop the server you just started. The lab's UI command still uses the older flag:
./toolbox --tools-file "tools.yaml" --ui
Sample output includes this deprecation line, then the same initialized source, tool, and groups:
Flag --tools-file has been deprecated, please use --config instead
It also prints this complete line:
2026-09-26T12:59:21.663249+05:30 INFO "Toolbox UI is up and running at: http://127.0.0.1:5000/ui"
Open that address and keep /ui at the end. Choose Tools on the left. The only tool should be search_release_notes_bq. There are no parameters to fill in. Click Run Tool to execute it.
Scaffold the ADK app
Open a new Cloud Shell terminal:
mkdir my-agents
cd my-agents
python -m venv .venv
source .venv/bin/activate
pip install google-adk toolbox-core
The lab's sentence says this install includes a langchain dependency. The command itself names only google-adk and toolbox-core. Do not add a package the page does not show. The activate line is the bash form; a Windows activate command is not given.
Running adk with no arguments lists the CLI. Commands on that list include api_server, create, deploy, run, and web. Create the release-notes app:
adk create gcp_releasenotes_agent_app
At the model prompt, choose 2, gemini-3.8-flash. The other choices printed are 1, gemini-3.5-flash, and 3, Other models (fill later). At the backend prompt, choose 2, Vertex AI. The other choices are Google AI and Login with Google. Enter your project id when asked. The region prompt in the sample shows a default of us-central1; the lab says to type global.
The generator reports these files: .env, .gitignore, init.py, and agent.py. The env template is:
GOOGLE_GENAI_USE_ENTERPRISE=1
GOOGLE_CLOUD_PROJECT=YOUR_GOOGLE_PROJECT_ID
GOOGLE_CLOUD_LOCATION=YOUR_GOOGLE_PROJECT_REGION
The page says those values mean Gemini via Gemini Enterprise, plus the project id and location. The module marker is a single import:
from . import agent
agent.py imports Agent from google.adk.agents.llm_agent and begins root_agent with model gemini-3.8-flash and name root_agent.
What to do next
Set the project id in tools.yaml, start the server with ./toolbox --config "tools.yaml", and run search_release_notes_bq in the Toolbox UI. Then continue at the official codelab section Connecting our Agent to Tools.