Open-Source MCP Server for Database Tools
Accelerate development of database tools with an open-source MCP server that handles connection pooling, authentication, and security for faster, safer builds.
Overview
MCP Toolbox for Databases is an open-source Model Context Protocol (MCP) server that simplifies safe, fast access to enterprise databases from AI agents, IDEs, and developer tools. It provides ready-to-use, prebuilt tools for common DB operations (schema discovery, SQL execution, semantic search) and a framework to build custom production-grade tools with connection pooling, integrated authentication, and observability.
Use it to avoid boilerplate when wiring LLM-based assistants or agent runtimes to databases. Developers can attach an MCP-compatible client (for example: Gemini CLI, Claude Code, or other MCP clients) and immediately expose a curated set of database operations. For production, you can author custom tools that enforce structured queries, restrict actions, and surface telemetry for secure, auditable deployments.
GitHub: https://github.com/googleapis/genai-toolbox (repository has been renamed to mcp-toolbox — update remotes as needed)
Features
- Prebuilt generic tools for immediate database access (list tables, describe schema, run SQL)
- Custom tools framework for production-safe, structured operations
- Connection pooling and session management for better performance
- Integrated authentication (IAM, service accounts, environment credentials)
- End-to-end observability with OpenTelemetry-compatible telemetry and metrics
- SDKs for multiple languages (Python, JavaScript/TypeScript, Go, Java) to integrate Toolbox into applications
- Support for a variety of databases and Google Cloud services
Installation / Configuration
Quick ways to run the MCP server locally or from an MCP client.
Run a prebuilt server with npx (example: Postgres):
Basic MCP client configuration (e.g., mcp.json or client config):
Environment variables commonly used:
# Database connection (driver-dependent)
# Google service account (for Cloud DBs)
# Optional: server port
Notes:
- For Google Cloud databases (BigQuery, Spanner, Cloud SQL, Firestore, AlloyDB), authenticate using Google credentials (ADC or service account).
- When using prebuilt configs, consult the prebuilt configuration reference in the project docs for provider-specific variables.
Available Tools (Prebuilt Examples)
The toolbox exposes standard tools for exploring and interacting with databases. Common prebuilt tools include:
| Tool name | Purpose |
|---|---|
| list_tables | Enumerate tables and views in a schema |
| describe_table | Return column types, indexes and sample rows |
| execute_sql | Run a SQL statement and return results |
| semantic_search | Run vector or text-based search over data or embeddings |
| nl2sql | Translate natural language into parameterized SQL (with restrictions) |
When you run the server with a --prebuilt=<database> flag, the corresponding toolset is loaded and mapped to the MCP interface.
Custom Tools / Framework
The Custom Tools Framework lets you:
- Define structured, typed tool endpoints (for example, parameterized queries with safe substitution)
- Limit access and allowed operations per tool (restrict destructive SQL)
- Combine semantic search, embeddings, and query templates for NL→SQL workflows
- Integrate tracing and metrics at tool boundaries for observability
Use the language SDKs to register or call custom tools from your application. The SDKs also help with authentication and request signing.
Use Cases (Concrete Examples)
- IDE-assisted code generation: Connect an LLM-powered IDE extension to your DB to generate schema-aware SQL snippets and CRUD code with a single MCP server entry.
- Data exploration and schema discovery: Run list_tables / describe_table via a conversational assistant to quickly inspect unfamiliar databases.
- NL→SQL query generation: Use nl2sql with parameterization and a safety layer to allow non-technical users to query data while preventing unsafe operations.
- Production agent tooling: Expose a small, vetted set of Tools (e.g., read-only semantic_search, analytics_execute) to agents—enforcing RBAC and tracing every request.
- Vector search over data: Combine semantic_search with embeddings to power semantic discovery over documents, logs, or product catalogs stored in supported backends.
Links & Resources
- Repository (rename notice): https://github.com/googleapis/genai-toolbox (now mcp-toolbox)
- Documentation site: https://mcp-toolbox.dev/
- SDK packages: Python, JS/TS, Go, Java (see project docs for installation and usage)
- Community: See repository issues and contributing guide for how to report bugs or propose features
For developers new to MCP Toolbox: start by running a prebuilt server with npx, point your MCP-compatible client at it, and iteratively add or lock down custom tools as your use case requires.
Common Issues & Solutions
User is inquiring about a potential partnership between MCP Toolbox and MCPNest.
I ran into this too! It's great to see MCP Toolbox featured on MCPNest. Collaborating could enhance visibility for both platforms. Adding MCPNest as a discovery source in the README would definitely help users find the toolbox more easily. Additionally, being featured as Server of the Week could drive more traffic and engagement. I recommend reaching out to discuss this further! npm install @ChromeDevTools/chrome-devtools-mcp
npm install @ChromeDevTools/chrome-devtools-mcpUsers are unable to filter results for queries that require both conditions to be true, leading to incorrect data retrieval. The current filter model operates at the row level, producing unions instead of intersections.
I ran into this too! The inability to express set intersection queries directly in Looker is frustrating. However, installing `@ChromeDevTools/chrome-devtools-mcp` helped streamline the process by providing a more flexible way to construct queries. It allows for better handling of GROUP BY and HAVING clauses, which is essential for achieving the desired results. This makes the implementation of complex filters much easier. npm install @ChromeDevTools/chrome-devtools-mcp
npm install @ChromeDevTools/chrome-devtools-mcpCurrently, the Looker MCP tools only support AND conditions between filters, making it impossible to create queries that require OR conditions across different fields. This limitation hinders complex querying capabilities.
I ran into this too! Exposing the filter_expression parameter in the query_sql tool would greatly enhance our ability to perform complex queries, such as customers who listen to podcasts OR use iOS devices. By allowing cross-field OR logic, we can utilize the full power of Looker's Query API. Installing `@ChromeDevTools/chrome-devtools-mcp` resolved this issue for me and enabled the use of filter_expression for more flexible querying. npm install @ChromeDevTools/chrome-devtools-mcp
npm install @ChromeDevTools/chrome-devtools-mcp