ge

genai-toolbox

Open source MCP server specializing in easy, fast, and secure tools for Databases.

Publishergenai-toolbox
Submitted date4/13/2025

Empowering LLMs with Data: The MCP Toolbox for Databases

logo

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.

Table of Contents

Why Choose the MCP Toolbox?

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:

  • Accelerated Development: Integrate database tools into your agents with minimal code (less than 10 lines!). Reuse tools across multiple agents and frameworks, and deploy new tool versions with ease.
  • Optimized Performance: Benefit from built-in best practices such as connection pooling and robust authentication mechanisms, ensuring optimal performance and resource utilization.
  • Enhanced Security: Implement integrated authentication for secure and controlled access to your sensitive data.
  • Comprehensive Observability: Gain end-to-end visibility with out-of-the-box metrics and tracing, seamlessly integrated with OpenTelemetry for advanced monitoring and diagnostics.

Architectural Overview

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.

architecture

Quick Start Guide

Server Installation

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.

Binary Installation

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
Container Image Installation

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
Compilation from Source

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]

Server Execution

  1. Configuration: Create a tools.yaml file to define your tools (see Configuration Deep Dive for details).

  2. 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.

Application Integration

Once the server is running, you can integrate the tools into your application using the appropriate Client SDK.

Core SDK
  1. Installation: Install the Toolbox Core SDK:

    pip install toolbox-core
  2. 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.

LangChain / LangGraph SDK
  1. Installation: Install the Toolbox LangChain SDK:

    pip install toolbox-langchain
  2. 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.

LlamaIndex SDK
  1. Installation: Install the Toolbox Llamaindex SDK:

    pip install toolbox-llamaindex
  2. 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.

Configuration Deep Dive

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.

Data Sources

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.

Tool Definition

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.

Toolset Management

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")

Versioning Strategy

This project adheres to semantic versioning, employing a MAJOR.MINOR.PATCH version number that increments as follows:

  • MAJOR: Indicates incompatible API changes.
  • MINOR: Indicates the addition of backward-compatible functionality.
  • PATCH: Indicates backward-compatible bug fixes.

This versioning strategy applies to the CLI associated with the Toolbox, interactions with official SDKs, and the definitions within the tools.yaml file.

Contribution Guidelines

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.

Visit More

View All