Skip to main content
Glama
BigQuery Analysis MCP Server

BigQuery Analysis MCP Server

by gotalab

BigQuery Analysis MCP Server

Overview

This server is an MCP server for executing SQL queries against Google BigQuery, providing the following features:

  • Query validation (dry run): Verifies if a query is valid and estimates its processing size

  • Safe query execution: Only runs SELECT queries under 1TB (prevents data modifications)

  • JSON-formatted results: Returns query results in structured JSON format

Related MCP server: BigQuery Validator

Features

도구

  • dry_run_query - Perform a dry run of a BigQuery query

    • Validates the query and estimates its processing size

    • Checks query size against the 1TB limit

  • run_query_with_validation - Run a BigQuery query with validation

    • Detects and rejects DML statements (data modification queries)

    • Rejects data processing over 1TB

    • Executes queries that pass validation and returns results

개발

Prerequisites

  • Node.js (v16 or higher)

  • Google Cloud authentication setup (gcloud CLI or service account)

Install Dependencies

npm install

빌드

npm run build

Development Mode (Auto-rebuild)

npm run watch

Installation

To use with Claude Desktop, add the server configuration:

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"
    }
  }
}

디버깅

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector :

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

Authentication Setup

This server uses Google Cloud authentication. Set up authentication using one of the following methods:

  1. Login with gcloud CLI:

    gcloud auth application-default login
  2. Use a service account key:

    export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"

Usage Examples

  1. Dry run a query:

    dry_run_query("SELECT * FROM `bigquery-public-data.samples.shakespeare` LIMIT 10")
  2. Run a query with validation:

    run_query_with_validation("SELECT word, word_count FROM `bigquery-public-data.samples.shakespeare` WHERE corpus='hamlet' LIMIT 10")

BigQuery Analysis MCP Server(일본어 버전)

개요

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")

Available Tools

2 tools
dry_run_queryB

Perform a dry run of a BigQuery query to check if it's valid and estimate its size

Inputs: query (required), projectId.

run_query_with_validationB

Run a BigQuery query with dry run validation (fails if query exceeds 1 TB or contains DML statements)

Inputs: query (required), projectId, maxResults.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 2 tools

    Disambiguation4/5

    The two tools have mostly distinct roles: one validates only, the other executes with built-in validation. There is mild overlap since run_query_with_validation internally performs a dry run, so an agent might briefly hesitate, but the outcome differences (no execution vs. execution) make the choice clear.

    Naming Consistency4/5

    Both names use snake_case and start with an action verb, which is consistent. However, 'dry_run_query' is a compact noun-style phrase while 'run_query_with_validation' is a longer descriptive phrase, a minor stylistic deviation.

    Tool Count3/5

    Two tools is thin for a server framed as 'BigQuery Analysis' — analysis usually implies exploration beyond validate/execute. The pair is coherent but leaves the surface feeling minimal.

    Completeness2/5

    There is no way to discover datasets, tables, or schemas, and no tool to run queries that legitimately contain DML or exceed 1 TB. Agents doing real analysis will hit dead ends when they need metadata or unrestricted execution.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A server that connects to PostgreSQL databases and provides tools for safely exploring schemas, running read-only SQL queries, and performing data analysis with pre-built templates.
      6
      1
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Enables validation and dry-run analysis of BigQuery SQL queries without execution. Provides cost estimates, schema previews, and syntax validation for BigQuery queries.
      9
      21 PyPI
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      A read-only BigQuery MCP server with auto-LIMIT injection, dry-run cost guard, and ADC authentication. Allows safe SQL querying of BigQuery by LLMs without risk of data modification or unexpected costs.
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for secure BigQuery access across multiple Google Cloud projects, enabling querying, schema exploration, and data analysis with SQL validation and read-only controls.
      2
      MIT