Skip to main content
Glama
@qybbs/custom-bigquery-mcp

@qybbs/custom-bigquery-mcp

@qybbs/custom-bigquery-mcp

A standalone Model Context Protocol (MCP) server for Google Cloud BigQuery with enterprise FinOps guardrails, query cost estimation, and strict table allowlisting.

Quick Start via GitHub (Zero Installation)

You can run this MCP server directly without cloning or publishing to npm:

# Set your GCP credentials
export GCP_PROJECT_ID="your-project-id"
export ALLOWLIST_TABLES="project.dataset.table1,dataset.table2"

# Run directly via GitHub using npx
npx -y github:qybbs/custom-bigquery-mcp

Integration with saas-to-mcp-gateway

Add to your gateway-mcp-config.json:

"bigquery": {
  "type": "stdio",
  "command": "npx",
  "args": ["-y", "github:qybbs/custom-bigquery-mcp"],
  "env": {
    "GCP_PROJECT_ID": "${GCP_PROJECT_ID}",
    "GCP_KEY_FILE_PATH": "${GCP_KEY_FILE_PATH}",
    "ALLOWLIST_TABLES": "${ALLOWLIST_TABLES}",
    "MAX_BYTES_BILLED": "${MAX_BYTES_BILLED}",
    "ROW_LIMIT": "${ROW_LIMIT}"
  }
}

Integration with Claude Desktop / Cursor MCP

{
  "mcpServers": {
    "bigquery": {
      "command": "npx",
      "args": ["-y", "github:qybbs/custom-bigquery-mcp"],
      "env": {
        "GCP_PROJECT_ID": "your-project-id",
        "ALLOWLIST_TABLES": "dataset.table1"
      }
    }
  }
}

Related MCP server: BigQuery MCP Server

Features

  • Strict FinOps Guardrails: Enforces query dry-runs, comment stripping, SQL AST validation, and blocks mutative keywords (INSERT, UPDATE, DELETE, DROP, ALTER).

  • Table Allowlisting: Restricts queries strictly to tables explicitly listed in ALLOWLIST_TABLES.

  • Dual Authentication: Supports Google Cloud Application Default Credentials (ADC) or Service Account Key file.

  • Cross-Project Access: Automatically configures userProject so queries and metadata extraction across different GCP projects (e.g. shared VPC datasets) are billed to your designated execution project.

  • Cost Protection: Hard query caps (MAX_BYTES_BILLED) and client-side retrieval limits (ROW_LIMIT).

Tools Exposed

  1. list_allowed_tables: List all BigQuery tables allowed for query execution.

  2. describe_table: Get detailed schema, field descriptions, clustering, and partitioning info.

  3. estimate_query_cost: Perform dry-run calculation returning scanned bytes and estimated USD cost.

  4. execute_readonly_query: Execute read-only SQL queries against allowed tables.

  5. search_allowed_tables: Search allowed tables and schemas by keyword.

Environment Configuration

Configure via .env or pass via MCP driver env:

GCP_PROJECT_ID=your-billing-project-id
# GCP_KEY_FILE_PATH=./google-service-account.json (leave commented to use ADC)
ALLOWLIST_TABLES=project.dataset.table1,dataset.table2
MAX_BYTES_BILLED=10737418240
ROW_LIMIT=1000

Local Development & Testing

# Install dependencies
npm install

# Build
npm run build

# Run unit tests
npm test

# Dry-run pack
npm run pack:dry

# Start stdio server locally
npm start

License

MIT License

Available Tools

5 tools
describe_tableB

Get detailed schema, column descriptions, and partitioning information for an allowed BigQuery table.

Inputs: tableId (required), datasetId (required).

estimate_query_costA

Estimate bytes scanned and projected cost in USD for a read-only SQL query without executing it.

Inputs: sql (required).

execute_readonly_queryB

Execute a read-only BigQuery SQL query against allowed tables.

Inputs: sql (required).

list_allowed_tablesB

List all BigQuery tables allowed for query execution.

Inputs: no named parameters.

search_allowed_tablesA

Search allowed tables and their schemas by a keyword (e.g., 'transaction', 'customer'). Returns table description, partitioning columns, clustering columns, and field schemas in one call.

Inputs: keyword (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 5 tools

    Disambiguation4/5

    The five tools have largely distinct roles: listing, searching, describing, estimating, and executing. However, search_allowed_tables returns schema and partitioning details that overlap with describe_table, and list_allowed_tables overlaps with search_allowed_tables for table discovery. Descriptions clarify the differences, so confusion is limited.

    Naming Consistency5/5

    All tool names follow a consistent snake_case verb_noun pattern (list_allowed_tables, describe_table, estimate_query_cost, execute_readonly_query, search_allowed_tables). Minor modifiers like 'allowed' and 'readonly' are used consistently and do not break the pattern.

    Tool Count5/5

    Five tools are well-scoped for a read-only BigQuery querying server, covering discovery, schema inspection, cost estimation, and execution. No tool feels redundant or missing, making the count appropriate.

    Completeness5/5

    The surface covers the full read-only query lifecycle: discovering allowed tables (list/search), understanding their schemas (describe), estimating cost, and executing queries. No obvious gaps exist for the stated purpose, though bulk schema retrieval could be slightly more efficient.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables LLMs to explore BigQuery datasets and tables, run safe read-only queries, and optionally perform vector search using BigQuery embeddings.
      109 PyPI
      10
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables read-only interaction with Google BigQuery, including SQL queries, dataset/table listing, schema retrieval, table preview, and metadata access via service account authentication.
      -
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables secure read-only interaction with Google BigQuery through natural language, including listing datasets, listing tables, retrieving metadata, and executing queries with cost controls.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables read-only access to Google BigQuery, allowing users to list tables, inspect metadata, and run SELECT queries with enforced row and byte limits.
      Apache 2.0