Open source MCP server specializing in easy, fast, and secure tools for Databases.
Unleash the potential of your Large Language Models (LLMs) by seamlessly connecting them to your databases with the MCP Toolbox for Databases.
[!IMPORTANT] The MCP Toolbox for Databases is currently in Beta. Expect potential breaking changes as we refine the product towards a stable v1.0 release. Your feedback is highly valued!
The MCP Toolbox for Databases is an open-source Model Context Protocol (MCP) server meticulously crafted for database interactions. Designed with enterprise-grade robustness and production-readiness in mind, it empowers developers to build sophisticated AI-driven tools with unparalleled ease, speed, and security. By abstracting away complexities such as connection pooling, authentication, and more, the Toolbox allows you to focus on what truly matters: building intelligent applications.
This document provides a concise overview of the MCP Toolbox for Databases. For in-depth information, consult the comprehensive official documentation.
[!CAUTION] Originally named "Gen AI Toolbox for Databases," this product has been rebranded to align with its newly added MCP compatibility.
The MCP Toolbox for Databases revolutionizes the way you build Generative AI tools, enabling your agents to access and leverage data directly from your databases. Key benefits include:
The MCP Toolbox for Databases acts as a crucial intermediary between your application's orchestration framework and your databases. It provides a centralized control plane for managing, distributing, and invoking tools. This architecture simplifies tool management by providing a single source of truth for tool definitions, enabling seamless sharing of tools across agents and applications. Furthermore, it allows you to update tools without requiring redeployment of your entire application.
To obtain the latest version of the MCP Toolbox for Databases, refer to the releases page and follow the installation instructions corresponding to your operating system and CPU architecture.
To install the Toolbox as a binary executable:
# Replace with the desired version from the releases page export VERSION=0.3.0 curl -O https://storage.googleapis.com/genai-toolbox/v$VERSION/linux/amd64/toolbox chmod +x toolbox
Alternatively, you can install the Toolbox as a container image:
# Replace with the desired version from the releases page export VERSION=0.3.0 docker pull us-central1-docker.pkg.dev/database-toolbox/toolbox/toolbox:$VERSION
To install from source, ensure you have the latest version of Go installed, and then execute the following command:
go install github.com/googleapis/[email protected]
Configuration: Create a tools.yaml
file to define your tools (see Configuration Deep Dive for details).
Execution: Start the server using the following command:
./toolbox --tools_file "tools.yaml"
For a comprehensive list of available flags, use toolbox help
. To stop the server, send a terminate signal (e.g., Ctrl+C
on most platforms).
For detailed instructions on deploying to various environments, consult the resources available in the How-to section.
Once the server is running, you can integrate the tools into your application using the appropriate Client SDK.
Installation: Install the Toolbox Core SDK:
pip install toolbox-core
Tool Loading:
from toolbox_core import ToolboxClient # Update the URL to point to your server client = ToolboxClient("http://127.0.0.1:5000") # Load the desired toolset tools = await client.load_toolset("toolset_name") # The 'tools' variable now contains the loaded tools, ready for use in your application!
For detailed instructions on using the Toolbox Core SDK, refer to the project's README.
Installation: Install the Toolbox LangChain SDK:
pip install toolbox-langchain
Tool Loading:
from toolbox_langchain import ToolboxClient # Update the URL to point to your server client = ToolboxClient("http://127.0.0.1:5000") # Load the desired toolset tools = client.load_toolset() # The 'tools' variable now contains the loaded tools, ready for use in your application!
For detailed instructions on using the Toolbox LangChain SDK, refer to the project's README.
Installation: Install the Toolbox Llamaindex SDK:
pip install toolbox-llamaindex
Tool Loading:
from toolbox_llamaindex import ToolboxClient # Update the URL to point to your server client = ToolboxClient("http://127.0.0.1:5000") # Load the desired toolset tools = client.load_toolset() # The 'tools' variable now contains the loaded tools, ready for use in your application!
For detailed instructions on using the Toolbox Llamaindex SDK, refer to the project's README.
The tools.yaml
file is the primary configuration mechanism for the MCP Toolbox for Databases. You can specify the file to load using the --tools_file tools.yaml
flag.
For comprehensive reference documentation on all resource types, consult the Resources section.
The sources
section of your tools.yaml
file defines the data sources that your Toolbox will have access to. Most tools will require 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 detailed information on configuring different types of data sources, refer to the Sources documentation.
The tools
section of the tools.yaml
file defines the actions that an agent can perform. This includes specifying the tool type, the data source(s) it interacts with, and the parameters it accepts.
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 detailed information on configuring different types of tools, refer to the Tools documentation.
The toolsets
section of your tools.yaml
file allows you to define logical groupings of tools that can be loaded together. This is particularly useful for organizing tools based on agent or application requirements.
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 using the Client SDK:
# Load all tools defined in the configuration all_tools = client.load_toolset() # Load only the tools listed in the 'my_second_toolset' my_second_toolset = client.load_toolset("my_second_toolset")
This project adheres to semantic versioning, employing a MAJOR.MINOR.PATCH
version number that increments as follows:
This versioning strategy applies to the CLI associated with the Toolbox, interactions with official SDKs, and the definitions within the tools.yaml
file.
We welcome contributions to the MCP Toolbox for Databases! Please consult the CONTRIBUTING.md file to get started.
This project is released under 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.
๐ โ๏ธ Biomedical research server providing access to PubMed, ClinicalTrials.gov, and MyVariant.info.
๐ MCP server that provides SQL analysis, linting, and dialect conversion using [SQLGlot](https://github.com/tobymao/sqlglot)
๐ ๐ All-in-one MCP server for Postgres development and operations, with tools for performance analysis, tuning, and health checks
Supabase MCP Server with support for SQL query execution and database exploration tools