Jorge Torres 1b2cca9faa feat: Add MindsDB Source and Tools (#878)
🚀 Add MindsDB Integration: Expand Toolbox to Hundreds of Datasources
Overview
This PR introduces comprehensive MindsDB integration to the Google GenAI
Toolbox, enabling SQL queries across hundreds of datasources through a
unified interface. MindsDB is the most widely adopted AI federated
database that automatically translates MySQL queries into REST APIs,
GraphQL, and native protocols.
🎯 Key Value for Google GenAI Toolbox Ecosystem
1. Massive Datasource Expansion
Before: Toolbox limited to ~15 traditional databases
After: Access to hundreds of datasources including Salesforce, Jira,
GitHub, MongoDB, Gmail, Slack, and more
Impact: Dramatically expands the toolbox's reach and utility for
enterprise users
2. Cross-Datasource Analytics
New Capability: Perform joins and analytics across different datasources
seamlessly
Example: Join Salesforce opportunities with GitHub activity to correlate
sales with development activity
Value: Enables comprehensive data analysis that was previously
impossible
3. API Abstraction Layer
Innovation: Write standard SQL queries that automatically translate to
any API
Benefit: Developers can query REST APIs, GraphQL, and native protocols
using familiar SQL syntax
Impact: Reduces complexity and learning curve for accessing diverse
datasources
4. ML Model Integration
Enhanced Capability: Use ML models as virtual tables for real-time
predictions
Example: Query customer churn predictions directly through SQL
Value: Brings AI/ML capabilities into the standard SQL workflow
🔧 Technical Implementation
Source Layer
 New MindsDB source implementation using MySQL wire protocol
 Comprehensive test coverage with integration tests
 Updated existing MySQL tools to support MindsDB sources
 Created dedicated MindsDB tools for enhanced functionality
Tools Layer
 mindsdb-execute-sql: Direct SQL execution across federated datasources
 mindsdb-sql: Parameterized SQL queries with template support
 Backward compatibility with existing MySQL tools
Documentation & Configuration
 Comprehensive documentation with real-world examples
 Prebuilt configuration for easy setup
 Updated CLI help text and command-line options
📊 Supported Datasources
Business Applications
Salesforce (leads, opportunities, accounts)
Jira (issues, projects, workflows)
GitHub (repositories, commits, PRs)
Slack (channels, messages, teams)
HubSpot (contacts, companies, deals)
Databases & Storage
MongoDB (NoSQL collections as structured tables)
Redis (key-value stores)
Elasticsearch (search and analytics)
S3, filesystems, etc (file storage)
Communication & Email
Gmail/Outlook (emails, attachments)
Microsoft Teams (communications, files)
Discord (server data, messages)
🎯 Example Use Cases
Cross-Datasource Analytics
-- Join Salesforce opportunities with GitHub activity
```
SELECT 
    s.opportunity_name,
    s.amount,
    g.repository_name,
    COUNT(g.commits) as commit_count
FROM salesforce.opportunities s
JOIN github.repositories g ON s.account_id = g.owner_id
WHERE s.stage = 'Closed Won';
```

Email & Communication Analysis
```
-- Analyze email patterns with Slack activity
SELECT 
    e.sender,
    e.subject,
    s.channel_name,
    COUNT(s.messages) as message_count
FROM gmail.emails e
JOIN slack.messages s ON e.sender = s.user_name
WHERE e.date >= '2024-01-01';
```





🚀 Benefits for Google GenAI Toolbox
Enterprise Adoption: Enables access to enterprise datasources
(Salesforce, Jira, etc.)
Developer Productivity: Familiar SQL interface for any datasource
AI/ML Integration: Seamless integration of ML models into SQL workflows
Scalability: Single interface for hundreds of datasources
Competitive Advantage: Unique federated database capabilities in the
toolbox ecosystem
📈 Impact Metrics
Datasource Coverage: +1000% increase in supported datasources
API Abstraction: Eliminates need to learn individual API syntaxes
Cross-Platform Analytics: Enables previously impossible data
correlations
ML Integration: Brings AI capabilities into standard SQL workflows
🔗 Resources
MindsDB Documentation
MindsDB GitHub
Updated Toolbox Documentation
 Testing
 Unit tests for MindsDB source implementation
 Integration tests with real datasource examples
 Backward compatibility with existing MySQL tools
 Documentation examples tested and verified
This integration transforms the Google GenAI Toolbox from a traditional
database tool into a comprehensive federated data platform, enabling
users to query and analyze data across their entire technology stack
through a unified SQL interface.

---------

Co-authored-by: duwenxin <duwenxin@google.com>
Co-authored-by: setohe0909 <setohe.09@gmail.com>
Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
Co-authored-by: Wenxin Du <117315983+duwenxin99@users.noreply.github.com>
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
2025-11-05 01:09:30 +00:00
2024-06-07 21:29:24 +00:00
2025-05-20 21:50:26 +00:00

logo

MCP Toolbox for Databases

Docs Discord Medium Go Report Card

Note

MCP Toolbox for Databases is currently in beta, and may see breaking changes until the first stable release (v1.0).

MCP Toolbox for Databases is an open source MCP server for databases. It enables you to develop tools easier, faster, and more securely by handling the complexities such as connection pooling, authentication, and more.

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

Note

This solution was originally named “Gen AI Toolbox for Databases” as its initial development predated MCP, but was renamed to align with recently added MCP compatibility.

Table of Contents

Why Toolbox?

Toolbox helps you build Gen AI tools that let your agents access data in your database. Toolbox provides:

  • Simplified development: Integrate tools to your agent in less than 10 lines of code, reuse tools between multiple agents or frameworks, and deploy new versions of tools more easily.
  • Better performance: Best practices such as connection pooling, authentication, and more.
  • Enhanced security: Integrated auth for more secure access to your data
  • End-to-end observability: Out of the box metrics and tracing with built-in support for OpenTelemetry.

Supercharge Your Workflow with an AI Database Assistant

Stop context-switching and let your AI assistant become a true co-developer. By connecting your IDE to your databases with MCP Toolbox, you can delegate complex and time-consuming database tasks, allowing you to build faster and focus on what matters. This isn't just about code completion; it's about giving your AI the context it needs to handle the entire development lifecycle.

Heres how it will save you time:

  • Query in Plain English: Interact with your data using natural language right from your IDE. Ask complex questions like, "How many orders were delivered in 2024, and what items were in them?" without writing any SQL.
  • Automate Database Management: Simply describe your data needs, and let the AI assistant manage your database for you. It can handle generating queries, creating tables, adding indexes, and more.
  • Generate Context-Aware Code: Empower your AI assistant to generate application code and tests with a deep understanding of your real-time database schema. This accelerates the development cycle by ensuring the generated code is directly usable.
  • Slash Development Overhead: Radically reduce the time spent on manual setup and boilerplate. MCP Toolbox helps streamline lengthy database configurations, repetitive code, and error-prone schema migrations.

Learn how to connect your AI tools (IDEs) to Toolbox using MCP.

General Architecture

Toolbox sits between your application's orchestration framework and your database, providing a control plane that is used to modify, distribute, or invoke tools. It simplifies the management of your tools by providing you with a centralized location to store and update tools, allowing you to share tools between agents and applications and update those tools without necessarily redeploying your application.

architecture

Getting Started

Installing the server

For the latest version, check the releases page and use the following instructions for your OS and CPU architecture.

Binary

To install Toolbox as a binary:

Linux (AMD64)

To install Toolbox as a binary on Linux (AMD64):

# see releases page for other versions
export VERSION=0.18.0
curl -L -o toolbox https://storage.googleapis.com/genai-toolbox/v$VERSION/linux/amd64/toolbox
chmod +x toolbox
macOS (Apple Silicon)

To install Toolbox as a binary on macOS (Apple Silicon):

# see releases page for other versions
export VERSION=0.18.0
curl -L -o toolbox https://storage.googleapis.com/genai-toolbox/v$VERSION/darwin/arm64/toolbox
chmod +x toolbox
macOS (Intel)

To install Toolbox as a binary on macOS (Intel):

# see releases page for other versions
export VERSION=0.18.0
curl -L -o toolbox https://storage.googleapis.com/genai-toolbox/v$VERSION/darwin/amd64/toolbox
chmod +x toolbox
Windows (AMD64)

To install Toolbox as a binary on Windows (AMD64):

# see releases page for other versions
$VERSION = "0.18.0"
Invoke-WebRequest -Uri "https://storage.googleapis.com/genai-toolbox/v$VERSION/windows/amd64/toolbox.exe" -OutFile "toolbox.exe"
Container image You can also install Toolbox as a container:
# see releases page for other versions
export VERSION=0.18.0
docker pull us-central1-docker.pkg.dev/database-toolbox/toolbox/toolbox:$VERSION
Homebrew

To install Toolbox using Homebrew on macOS or Linux:

brew install mcp-toolbox
Compile from source

To install from source, ensure you have the latest version of Go installed, and then run the following command:

go install github.com/googleapis/genai-toolbox@v0.18.0
Gemini CLI Extensions

To install Gemini CLI Extensions for MCP Toolbox, run the following command:

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

Running the server

Configure a tools.yaml to define your tools, and then execute toolbox to start the server:

Binary

To run Toolbox from binary:

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

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

Container image

To run the server after pulling the container image:

export VERSION=0.11.0 # Use the version you pulled
docker run -p 5000:5000 \
-v $(pwd)/tools.yaml:/app/tools.yaml \
us-central1-docker.pkg.dev/database-toolbox/toolbox/toolbox:$VERSION \
--tools-file "/app/tools.yaml"

ⓘ Note
The -v flag mounts your local tools.yaml into the container, and -p maps the container's port 5000 to your host's port 5000.

Source

To run the server directly from source, navigate to the project root directory and run:

go run .

ⓘ Note
This command runs the project from source, and is more suitable for development and testing. It does not compile a binary into your $GOPATH. If you want to compile a binary instead, refer the Developer Documentation.

Homebrew

If you installed Toolbox using Homebrew, the toolbox binary is available in your system path. You can start the server with the same command:

toolbox --tools-file "tools.yaml"
Gemini CLI

Interact with your custom tools using natural language. Check gemini-cli-extensions/mcp-toolbox for more information.

You can use toolbox help for a full list of flags! To stop the server, send a terminate signal (ctrl+c on most platforms).

For more detailed documentation on deploying to different environments, check out the resources in the How-to section

Integrating your application

Once your server is up and running, you can load the tools into your application. See below the list of Client SDKs for using various frameworks:

Python (Github)
Core
  1. Install Toolbox Core SDK:

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

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

LangChain / LangGraph
  1. Install Toolbox LangChain SDK:

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

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

LlamaIndex
  1. Install Toolbox Llamaindex SDK:

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

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

Javascript/Typescript (Github)
Core
  1. Install Toolbox Core SDK:

    npm install @toolbox-sdk/core
    
  2. 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');
    

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

LangChain / LangGraph
  1. Install Toolbox Core SDK:

    npm install @toolbox-sdk/core
    
  2. 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 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
  1. Install Toolbox Core SDK:

    npm install @toolbox-sdk/core
    
  2. Load tools:

    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);
    
