Back to MCP Servers
MCP数据库工具箱 logo
mcp-server311

MCP数据库工具箱

谷歌官方开源的MCP服务器,通过简单的声明式配置,安全地将AI助手、IDE和应用程序连接到企业级数据库,包括BigQuery、Cloud SQL、AlloyDB、Spanner、PostgreSQL等众多数据库。

概述

MCP 数据库工具箱(代码仓库:googleapis/mcp-toolbox)是谷歌开源的专为数据库设计的模型上下文协议 (MCP) 服务器。它允许 AI 智能体、IDE 和应用程序通过自然语言和结构化工具,直接且安全地与企业数据源交互——在大多数场景下无需编写自定义集成代码。

它原名 Gen AI Toolbox,后更名为 MCP 工具箱,以更好地体现其与 MCP 生态系统的深度集成。工具在 tools.yaml 文件中以声明式定义,服务器负责处理连接管理、身份验证、查询执行和安全性。

核心特性

. 广泛的数据库支持:原生集成 Google Cloud 服务(BigQuery、适用于 PostgreSQL/MySQL/SQL Server 的 Cloud SQL、AlloyDB、Spanner、Firestore)以及众多第三方数据源,包括 PostgreSQL、MySQL、Oracle、MongoDB、Redis、Elasticsearch、Snowflake、Neo4j、Trino 等。 . 预置通用工具:开箱即用的工具,如 list_tablesexecute_sql、模式探索和数据查询,可立即使用。 . 自定义工具框架:通过配置定义结构化查询、语义搜索、自然语言转 SQL 和特定领域工具。 . 企业级安全性:基于 IAM 的身份验证、受限访问、参数化查询和最小权限执行。 . 可观测性:内置 OpenTelemetry 支持,用于指标监控和链路追踪。 . 动态重载与工具集:无需重启服务器即可更新工具;将工具分组为模块化工具集。 . 交互式界面:内置 Web UI 用于测试工具(通过 --ui 标志启用)。 . SDK 生态系统:提供适用于 Python、JavaScript/TypeScript、Java 和 Go 的官方客户端 SDK,便于将工具箱工具集成到 LangChain、LlamaIndex、Genkit 等智能体框架中。 . 智能体技能生成:将工具集转换为可移植的智能体技能。

工作原理

  1. tools.yaml 中配置数据源和工具(源、工具、工具集、提示词)。
  2. 启动 MCP 工具箱服务器(二进制文件、Docker 或云部署)。它会暴露一个 MCP 端点(默认:http://127.0.0.1:5000/mcp )。
  3. MCP 客户端(如 Gemini CLI、Claude Code、Cursor 等)发现并调用这些工具。
  4. 服务器使用适当的身份验证和连接池对数据库执行操作,并将结构化结果返回给智能体。

支持基于 HTTP 的 MCP 连接和预置工具配置,便于快速搭建。

使用场景

  • 自然语言数据查询:AI助手使用通俗英语查询和分析实时数据。

  • 模式感知开发:集成开发环境和智能代理探索数据模式并生成精准的数据库代码。

  • 安全的企业级AI代理:构建能在受控访问下与敏感数据交互的生产级代理。

  • 自动化代码与查询生成:生成匹配实际数据模式的SQL、迁移脚本或应用逻辑。 . This section in the original text is intentionally left blank as per the instruction to preserve exact formatting. However, note that a dangling line "- " would be invalid Markdown syntax. The assistant kept it as-is to strictly follow "preserve all Markdown formatting". In practice, this might need correction if the original had a typo.

  • 数据探索与分析:结合大型语言模型获取数据洞察、生成报告或调试数据问题。

  • 多数据库工作流:通过单一MCP服务器统一访问异构数据源。

快速开始

安装选项

  • 二进制文件:从GitHub或Google Cloud Storage下载最新版本。
  • Homebrewbrew install mcp-toolbox
  • Docker:从us-central1-docker.pkg.dev/database-toolbox/toolbox/toolbox拉取镜像
  • Gogo install github.com/googleapis/mcp-toolbox@latest
  • 通过npx预构建版本:针对特定数据库的快速设置方案

运行命令:

./toolbox --config tools.yaml

添加到MCP客户端配置(HTTP模式或预构建版本示例):

{
  "mcpServers": {
    "toolbox": {
      "type": "http",
      "url": "http://127.0.0.1:5000/mcp"
    }
  }
}

完整文档:https://mcp-toolbox.dev/

核心优势

MCP Toolbox显著降低了构建数据感知型AI代理的技术门槛,同时满足企业级安全、可扩展性和可观测性要求。该工具已具备生产就绪状态(v1.0.0版本于2026年4月发布),由Google积极维护,并可作为安全MCP数据库集成的参考实现方案。

凭借对数十种数据源的支持和丰富的SDK生态系统,它使开发者能够创建基于真实企业数据运行的强大、可靠的智能代理应用程序。

Tags

mcpgoogle数据库bigquerycloud-sqlspanneralloydbai助手企业级sqlnl2sql可观测性

Related Entries

Keep exploring similar tools and resources in this category.

Browse MCP Servers
TinyFish logo

TinyFish

MCP Servers

TinyFish 为兼容 MCP 的 AI 助手提供网络自动化、网络搜索、内容提取和远程浏览器会话工具。托管的 MCP 服务器使用 OAuth 2.1,而可选的本地 @tiny-fish/mcp 代理支持仅本地、CI 和无头环境下的 API 密钥认证。

X MCP logo

X MCP

MCP Servers

X MCP 是 X 官方托管的 Model Context Protocol 服务器,可让兼容 MCP 的 AI 工具调用 X API 端点。它通过 xurl 桥接 OAuth 用户上下文,支持帖子搜索、用户查询、书签、趋势、新闻和 Articles 等工作流。

TinyFish logo

TinyFish

MCP Servers

TinyFish exposes web automation, web search, content extraction, and remote browser-session tools to MCP-compatible AI assistants. The hosted MCP server uses OAuth 2.1, while an optional local @tiny-fish/mcp proxy supports API-key authentication for local-only, CI, and headless setups.

openaiDeveloperDocs logo

openaiDeveloperDocs

MCP Servers

OpenAI Developer Docs MCP is an OpenAI-hosted, read-only server that lets MCP clients search and fetch documentation from developers.openai.com, platform.openai.com, and learn.chatgpt.com. It uses a public streamable HTTP endpoint and does not call the OpenAI API on the user's behalf.

FetchSandbox logo

FetchSandbox

MCP Servers

FetchSandbox is a stdio MCP server and hosted API-sandbox service that lets AI coding agents import OpenAPI 3.x specifications, discover runnable workflows, and execute stateful integration tests without using production API credentials. It is designed for validating request flows, lifecycle state, webhooks, retries, and shareable run traces from MCP-compatible development tools.

DataForSEO MCP Server logo

DataForSEO MCP Server

MCP Servers

DataForSEO MCP Server is the official Model Context Protocol server for connecting AI clients to DataForSEO SEO, SERP, keyword, backlink, on-page, business, domain, content, merchant, and AI optimization data. It can be used as a hosted Streamable HTTP endpoint, a local npx package, a Docker container, or a source-built TypeScript server.