Labsco
googleapis logo

Query Streams MCP

βœ“ Official

from googleapis

Query Streams securely connects MCP clients to live databases through the Query Streams Cloud Network, with no VPNs, inbound ports, or complex setup.

πŸ”₯πŸ”₯FreeQuick setup
<div align="center">

logo

MCP Toolbox for Databases

<a href="https://trendshift.io/repositories/25495" target="_blank"><img src="https://trendshift.io/api/badge/repositories/25495" alt="googleapis%2Fmcp-toolbox | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>

Go Report Card License: Apache
2.0 Docs Discord Medium

Python SDK JS/TS SDK Go SDK Java SDK

</div>

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.

<p align="center"> <img src="docs/en/documentation/introduction/architecture.png" alt="architecture" width="50%"/> </p>

It serves a dual purpose:

  1. 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.
  2. 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.

<!-- TOC ignore:true -->

Table of Contents


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:

<details open> <summary>Python (<a href="https://github.com/googleapis/mcp-toolbox-sdk-python">Github</a>)</summary> <br> <blockquote> <details open> <summary>Core</summary>
  1. Install Toolbox Core SDK:

    Copy & paste β€” that's it
    pip install toolbox-core
  2. 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.

</details> <details> <summary>LangChain / LangGraph</summary>
  1. Install Toolbox LangChain SDK:

    Copy & paste β€” that's it
    pip install toolbox-langchain
  2. 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.

</details> <details> <summary>LlamaIndex</summary>
  1. Install Toolbox Llamaindex SDK:

    Copy & paste β€” that's it
    pip install toolbox-llamaindex
  2. 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.

</details> </details> </blockquote> <details> <summary>Javascript/Typescript (<a href="https://github.com/googleapis/mcp-toolbox-sdk-js">Github</a>)</summary> <br> <blockquote> <details open> <summary>Core</summary>
  1. Install Toolbox Core SDK:

    Copy & paste β€” that's it
    npm install @toolbox-sdk/core
  2. 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.

</details> <details> <summary>LangChain / LangGraph</summary>
  1. Install Toolbox Core SDK:

    Copy & paste β€” that's it
    npm install @toolbox-sdk/core
  2. 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);
</details> <details> <summary>Genkit</summary>
  1. Install Toolbox Core SDK:

    Copy & paste β€” that's it
    npm install @toolbox-sdk/core
  2. 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);
</details> <details> <summary>ADK</summary>
  1. Install Toolbox ADK SDK:

    Copy & paste β€” that's it
    npm install @toolbox-sdk/adk
  2. 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.

</details> </details> </blockquote> <details> <summary>Go (<a href="https://github.com/googleapis/mcp-toolbox-sdk-go">Github</a>)</summary> <br> <blockquote> <details> <summary>Core</summary>
  1. Install Toolbox Go SDK:

    Copy & paste β€” that's it
    go get github.com/googleapis/mcp-toolbox-sdk-go
  2. 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.

</details> <details> <summary>LangChain Go</summary>
  1. Install Toolbox Go SDK:

    Copy & paste β€” that's it
    go get github.com/googleapis/mcp-toolbox-sdk-go
  2. 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, &paramsSchema)
    
      // Use this tool with LangChainGo
      langChainTool := llms.Tool{
        Type: "function",
        Function: &llms.FunctionDefinition{
          Name:        tool.Name(),
          Description: tool.Description(),
          Parameters:  paramsSchema,
        },
      }
    }
    
</details> <details> <summary>Genkit</summary>
  1. Install Toolbox Go SDK:

    Copy & paste β€” that's it
    go get github.com/googleapis/mcp-toolbox-sdk-go
  2. 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())
    }
</details> <details> <summary>Go GenAI</summary>
  1. Install Toolbox Go SDK:

    Copy & paste β€” that's it
    go get github.com/googleapis/mcp-toolbox-sdk-go
  2. 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},
      }
    }
</details> <details> <summary>OpenAI Go</summary>
  1. Install Toolbox Go SDK:

    Copy & paste β€” that's it
    go get github.com/googleapis/mcp-toolbox-sdk-go
  2. 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, &paramsSchema)
    
      // Use this tool with OpenAI Go
      openAITool := openai.ChatCompletionToolParam{
        Function: openai.FunctionDefinitionParam{
          Name:        tool.Name(),
          Description: openai.String(tool.Description()),
          Parameters:  paramsSchema,
        },
      }
    
    }
</details> <details open> <summary>ADK Go</summary>
  1. Install Toolbox Go SDK:

    Copy & paste β€” that's it
    go get github.com/googleapis/mcp-toolbox-sdk-go
  2. 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.

</details> </details> </blockquote> </details>

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!