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
11.8K stars

MCP Toolbox for Databases is an open-source server that simplifies building Gen AI tools that access database data. It handles connection pooling, authentication, and security, allowing you to develop AI-powered database tools more efficiently and securely with minimal code.

Installation Options

Non-Production Quick Start

For testing and experimentation, run directly using npm:

npx @toolbox-sdk/server --tools-file tools.yaml

Binary Installation

For a production-ready installation, download the appropriate binary for your system:

Linux (AMD64)

export VERSION=0.23.0
curl -L -o toolbox https://storage.googleapis.com/genai-toolbox/v$VERSION/linux/amd64/toolbox
chmod +x toolbox

macOS (Apple Silicon)

export VERSION=0.23.0
curl -L -o toolbox https://storage.googleapis.com/genai-toolbox/v$VERSION/darwin/arm64/toolbox
chmod +x toolbox

macOS (Intel)

export VERSION=0.23.0
curl -L -o toolbox https://storage.googleapis.com/genai-toolbox/v$VERSION/darwin/amd64/toolbox
chmod +x toolbox

Windows (PowerShell)

$VERSION = "0.23.0"
curl.exe -o toolbox.exe "https://storage.googleapis.com/genai-toolbox/v$VERSION/windows/amd64/toolbox.exe"

Alternative Installation Methods

You can also install using Homebrew:

brew install mcp-toolbox

Running the Server

Create a configuration file named tools.yaml to define your data sources and tools, then start the server:

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

The server automatically enables dynamic reloading of configuration changes. Use --disable-reload to turn this off.

Configuration

Configure your MCP Toolbox using a YAML file that defines sources, tools, and toolsets.

Sources

Define your database connections:

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

Tools

Define actions that can be performed on your data sources:

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

Group tools into sets that can be loaded together:

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

Integrating with Applications

Python

from toolbox_core import ToolboxClient

# Connect to your toolbox server
async with ToolboxClient("http://127.0.0.1:5000") as client:
    # Load tools by toolset name
    tools = await client.load_toolset("toolset_name")

JavaScript/TypeScript

import { ToolboxClient } from '@toolbox-sdk/core';

// Connect to your toolbox server
const URL = 'http://127.0.0.1:5000';
let client = new ToolboxClient(URL);

// Load tools by toolset name
const tools = await client.loadToolset('toolsetName');

Go

package main

import (
  "github.com/googleapis/mcp-toolbox-sdk-go/tbadk"
  "context"
)

func main() {
  URL := "http://127.0.0.1:5000"
  ctx := context.Background()
  client, err := tbadk.NewToolboxClient(URL)
  if err != nil {
    return fmt.Sprintln("Could not start Toolbox Client", err)
  }

  tool, err := client.LoadTool("toolName", ctx)
  if err != nil {
    return fmt.Sprintln("Could not load Toolbox Tool", err)
  }
}

Using with Gemini CLI

For command-line interaction with your database using natural language, install the Gemini CLI extension:

gemini extensions install https://github.com/gemini-cli-extensions/mcp-toolbox

This allows you to interact with your custom tools using conversational prompts directly from the command line.

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