

You’ll need this…
Human Project Team vs. Software Agents
Imagine you’re managing a complex project — say, building a house. You don’t do everything yourself. You have a team of specialists: architects, plumbers, electricians, carpenters. Each specialist has:
- Specific Skills: Each professional knows their area inside and out.
- A Goal: They aim to complete their assigned tasks according to the project plan.
- Autonomy: While they coordinate, they make decisions independently within their area of expertise.
- Communication: They talk to each other to solve problems and coordinate their work.
It is trying to build software systems in a similar way. Instead of one giant program, you have a team of (not necessarily) smaller, specialized software agents that work together.
So, how do you build one? or build many and connect them? Read here: https://medium.com/google-cloud/multi-agent-application-with-agent-development-kit-50a942915459
MCP stands for Model Context Protocol, an open standard developed by Anthropic that provides a consistent way for AI agents to connect with external tools, services, and data. It essentially functions as a common standard for AI applications, allowing them to seamlessly interact with different data sources and tools.
- It uses a client-server model, where AI applications (the hosts) run the MCP client, which communicates with MCP servers.
- When an AI agent needs to access a specific tool or data, it sends a structured request to the MCP client, which forwards it to the appropriate MCP server.
- Allows AI models to access external data and tools without requiring custom code for each integration.
- Simplifies the process of building agents and complex workflows on top of Large Language Models (LLMs).
Google’s 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.
How?
- 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.
Have to call out the fact that this predated MCP!!!
MCP Toolbox for Databases sits between your agentic 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.
Let’s dive into our toy store example. In this use case, we are writing a database, (AlloyDB) query for the price calculation feature using MCP Toolbox for AlloyDB. It helps us streamline database management.
I have the codelab here and I’m going to walk you at a very high-level the steps involved:
First, Preparing AlloyDB for the Toolbox Interaction
- In preparation for setting up Toolbox, let’s enable public IP connectivity in our AlloyDB instance so the new tool can access the database. Update instance and we are set.
- Then we’ll install MCP Toolbox for Databases. Run the cloud shell command to download and install toolbox in your new folder:
# see releases page for other versions
export VERSION=0.1.0
curl -O https://storage.googleapis.com/genai-toolbox/v$VERSION/linux/amd64/toolbox
chmod +x toolbox
3. Toggle to Cloud Shell Editor. Expand the newly created folder “toystore” and create a new file called tools.yaml. Copy the content below. Replace YOUR_PROJECT_ID and check if all the other connection details are accurate.
sources:
alloydb-toys:
kind: "alloydb-postgres"
project: "YOUR_PROJECT_ID"
region: "us-central1"
cluster: "vector-cluster"
instance: "vector-instance"
database: "postgres"
user: "postgres"
password: "alloydb"tools:
get-toy-price:
kind: postgres-sql
source: alloydb-toys
description: Get the price of a toy based on a description.
parameters:
- name: description
type: string
description: A description of the toy to search for.
statement: |
SELECT price FROM toys
ORDER BY text_embeddings <=> CAST(embedding('text-embedding-005', $1) AS vector(768))
LIMIT 1;
In the query part (refer to “statement” parameter above), we are just finding the closest match to the user’s search text (custom toy description) and returning its price. You can also modify it to find the average price of the top 5 closest matching toys.
For more details on configuring your tools.yaml, refer to this documentation.
4. Toggle back to Cloud Shell Terminal and write the following command:
./toolbox - tools_file "tools.yaml"
Now if you open the server in a web preview mode on the cloud, you should be able to see the Toolbox server up and running with your new tool named get-toy-price.
5. Next, “GCLOUD RUN DEPLOY” your toolbox server to Cloud Run!! Follow the step by step instructions in the “Deploy to Cloud Run” page of the MCP Toolbox for Databases documentation.
6. Then, connect your app with MCP Toolbox for Databases in just 3 lines of code:
!pip install toolbox-core
from toolbox_core import ToolboxClient# Replace with your Toolbox service's URL
toolbox = ToolboxClient("https://toolbox-*****-uc.a.run.app")
# This tool can be passed to your application!
tool = toolbox.load_tool("get-toy-price")
7. Finally invoke the tool:
# Invoke the tool with a search text to pass as the parameter
result = tool.invoke({"description": "white plush toy"})
# Print result
print(result)
From MCP Client:
Instead, if you want to connect to Toolbox from MCP client, refer to this documentation.
Checkout the codelabs below:
- Codelab demonstrating MCP Toolbox for AlloyDB from non-MCP client — created by me and
- Codelab demonstrating MCP Toolbox for BigQuery from an MCP client created — created by Romin Irani
Try it out hands-on and let us know what you built and if it helped improve your experience connecting databases to your agentic applications.
Source Credit: https://medium.com/google-cloud/mcp-toolbox-for-databases-7da54908bc7e?source=rss—-e52cf94d98af—4