Go (Github)
Core
  1. Install Toolbox Go SDK:

    go get github.com/googleapis/mcp-toolbox-sdk-go
    
  2. Load tools:

    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
  1. Install Toolbox Go SDK:

    go get github.com/googleapis/mcp-toolbox-sdk-go
    
  2. Load tools:

    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, &paramsSchema)
    
      // Use this tool with LangChainGo
      langChainTool := llms.Tool{
        Type: "function",
        Function: &llms.FunctionDefinition{
          Name:        tool.Name(),
          Description: tool.Description(),
          Parameters:  paramsSchema,
        },
      }
    }
    
    
Genkit
  1. Install Toolbox Go SDK:

    go get github.com/googleapis/mcp-toolbox-sdk-go
    
  2. Load tools:

    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
  1. Install Toolbox Go SDK:

    go get github.com/googleapis/mcp-toolbox-sdk-go
    
  2. Load tools:

    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
  1. Install Toolbox Go SDK:

    go get github.com/googleapis/mcp-toolbox-sdk-go
    
  2. Load tools:

    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, &paramsSchema)
    
      // Use this tool with OpenAI Go
      openAITool := openai.ChatCompletionToolParam{
        Function: openai.FunctionDefinitionParam{
          Name:        tool.Name(),
          Description: openai.String(tool.Description()),
          Parameters:  paramsSchema,
        },
      }
    
    }
    

