Google MCP Toolbox MCP Server
Official Google open-source MCP server that connects AI agents to enterprise databases including AlloyDB, BigQuery, Cloud SQL, Spanner, Firestore, and Bigtable.
MCP Toolbox for Databases (formerly genai-toolbox) is an open source Model Context Protocol server maintained by Google under the googleapis GitHub org. It bridges AI agents, IDEs, and applications to enterprise databases, exposing both ready-to-use prebuilt tools for schema exploration and SQL execution, and a framework for defining custom, structured tools via a tools.yaml config file.
The toolbox ships with prebuilt configurations for a wide range of databases. Google Cloud sources include AlloyDB, BigQuery, Cloud SQL (PostgreSQL, MySQL, SQL Server), Spanner (GoogleSQL and PostgreSQL dialects), Firestore, Bigtable, and Knowledge Catalog. It also supports standalone PostgreSQL, MySQL, SQL Server, SQLite, Oracle, MongoDB, Redis, Elasticsearch, Neo4j, Snowflake, ClickHouse, Couchbase, CockroachDB, TiDB, OceanBase, and Trino. Beyond raw database access, prebuilt configs are available for Looker, Cloud Storage, Cloud Monitoring, Cloud Logging, Dataproc, Serverless Spark, and Gemini Data Analytics.
Notable platform features include connection pooling, integrated IAM authentication, OpenTelemetry-based observability, dynamic tool reloading during development, and an interactive --ui mode for testing tools. SDKs are published for Python, JavaScript/TypeScript, Go, and Java, with native integrations for LangChain, LlamaIndex, Genkit, and Google's Agent Development Kit (ADK).
Tools
| Tool | Description |
|---|---|
execute_sql |
Run an ad-hoc SQL query against the configured database source. Available as a prebuilt tool for relational sources like PostgreSQL, MySQL, BigQuery, Cloud SQL, AlloyDB, Spanner, etc. |
list_tables |
Browse the schema of the connected database and list available tables. |
get_table_info |
Return column names, types, and metadata for a given table. |
Custom tools (tools.yaml) |
User-defined tools declared in tools.yaml with named parameters, parameterized SQL statements, descriptions, and a typed source. Supports structured queries and semantic search. |
Prebuilt source configs |
Selectable via the --prebuilt=<source> flag. Includes postgres, mysql, bigquery, alloydb, cloud-sql-pg, cloud-sql-mysql, cloud-sql-mssql, spanner, firestore, bigtable, sqlite, mongodb, neo4j, looker, and more. |
Prerequisites
- Credentials for the database you want to expose (connection string, service account, or IAM principal).
- One of:
npx, Docker, Homebrew, a downloaded binary, or Go installed locally.
Option A: Run with npx (quickest)
Add the server to your MCP client config (Claude Desktop, Cursor, Gemini CLI, etc.):
{
"mcpServers": {
"toolbox-postgres": {
"command": "npx",
"args": [
"-y",
"@toolbox-sdk/server",
"--prebuilt=postgres",
"--stdio"
],
"env": {
"POSTGRES_HOST": "127.0.0.1",
"POSTGRES_PORT": "5432",
"POSTGRES_DATABASE": "my_db",
"POSTGRES_USER": "my_user",
"POSTGRES_PASSWORD": "my_password"
}
}
}
}
Swap --prebuilt=postgres for bigquery, alloydb, cloud-sql-pg, cloud-sql-mysql, spanner, firestore, bigtable, mysql, etc.
Option B: Install the binary
# Homebrew
brew install mcp-toolbox
# Or via Go
go install github.com/googleapis/mcp-toolbox@latest
# Or via Docker
docker pull us-central1-docker.pkg.dev/database-toolbox/toolbox/toolbox:latest
Run with a custom tools.yaml:
mcp-toolbox --tools-file tools.yaml --port 5000
Then point your MCP client at the HTTP endpoint:
{
"mcpServers": {
"toolbox": {
"type": "http",
"url": "http://127.0.0.1:5000/mcp"
}
}
}
Example tools.yaml
sources:
my-pg-source:
kind: postgres
host: 127.0.0.1
port: 5432
database: toolbox_db
user: toolbox_user
password: ${POSTGRES_PASSWORD}
tools:
search-hotels-by-name:
kind: postgres-sql
source: my-pg-source
description: Search hotels by name.
parameters:
- name: name
type: string
description: Hotel name to search for
statement: SELECT * FROM hotels WHERE name ILIKE '%' || $1 || '%';
- Expose a read-only BigQuery or Cloud SQL instance to Claude Code or Gemini CLI so an engineer can ask natural language questions about production data without writing SQL by hand.
- Give an agent secure, parameterized access to specific queries (e.g.
search-orders-by-customer) usingtools.yamlinstead of granting raw SQL execution. - Let a Firestore-backed product assistant fetch documents and run schema introspection during conversations.
- Run a centralized Toolbox HTTP server inside a VPC so multiple ADK or LangChain agents share connection pooling and IAM auth against AlloyDB or Spanner.
- Connect an LLM-based BI assistant to Looker or Gemini Data Analytics for conversational reporting via the prebuilt config.
- "List all tables in my BigQuery
analyticsdataset and show me the row count for each." - "Using the Cloud SQL Postgres source, find the top 10 customers by revenue last quarter."
- "Run
list_tablesthen describe the schema of theorderstable in Spanner." - "Call the
search-hotels-by-nametool with name='Marriott' and summarize the results." - "Query Firestore for all documents in the
userscollection wheresignup_source = 'paid'."
- Officially maintained by Google under the
googleapisorg, with active releases and first-class support for Google Cloud databases. - Broad database coverage: AlloyDB, BigQuery, Cloud SQL, Spanner, Firestore, Bigtable, plus Postgres, MySQL, MongoDB, Neo4j, Snowflake, and others.
- Production-oriented: connection pooling, IAM/auth integration, OpenTelemetry observability, and an HTTP transport for shared multi-agent deployments.
- Custom
tools.yamllets teams expose narrowly scoped, parameterized queries instead of raw SQL, which is safer than generic execute_sql for production agents.
- The
tools.yamlconfiguration model has a learning curve compared to drop-in MCP servers that need no config. - Prebuilt generic tools like
execute_sqlgive agents broad access; locking things down requires writing custom tools or running read-only credentials. - Some advanced features (semantic search, ADK integrations) require additional SDKs or Google Cloud services to be useful.
- Supabase MCP Server for Postgres-backed Supabase projects.
- PostgreSQL MCP server from the official
modelcontextprotocol/serversrepo for simple read-only Postgres access. - MongoDB MCP Server for MongoDB-specific workflows.