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

Features

Tools

  • 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

Development

Prerequisites

  • Node.js (v16 or higher)
  • Google Cloud authentication setup (gcloud CLI or service account)

Install Dependencies

npm install

Build

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

Debugging

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

overview

This is an MCP server for executing SQL queries in BigQuery. It validates (dry runs) and executes queries, and has safety features that prevent data processing and modification queries (DML) of more than 1TB.

function

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

  • Query validation (dry run): Check if the query is valid and estimate the processing size
  • Safe query execution: Only execute SELECT queries of 1TB or less (prevent data modification)
  • Return results in JSON format: Return query results in structured JSON.

function

tool

  • dry_run_query - Execute a dry run of a BigQuery query
    • Validate queries and estimate processing size
    • Check query size against 1TB limit
  • run_query_with_validation - Run a BigQuery query with validation
    • Detect and reject DML statements (data modification queries)
    • Refuse to process data over 1TB
    • Executes queries that pass validation and returns the results

Development method

Prerequisites

  • Node.js (v16 and above)
  • Google Cloud authentication settings (gcloud CLI or service account)

Installing dependencies

npm install

Build

npm run build

Development mode (auto-rebuild)

npm run watch

install

To use it with Claude Desktop, add your server configuration:

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

debug

MCP servers can be difficult to debug because they communicate via standard input/output (stdio). We recommend using MCP Inspector :

npm run inspector

Inspector provides a URL to access the debugging tools in your browser.

Authentication Settings

This server uses Google Cloud credentials, please set up authentication in one of the following ways:

  1. Log in 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 Example

  1. Dry run the query:
    dry_run_query("SELECT * FROM `bigquery-public-data.samples.shakespeare` LIMIT 10")
  2. Query execution with validation:
    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

A server that enables executing and validating SQL queries against Google BigQuery with safety features that prevent data modifications and excessive processing.

  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