Files
google__adk-docs/docs/tools/google-cloud/mcp-toolbox-for-databases.md
Ivan Cheung 5675b92a4f docs: Add MCP Toolbox for databases Go SDK Documentation (#895)
* docs: Add MCP Toolbox for databases Go SDK Documentation

* minor fix

* Moved into tabs

---------

Co-authored-by: Disha Prakash <dishaprakash@google.com>
Co-authored-by: ivanmkc <ivanmkc@google.com>
2025-11-06 16:48:23 -05:00

7.8 KiB
Raw Permalink Blame History

MCP Toolbox for Databases

Supported in ADKPythonGo

MCP Toolbox for Databases is an open source MCP server for databases. It was designed with enterprise-grade and production-quality in mind. It enables you to develop tools easier, faster, and more securely by handling the complexities such as connection pooling, authentication, and more.

Google’s Agent Development Kit (ADK) has built in support for Toolbox. For more information on getting started or configuring Toolbox, see the documentation.

GenAI Toolbox

Supported Data Sources

MCP Toolbox provides out-of-the-box toolsets for the following databases and data platforms:

Google Cloud

Relational & SQL Databases

NoSQL & Key-Value Stores

Graph Databases

  • Neo4j (with tools for Cypher queries and schema inspection)
  • Dgraph

Data Platforms & Federation

  • Looker (for running Looks, queries, and building dashboards via the Looker API)
  • Trino (for running federated queries across multiple sources)

Other

Configure and deploy

Toolbox is an open source server that you deploy and manage yourself. For more instructions on deploying and configuring, see the official Toolbox documentation:

Install Client SDK for ADK

=== "Python"

ADK relies on the `toolbox-core` python package to use Toolbox. Install the
package before getting started:

```shell
pip install toolbox-core
```

### Loading Toolbox Tools

Once you’re Toolbox server is configured and up and running, you can load tools
from your server using ADK:

```python
from google.adk.agents import Agent
from toolbox_core import ToolboxSyncClient

toolbox = ToolboxSyncClient("https://127.0.0.1:5000")

# Load a specific set of tools
tools = toolbox.load_toolset('my-toolset-name'),
# Load single tool
tools = toolbox.load_tool('my-tool-name'),

root_agent = Agent(
    ...,
    tools=tools # Provide the list of tools to the Agent

)
```

=== "Go"

ADK relies on the `mcp-toolbox-sdk-go` go module to use Toolbox. Install the
module before getting started:

```shell
go get github.com/googleapis/mcp-toolbox-sdk-go
```

### Loading Toolbox Tools

Once you’re Toolbox server is configured and up and running, you can load tools
from your server using ADK:

```go
package main

import (
	"context"
	"fmt"

	"github.com/googleapis/mcp-toolbox-sdk-go/tbadk"
	"google.golang.org/adk/agent/llmagent"
)

func main() {

  toolboxClient, err := tbadk.NewToolboxClient("https://127.0.0.1:5000")
	if err != nil {
		log.Fatalf("Failed to create MCP Toolbox client: %v", err)
	}

  // Load a specific set of tools
  toolboxtools, err := toolboxClient.LoadToolset("my-toolset-name", ctx)
  if err != nil {
    return fmt.Sprintln("Could not load Toolbox Toolset", err)
  }

  toolsList := make([]tool.Tool, len(toolboxtools))
    for i := range toolboxtools {
      toolsList[i] = &toolboxtools[i]
    }

  llmagent, err := llmagent.New(llmagent.Config{
    ...,
    Tools:       toolsList,
  })

  // Load a single tool
  tool, err := client.LoadTool("my-tool-name", ctx)
  if err != nil {
    return fmt.Sprintln("Could not load Toolbox Tool", err)
  }

  llmagent, err := llmagent.New(llmagent.Config{
    ...,
    Tools:       []tool.Tool{&toolboxtool},
  })
}
```

Advanced Toolbox Features

Toolbox has a variety of features to make developing Gen AI tools for databases. For more information, read more about the following features:

  • Authenticated Parameters: bind tool inputs to values from OIDC tokens automatically, making it easy to run sensitive queries without potentially leaking data
  • Authorized Invocations: restrict access to use a tool based on the users Auth token
  • OpenTelemetry: get metrics and tracing from Toolbox with OpenTelemetry