Labsco
googleapis logo

MCP Toolbox for Databases

βœ“ Officialβ˜… 15,800

from googleapis

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

πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

MCP Toolbox for Databases

MCP Toolbox for Databases is an open source Model Context Protocol (MCP) server that connects your AI agents, IDEs, and applications directly to your enterprise databases.

It serves a dual purpose:

  • Ready-to-use MCP Server (Build-Time): Instantly connect Gemini CLI, Google Antigravity, Claude Code, Codex, or other MCP clients to your databases using our prebuilt generic tools . Talk to your data, explore schemas, and generate code without writing boilerplate.

  • Custom Tools Framework (Run-Time): A robust framework to build specialized, highly secure AI tools for your production agents. Define structured queries, semantic search, and NL2SQL capabilities safely and easily.

This README provides a brief overview. For comprehensive details, see the full documentation.

[!IMPORTANT] Repository Name Update: The genai-toolbox repository has been officially renamed to mcp-toolbox. To ensure your local environment reflects the new name, you may update your remote: git remote set-url origin https://github.com/googleapis/mcp-toolbox.git

[!NOTE] This solution was originally named β€œGen AI Toolbox for Databases” (github.com/googleapis/genai-toolbox) as its initial development predated MCP, but was renamed to align with the MCP compatibility.

Table of Contents

  • Why MCP Toolbox?

  • Quick Start: Prebuilt Tools

  • Quick Start: Custom Tools

  • Install & Run the Toolbox server

  • Connect to Toolbox

  • MCP Client

  • Toolbox SDKs: Integrate with your Application

  • Additional Features

  • Versioning

  • Contributing

  • Community

Why MCP Toolbox?

  • Out-of-the-Box Database Access: Prebuilt generic tools for instant data exploration (e.g., list_tables, execute_sql) directly from your IDE or CLI.

  • Custom Tools Framework: Build production-ready tools with your own predefined logic, ensuring safety through Restricted Access, Structured Queries, and Semantic Search.

  • Simplified Development: Integrate tools into your Agent Development Kit (ADK), LangChain, LlamaIndex, or custom agents in less than 10 lines of code.

  • Better Performance: Handles connection pooling, integrated auth (IAM), and end-to-end observability (OpenTelemetry) out of the box.

  • Enhanced Security: Integrated authentication for more secure access to your data.

  • End-to-end Observability: Out of the box metrics and tracing with built-in support for OpenTelemetry.

Connect to Toolbox

Once your Toolbox server is up and running, you can load tools into your MCP-compatible client or application.

MCP Client

Add the following configuration to your MCP client configuration:

Copy & paste β€” that's it
{
 "mcpServers": {
 "toolbox": {
 "type": "http",
 "url": "http://127.0.0.1:5000/mcp",
 }
 }
}

If you would like to connect to a specific toolset, replace url with "http://127.0.0.1:5000/mcp/{toolset_name}".

Toolbox SDKs: Integrate with your Application

Toolbox Client SDKs provide the easy-to-use building blocks and advanced features for connecting your custom applications to the MCP Toolbox server. See below the list of Client SDKs for using various frameworks:

Python (Github)

Core

Install Toolbox Core SDK:

Copy & paste β€” that's it
pip install toolbox-core

Load tools:

Copy & paste β€” that's it
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.

LangChain / LangGraph

Install Toolbox LangChain SDK:

Copy & paste β€” that's it
pip install toolbox-langchain

Load tools:

Copy & paste β€” that's it
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.

LlamaIndex

Install Toolbox Llamaindex SDK:

Copy & paste β€” that's it
pip install toolbox-llamaindex

Load tools:

Copy & paste β€” that's it
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.

Javascript/Typescript (Github)

Core

Install Toolbox Core SDK:

Copy & paste β€” that's it
npm install @toolbox-sdk/core

Load tools:

Copy & paste β€” that's it
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');

For more detailed instructions on using the Toolbox Core SDK, see the project's README.

LangChain / LangGraph

Install Toolbox Core SDK:

Copy & paste β€” that's it
npm install @toolbox-sdk/core

Load tools:

Copy & paste β€” that's it
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 toolboxTools = await client.loadToolset('toolsetName');

// Define the basics of the tool: name, description, schema and core logic
const getTool = (toolboxTool) => tool(currTool, {
 name: toolboxTool.getName(),
 description: toolboxTool.getDescription(),
 schema: toolboxTool.getParamSchema()
});

