BigQuery MCP server

BigQuery MCP server

提供访问BigQuery的模型上下文协议服务器。

简介

BigQuery MCP 服务器让大语言模型能够访问 BigQuery 数据库,检查数据库模式并执行查询。

smithery 徽章

功能

服务器提供三个主要工具:

  • execute-query:执行 SQL 查询
  • list-tables:列出数据库中的所有表
  • describe-table:查看特定表的结构

安装选项

通过 Smithery 自动安装(推荐)

npx -y @smithery/cli install mcp-server-bigquery --client claude

手动安装

  1. 安装包:

    pip install mcp-server-bigquery
    # 或
    uvx mcp-server-bigquery
    
  2. 配置 Claude Desktop:

    在配置文件中添加以下内容(根据您的操作系统选择路径):

    • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%/Claude/claude_desktop_config.json
    "mcpServers": {
      "bigquery": {
        "command": "uvx",
        "args": [
          "mcp-server-bigquery",
          "--project",
          "YOUR_GCP_PROJECT_ID",
          "--location",
          "YOUR_GCP_LOCATION"
        ]
      }
    }
    

配置参数

  • --project:必需,GCP 项目 ID
  • --location:必需,GCP 位置(例如 europe-west9
  • --dataset:可选,指定要访问的数据集(可重复使用来指定多个数据集)

调试

使用 MCP Inspector 进行调试:

npx @modelcontextprotocol/inspector uv run mcp-server-bigquery

更多信息

查看完整文档:Smithery BigQuery MCP服务器