Using Toolbox with Gemini CLI Extensions

Gemini CLI extensions provide tools to interact directly with your data sources from command line. Below is a list of Gemini CLI extensions that are built on top of Toolbox. They allow you to interact with your data sources through pre-defined or custom tools with natural language. Click into the link to see detailed instructions on their usage.

To use custom tools with Gemini CLI:

To use prebuilt tools with Gemini CLI:

Configuration

The primary way to configure Toolbox is through the tools.yaml file. If you have multiple files, you can tell toolbox which to load with the --tools-file tools.yaml flag.

You can find more detailed reference documentation to all resource types in the Resources.

Sources

The sources section of your tools.yaml defines what data sources your Toolbox should have access to. Most tools will have 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 more details on configuring different types of sources, see the Sources.

Tools

The tools section of a tools.yaml define the actions an agent can take: what kind of tool it is, which source(s) it affects, what parameters it uses, etc.

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 more details on configuring different types of tools, see the Tools.

Toolsets

The toolsets section of your tools.yaml allows you to define groups of tools that you want to be able to load together. This can be useful for defining different groups based on agent or application.

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:

# This will load all tools
all_tools = client.load_toolset()

# This will only load the tools listed in 'my_second_toolset'
my_second_toolset = client.load_toolset("my_second_toolset")

Versioning

This project uses semantic versioning (MAJOR.MINOR.PATCH). Since the project is in a pre-release stage (version 0.x.y), we follow the standard conventions for initial development:

Pre-1.0.0 Versioning

While the major version is 0, the public API should be considered unstable. The version will be incremented as follows:

  • 0.MINOR.PATCH: The MINOR version is incremented when we add new functionality or make breaking, incompatible API changes.
  • 0.MINOR.PATCH: The PATCH version is incremented for backward-compatible bug fixes.

Post-1.0.0 Versioning

Once the project reaches a stable 1.0.0 release, the versioning will follow the more common convention:

  • MAJOR.MINOR.PATCH: Incremented for incompatible API changes.
  • MAJOR.MINOR.PATCH: Incremented for new, backward-compatible functionality.
  • MAJOR.MINOR.PATCH: Incremented for backward-compatible bug fixes.

The public API that this applies to is the CLI associated with Toolbox, the interactions with official SDKs, and the definitions in the tools.yaml file.

Contributing

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

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!

Description
No description provided
Readme Apache-2.0 777 MiB
Latest
2025-07-02 11:30:33 -04:00
Languages
Go 97.5%
JavaScript 1.5%
Shell 0.4%
CSS 0.3%
HTML 0.2%