BigQuery Analysis MCP Server

by gotalab

Integrations

  • Enables execution of SQL queries against Google BigQuery with safety features including query validation, size estimation, rejection of data modification queries, and prevention of large data processing over 1TB.

  • Uses Google Cloud authentication for secure access to BigQuery services, supporting both gcloud CLI login and service account key methods.

BigQuery 分析 MCP 服务器

概述

该服务器是针对 Google BigQuery 执行 SQL 查询的 MCP 服务器,提供以下功能:

  • 查询验证(试运行):验证查询是否有效并估计其处理大小
  • 安全查询执行:仅运行 1TB 以下的 SELECT 查询(防止数据修改)
  • JSON格式的结果:以结构化的JSON格式返回查询结果

特征

工具

  • dry_run_query - 执行 BigQuery 查询的试运行
    • 验证查询并估计其处理大小
    • 检查查询大小是否符合 1TB 的限制
  • run_query_with_validation - 运行带有验证的 BigQuery 查询
    • 检测并拒绝 DML 语句(数据修改查询)
    • 拒绝处理超过 1TB 的数据
    • 执行通过验证的查询并返回结果

发展

先决条件

  • Node.js(v16 或更高版本)
  • Google Cloud 身份验证设置(gcloud CLI 或服务帐户)

安装依赖项

npm install

建造

npm run build

开发模式(自动重建)

npm run watch

安装

要与 Claude Desktop 一起使用,请添加服务器配置:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

{ "mcpServers": { "bigquery-analysis-server": { "command": "/path/to/bigquery-analysis-server/build/index.js" } } }

调试

由于 MCP 服务器通过 stdio 进行通信,因此调试可能具有挑战性。我们建议使用MCP 检查器

npm run inspector

检查器将提供一个 URL 来访问浏览器中的调试工具。

身份验证设置

该服务器使用 Google Cloud 身份验证。使用以下方法之一设置身份验证:

  1. 使用 gcloud CLI 登录:
    gcloud auth application-default login
  2. 使用服务帐户密钥:
    export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"

使用示例

  1. 试运行查询:
    dry_run_query("SELECT * FROM `bigquery-public-data.samples.shakespeare` LIMIT 10")
  2. 运行带有验证的查询:
    run_query_with_validation("SELECT word, word_count FROM `bigquery-public-data.samples.shakespeare` WHERE corpus='hamlet' LIMIT 10")

BigQuery 分析 MCP 服务器

概述

用于在 BigQuery 上执行 SQL 查询的 MCP 服务器。它验证(试运行)并执行查询,并具有防止超过 1TB 的数据处理和修改查询(DML)的安全功能。

功能

该服务器是针对 Google BigQuery 执行 SQL 查询的 MCP 服务器,并提供以下功能:

  • 查询验证(试运行):检查查询是否有效并估计处理大小
  • 安全查询执行:仅执行 1TB 或更少的 SELECT 查询(防止数据修改)
  • JSON格式返回结果:以结构化的JSON形式返回查询结果。

功能

工具

  • dry_run_query - 执行 BigQuery 查询的试运行
    • 验证查询并估计处理大小
    • 检查查询大小是否符合 1TB 的限制
  • run_query_with_validation - 运行带有验证的 BigQuery 查询
    • 检测并拒绝 DML 语句(数据修改查询)
    • 拒绝处理超过 1TB 的数据
    • 执行通过验证的查询并返回结果

开发方法

先决条件

  • Node.js(v16 及以上版本)
  • Google Cloud 身份验证设置(gcloud CLI 或服务帐户)

安装依赖项

npm install

建造

npm run build

开发模式(自动重建)

npm run watch

安装

要与 Claude Desktop 一起使用,请添加您的服务器配置:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

{ "mcpServers": { "bigquery": { "command": "node", "args": ["/path/to/bigquery-server/build/index.js"] } } }

调试

MCP 服务器通过标准输入/输出 (stdio) 进行通信,因此调试起来比较困难。我们建议使用MCP Inspector

npm run inspector

Inspector 提供了一个 URL 来访问浏览器中的调试工具。

身份验证设置

该服务器使用 Google Cloud 凭证。请通过以下方式之一设置身份验证:

  1. 使用 gcloud CLI 登录:
    gcloud auth application-default login
  2. 使用服务帐户密钥:
    export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"

使用示例

  1. 试运行查询:
    dry_run_query("SELECT * FROM `bigquery-public-data.samples.shakespeare` LIMIT 10")
  2. 带验证的查询执行:
    run_query_with_validation("SELECT word, word_count FROM `bigquery-public-data.samples.shakespeare` WHERE corpus='hamlet' LIMIT 10")
-
security - not tested
F
license - not found
-
quality - not tested

该服务器支持针对 Google BigQuery 执行和验证 SQL 查询,并具有防止数据修改和过度处理的安全功能。

  1. Overview
    1. Features
      1. Tools
    2. Development
      1. Prerequisites
      2. Install Dependencies
      3. Build
      4. Development Mode (Auto-rebuild)
    3. Installation
      1. Debugging
    4. Authentication Setup
      1. Usage Examples
        1. BigQuery Analysis MCP Server (日本語版)
          1. 概要
          2. 機能
          3. 機能
          4. 開発方法
          5. インストール
          6. 認証設定
          7. 使用例

        Related MCP Servers

        • -
          security
          A
          license
          -
          quality
          A Model Context Protocol server that provides access to BigQuery. This server enables LLMs to inspect database schemas and execute queries.
          Last updated -
          63
          Python
          MIT License
          • Apple
        • -
          security
          A
          license
          -
          quality
          This is a server that lets your LLMs (like Claude) talk directly to your BigQuery data! Think of it as a friendly translator that sits between your AI assistant and your database, making sure they can chat securely and efficiently.
          Last updated -
          1
          215
          37
          JavaScript
          MIT License
        • -
          security
          A
          license
          -
          quality
          A Model Context Protocol server that enables LLMs to understand BigQuery dataset structures and execute SQL queries.
          Last updated -
          TypeScript
          MIT License
          • Apple
          • Linux
        • -
          security
          F
          license
          -
          quality
          A server that helps people access and query data in databases using the Query Runner with integration of the Model Context Protocol (MCP) Python SDK. Support databases including PostgreSQL Redshift MySQL Microsoft SQL Server Google APIs Amazon Web Services (via boto3) CockroachDB SQLite
          Last updated -
          6
          Python
          GPL 3.0
          • Linux
          • Apple

        View all related MCP servers

        ID: tdui7oig44