MCP Toolbox for Databases
Visit ProjectOpen-source MCP server with fast, secure tools for databases (by Google).
Visit ProjectCategory
Tags
what is MCP Toolbox for Databases?
MCP Toolbox for Databases is an open-source MCP server developed by Google that provides fast and secure tools for interacting with databases. It simplifies database operations by handling complexities such as connection pooling, authentication, and more.
How to use MCP Toolbox for Databases?
- Installation: You can install the Toolbox either as a binary, a container image, or compile it from source. Detailed instructions are available in the official documentation.
- Configuration: Set up a
tools.yaml
file to define your sources, tools, and toolsets. - Running the Server: Execute
toolbox --tools-file "tools.yaml"
to start the server. - Integration: Load the tools into your application using the provided client SDKs (Toolbox Core, LangChain, LlamaIndex).
Key features of MCP Toolbox for Databases?
- Simplified Development: Easily integrate tools with minimal code.
- Better Performance: Utilizes best practices like connection pooling.
- Enhanced Security: Integrated authentication for secure data access.
- End-to-End Observability: Built-in metrics and tracing with OpenTelemetry support.
- AI Database Assistant: Enables language-based database interactions directly from your IDE.
Use cases of MCP Toolbox for Databases?
- Complex Querying: Execute complex database queries using natural language.
- Automated Database Management: Describe data needs and let the AI manage your database tasks.
- Context-Aware Code Generation: Generate application code and tests with real-time database schema awareness.
- Streamlined Development: Reduce manual setup and boilerplate code, enhancing development efficiency.
FAQ from MCP Toolbox for Databases?
-
Is MCP Toolbox for Databases currently stable?
No, it is currently in beta and may see breaking changes until the first stable release (v1.0).
-
What are the primary ways to configure MCP Toolbox for Databases?
The primary way to configure Toolbox is through the
tools.yaml
file. This file defines your sources, tools, and toolsets. -
How does Toolbox enhance database management?
Toolbox provides tools that simplify database operations by handling connection pooling, authentication, and other complexities, allowing for more efficient and secure database management.
MCP Toolbox for Databases
[!NOTE] MCP Toolbox for Databases is currently in beta, and may see breaking changes until the first stable release (v1.0).
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.
This README provides a brief overview. For comprehensive details, see the full documentation.
[!NOTE] This solution was originally named “Gen AI Toolbox for Databases” as its initial development predated MCP, but was renamed to align with recently added MCP compatibility.
Table of Contents
Why Toolbox?
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.
⚡ Supercharge Your Workflow with an AI Database Assistant ⚡
Stop context-switching and let your AI assistant become a true co-developer. By connecting your IDE to your databases with MCP Toolbox, you can delegate complex and time-consuming database tasks, allowing you to build faster and focus on what matters. This isn't just about code completion; it's about giving your AI the context it needs to handle the entire development lifecycle.
Here’s how it will save you time:
- Query in Plain English: Interact with your data using natural language right from your IDE. Ask complex questions like, "How many orders were delivered in 2024, and what items were in them?" without writing any SQL.
- Automate Database Management: Simply describe your data needs, and let the AI assistant manage your database for you. It can handle generating queries, creating tables, adding indexes, and more.
- Generate Context-Aware Code: Empower your AI assistant to generate application code and tests with a deep understanding of your real-time database schema. This accelerates the development cycle by ensuring the generated code is directly usable.
- Slash Development Overhead: Radically reduce the time spent on manual setup and boilerplate. MCP Toolbox helps streamline lengthy database configurations, repetitive code, and error-prone schema migrations.
Learn how to connect your AI tools (IDEs) to Toolbox using MCP.
General Architecture
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.
Getting Started
Installing the server
For the latest version, check the releases page and use the following instructions for your OS and CPU architecture.
Binary To install Toolbox as a binary: sh # see releases page for other versions export VERSION=0.7.0 curl -O https://storage.googleapis.com/genai-toolbox/v$VERSION/linux/amd64/toolbox chmod +x toolbox
Container image You can also install Toolbox as a container: sh # see releases page for other versions export VERSION=0.7.0 docker pull us-central1-docker.pkg.dev/database-toolbox/toolbox/toolbox:$VERSION
Compile from source To install from source, ensure you have the latest version of Go installed, and then run the following command: sh go install github.com/googleapis/genai-toolbox@v0.7.0
Running the server
Configure a tools.yaml
to define your tools, and then
execute toolbox
to start the server:
./toolbox --tools-file "tools.yaml"
You can use toolbox help
for a full list of flags! To stop the server, send a
terminate signal (ctrl+c
on most platforms).
For more detailed documentation on deploying to different environments, check out the resources in the How-to section
Integrating your application
Once your server is up and running, you can load the tools into your application. See below the list of Client SDKs for using various frameworks:
Core 1. Install [Toolbox Core SDK][toolbox-core]: bash pip install toolbox-core
1. Load tools: python from toolbox_core import ToolboxClient # update the url to point to your server async with ToolboxClient("http://127.0.0.1:5000") as client: # these tools can be passed to your application! tools = await client.load_toolset("toolset_name")
For more detailed instructions on using the Toolbox Core SDK, see the [project's README][toolbox-core-readme]. [toolbox-core]: https://pypi.org/project/toolbox-core/ [toolbox-core-readme]: https://github.com/googleapis/mcp-toolbox-sdk-python/tree/main/packages/toolbox-core/README.md
LangChain / LangGraph 1. Install [Toolbox LangChain SDK][toolbox-langchain]: bash pip install toolbox-langchain
1. Load tools: python from toolbox_langchain import ToolboxClient # update the url to point to your server async with ToolboxClient("http://127.0.0.1:5000") as client: # these tools can be passed to your application! tools = client.load_toolset()
For more detailed instructions on using the Toolbox LangChain SDK, see the [project's README][toolbox-langchain-readme]. [toolbox-langchain]: https://pypi.org/project/toolbox-langchain/ [toolbox-langchain-readme]: https://github.com/googleapis/mcp-toolbox-sdk-python/blob/main/packages/toolbox-langchain/README.md
LlamaIndex 1. Install [Toolbox Llamaindex SDK][toolbox-llamaindex]: bash pip install toolbox-llamaindex
1. Load tools: python from toolbox_llamaindex import ToolboxClient # update the url to point to your server async with ToolboxClient("http://127.0.0.1:5000") as client: # these tools can be passed to your application! tools = client.load_toolset()
For more detailed instructions on using the Toolbox Llamaindex SDK, see the [project's README][toolbox-llamaindex-readme]. [toolbox-llamaindex]: https://pypi.org/project/toolbox-llamaindex/ [toolbox-llamaindex-readme]: https://github.com/googleapis/genai-toolbox-llamaindex-python/blob/main/README.md
Configuration
The primary way to configure Toolbox is through the tools.yaml
file. If you
have multiple files, you can tell toolbox which to load with the --tools-file tools.yaml
flag.
You can find more detailed reference documentation to all resource types in the Resources.
Sources
The sources
section of your tools.yaml
defines what data sources your
Toolbox should have access to. Most tools will have at least one source to
execute against.
sources:
my-pg-source:
kind: postgres
host: 127.0.0.1
port: 5432
database: toolbox_db
user: toolbox_user
password: my-password
For more details on configuring different types of sources, see the Sources.
Tools
The tools
section of a tools.yaml
define the actions an agent can take: what
kind of tool it is, which source(s) it affects, what parameters it uses, etc.
tools:
search-hotels-by-name:
kind: postgres-sql
source: my-pg-source
description: Search for hotels based on name.
parameters:
- name: name
type: string
description: The name of the hotel.
statement: SELECT * FROM hotels WHERE name ILIKE '%' || $1 || '%';
For more details on configuring different types of tools, see the Tools.
Toolsets
The toolsets
section of your tools.yaml
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.
toolsets:
my_first_toolset:
- my_first_tool
- my_second_tool
my_second_toolset:
- my_second_tool
- my_third_tool
You can load toolsets by name:
# This will load all tools
all_tools = client.load_toolset()
# This will only load the tools listed in 'my_second_toolset'
my_second_toolset = client.load_toolset("my_second_toolset")
Versioning
This project uses semantic versioning, including a
MAJOR.MINOR.PATCH
version number that increments with:
- MAJOR version when we make incompatible API changes
- MINOR version when we add functionality in a backward compatible manner
- PATCH version when we make backward compatible bug fixes
The public API that this applies to is the CLI associated with Toolbox, the
interactions with official SDKs, and the definitions in the tools.yaml
file.
Contributing
Contributions are welcome. Please, see the CONTRIBUTING to get started.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See Contributor Code of Conduct for more information.