Toolbox for Databases MCP server

Provides a secure, configurable interface for executing pre-defined queries against multiple database systems including PostgreSQL, MySQL, SQL Server, Neo4j, Dgraph, and Spanner through a YAML-based configuration system.
Back to servers
Setup instructions
Provider
Google
Release date
Apr 09, 2025
Language
Go
Stats
4.2K stars

The MCP Toolbox for Databases is an open-source MCP server that simplifies building AI tools for database access. It handles connection pooling, authentication, and other complexities, allowing you to develop tools faster and more securely.

Installation

Binary Installation

To install the latest version of Toolbox as a binary:

# see releases page for other versions
export VERSION=0.8.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:

# see releases page for other versions
export VERSION=0.8.0
docker pull us-central1-docker.pkg.dev/database-toolbox/toolbox/toolbox:$VERSION

Running the Server

After installing, you'll need to configure your tools in a YAML file, then start the server:

./toolbox --tools-file "tools.yaml"

Toolbox enables dynamic reloading by default. To disable, use the --disable-reload flag.

Use toolbox help for a full list of available options. To stop the server, press ctrl+c.

Configuration

Sources Configuration

The sources section defines what data sources your Toolbox should access:

sources:
  my-pg-source:
    kind: postgres
    host: 127.0.0.1
    port: 5432
    database: toolbox_db
    user: toolbox_user
    password: my-password

Tools Configuration

The tools section defines the actions an agent can take:

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 || '%';

Toolsets Configuration

The toolsets section allows you to define groups of tools:

toolsets:
    my_first_toolset:
        - my_first_tool
        - my_second_tool
    my_second_toolset:
        - my_second_tool
        - my_third_tool

Integrating with Your Application

Python Integration

Core SDK

  1. Install the SDK:
pip install toolbox-core
  1. Load tools:
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")

LangChain Integration

  1. Install the SDK:
pip install toolbox-langchain
  1. Load tools:
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()

LlamaIndex Integration

  1. Install the SDK:
pip install toolbox-llamaindex
  1. Load tools:
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()

JavaScript/TypeScript Integration

Core SDK

  1. Install the SDK:
npm install @toolbox-sdk/core
  1. Load tools:
import { ToolboxClient } from '@toolbox-sdk/core';

// update the url to point to your server
const URL = 'http://127.0.0.1:5000';
let client = new ToolboxClient(URL);

// these tools can be passed to your application!
const tools = await client.loadToolset('toolsetName');

Use Cases

The MCP Toolbox enables powerful database interactions for AI assistants, including:

  • Query in Plain English: Interact with your data using natural language directly from your IDE
  • Automate Database Management: Let AI handle generating queries, creating tables, and adding indexes
  • Generate Context-Aware Code: Create application code with deep understanding of your database schema
  • Slash Development Overhead: Reduce time spent on manual setup and boilerplate code

By connecting your AI tools to Toolbox using MCP, you can create database assistants that significantly improve your development workflow.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "toolbox-for-databases" '{"command":"toolbox","args":["--tools-file","tools.yaml"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "toolbox-for-databases": {
            "command": "toolbox",
            "args": [
                "--tools-file",
                "tools.yaml"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "toolbox-for-databases": {
            "command": "toolbox",
            "args": [
                "--tools-file",
                "tools.yaml"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later