// Use these tools in your Langchain/Langraph applications
const tools = toolboxTools.map(getTool);

Genkit

Install Toolbox Core SDK:

Copy & paste β€” that's it
npm install @toolbox-sdk/core

Load tools:

Copy & paste β€” that's it
import { ToolboxClient } from '@toolbox-sdk/core';
import { genkit } from 'genkit';

// Initialise genkit
const ai = genkit({
 plugins: [
 googleAI({
 apiKey: process.env.GEMINI_API_KEY || process.env.GOOGLE_API_KEY
 })
 ],
 model: googleAI.model('gemini-2.0-flash'),
});

// 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 toolboxTools = await client.loadToolset('toolsetName');

// Define the basics of the tool: name, description, schema and core logic
const getTool = (toolboxTool) => ai.defineTool({
 name: toolboxTool.getName(),
 description: toolboxTool.getDescription(),
 schema: toolboxTool.getParamSchema()
}, toolboxTool)

// Use these tools in your Genkit applications
const tools = toolboxTools.map(getTool);

ADK

Install Toolbox ADK SDK:

Copy & paste β€” that's it
npm install @toolbox-sdk/adk

Load tools:

Copy & paste β€” that's it
import { ToolboxClient } from '@toolbox-sdk/adk';

// 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');

For more detailed instructions on using the Toolbox ADK SDK, see the project's README.

Go (Github)

Core

Install Toolbox Go SDK:

Copy & paste β€” that's it
go get github.com/googleapis/mcp-toolbox-sdk-go

Load tools:

Copy & paste β€” that's it
package main

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

func main() {
 // Make sure to add the error checks
 // update the url to point to your server
 URL := "http://127.0.0.1:5000";
 ctx := context.Background()

 client, err := core.NewToolboxClient(URL)

 // Framework agnostic tools
 tools, err := client.LoadToolset("toolsetName", ctx)
}

For more detailed instructions on using the Toolbox Go SDK, see the project's README.

LangChain Go

Install Toolbox Go SDK:

Copy & paste β€” that's it
go get github.com/googleapis/mcp-toolbox-sdk-go

Load tools:

Copy & paste β€” that's it
package main

import (
 "context"
 "encoding/json"

 "github.com/googleapis/mcp-toolbox-sdk-go/core"
 "github.com/tmc/langchaingo/llms"
)

func main() {
 // Make sure to add the error checks
 // update the url to point to your server
 URL := "http://127.0.0.1:5000"
 ctx := context.Background()

 client, err := core.NewToolboxClient(URL)

 // Framework agnostic tool
 tool, err := client.LoadTool("toolName", ctx)

 // Fetch the tool's input schema
 inputschema, err := tool.InputSchema()

 var paramsSchema map[string]any
 _ = json.Unmarshal(inputschema, ΒΆmsSchema)

 // Use this tool with LangChainGo
 langChainTool := llms.Tool{
 Type: "function",
 Function: &llms.FunctionDefinition{
 Name: tool.Name(),
 Description: tool.Description(),
 Parameters: paramsSchema,
 },
 }
}

Genkit

Install Toolbox Go SDK:

Copy & paste β€” that's it
go get github.com/googleapis/mcp-toolbox-sdk-go

Load tools:

Copy & paste β€” that's it
package main
import (
 "context"
 "log"

 "github.com/firebase/genkit/go/genkit"
 "github.com/googleapis/mcp-toolbox-sdk-go/core"
 "github.com/googleapis/mcp-toolbox-sdk-go/tbgenkit"
)

func main() {
 // Make sure to add the error checks
 // Update the url to point to your server
 URL := "http://127.0.0.1:5000"
 ctx := context.Background()
 g := genkit.Init(ctx)

 client, err := core.NewToolboxClient(URL)

 // Framework agnostic tool
 tool, err := client.LoadTool("toolName", ctx)

 // Convert the tool using the tbgenkit package
 // Use this tool with Genkit Go
 genkitTool, err := tbgenkit.ToGenkitTool(tool, g)
 if err != nil {
 log.Fatalf("Failed to convert tool: %v\n", err)
 }
 log.Printf("Successfully converted tool: %s", genkitTool.Name())
}

Go GenAI

Install Toolbox Go SDK:

Copy & paste β€” that's it
go get github.com/googleapis/mcp-toolbox-sdk-go

Load tools:

Copy & paste β€” that's it
package main

import (
 "context"
 "encoding/json"

 "github.com/googleapis/mcp-toolbox-sdk-go/core"
 "google.golang.org/genai"
)

func main() {
 // Make sure to add the error checks
 // Update the url to point to your server
 URL := "http://127.0.0.1:5000"
 ctx := context.Background()

 client, err := core.NewToolboxClient(URL)

 // Framework agnostic tool
 tool, err := client.LoadTool("toolName", ctx)

 // Fetch the tool's input schema
 inputschema, err := tool.InputSchema()

 var schema *genai.Schema
 _ = json.Unmarshal(inputschema, &schema)

 funcDeclaration := &genai.FunctionDeclaration{
 Name: tool.Name(),
 Description: tool.Description(),
 Parameters: schema,
 }

 // Use this tool with Go GenAI
 genAITool := &genai.Tool{
 FunctionDeclarations: []*genai.FunctionDeclaration{funcDeclaration},
 }
}

OpenAI Go

Install Toolbox Go SDK:

Copy & paste β€” that's it
go get github.com/googleapis/mcp-toolbox-sdk-go

Load tools:

Copy & paste β€” that's it
package main

import (
 "context"
 "encoding/json"

 "github.com/googleapis/mcp-toolbox-sdk-go/core"
 openai "github.com/openai/openai-go"
)

func main() {
 // Make sure to add the error checks
 // Update the url to point to your server
 URL := "http://127.0.0.1:5000"
 ctx := context.Background()

 client, err := core.NewToolboxClient(URL)

 // Framework agnostic tool
 tool, err := client.LoadTool("toolName", ctx)

 // Fetch the tool's input schema
 inputschema, err := tool.InputSchema()

 var paramsSchema openai.FunctionParameters
 _ = json.Unmarshal(inputschema, ΒΆmsSchema)

 // Use this tool with OpenAI Go
 openAITool := openai.ChatCompletionToolParam{
 Function: openai.FunctionDefinitionParam{
 Name: tool.Name(),
 Description: openai.String(tool.Description()),
 Parameters: paramsSchema,
 },
 }

}

ADK Go

Install Toolbox Go SDK:

Copy & paste β€” that's it
go get github.com/googleapis/mcp-toolbox-sdk-go

Load tools:

Copy & paste β€” that's it
package main

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

func main() {
 // Make sure to add the error checks
 // Update the url to point to your server
 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)
 }

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

For more detailed instructions on using the Toolbox Go SDK, see the project's README.

Additional Features

Test tools with the Toolbox UI

To launch Toolbox's interactive UI, use the --ui flag. This allows you to test tools and toolsets with features such as authorized parameters. To learn more, visit Toolbox UI.

Copy & paste β€” that's it
./toolbox --ui

Telemetry

Toolbox emits traces and metrics via OpenTelemetry. Use --telemetry-otlp=<endpoint> to export to any OTLP-compatible backend like Google Cloud Monitoring, Agnost AI, or others. See the telemetry docs for details.

Generate Agent Skills

The skills-generate command allows you to convert a toolset into an Agent Skill compatible with the Agent Skill specification. This is useful for distributing tools as portable skill packages.

Copy & paste β€” that's it
toolbox --config tools.yaml skills-generate \
 --name "my-skill" \
 --toolset "my_toolset" \
 --description "A skill containing multiple tools"

Once generated, you can install the skill into the Gemini CLI:

Copy & paste β€” that's it
gemini skills install ./skills/my-skill

For more details, see the Generate Agent Skills guide.

Versioning

MCP Toolbox for Databases follows Semantic Versioning.

The Public API includes the Toolbox Server (CLI, configuration manifests, and pre-built toolsets) and the Client SDKs.

  • Major versions are incremented for breaking changes, such as incompatible CLI or manifest changes.

  • Minor versions are incremented for new features, including modifications to pre-built toolsets or beta features.

  • Patch versions are incremented for backward-compatible bug fixes.

For more details, see our Full Versioning Policy.

Contributing

Contributions are welcome. Please, see the CONTRIBUTING guide to get started.

For technical details on setting up a environment for developing on Toolbox itself, see the DEVELOPER guide.

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.

Community

Join our Discord community to connect with our developers!