Skip to main content
Glama

🔎 bq-mcp

A read-only MCP server for BigQuery — schema, cost, and catalog tools for any AI assistant.

CI Read-only MCP

pip install, add one config line, and Claude Code / Claude Desktop / Cursor can browse your BigQuery schemas, estimate query cost, and list datasets/tables — natively, without you pasting DDL into chat.

Why

I built the pieces of this three times over — once embedded in sql-review-agent, once in Bank-Statement-Analyser. Each time it was locked to that one project. This pulls the tools out into a standalone package anyone can point at their own warehouse.

Related MCP server: Secure BigQuery MCP Gateway

Tools

Tool

What it does

dry_run(sql)

Estimate bytes scanned + cost without executing the query

get_table_metadata(dataset, table)

Schema, partition key, clustering, row count, size

list_tables(dataset)

All tables in a dataset

list_datasets()

All datasets in the project

Safety

  • dry_run never executes — BigQuery's dry-run mode only plans the query

  • Only SELECT/WITH statements are accepted; INSERT/UPDATE/DELETE/DROP/etc. are rejected before they ever reach BigQuery

  • Cost guardrail: if a dry-run estimates above BQ_MCP_MAX_COST_USD (default $5), the response includes an explicit warning instead of silently reporting a huge number

  • Metadata/listing tools only call BigQuery's catalog APIs — they cannot read table rows, only structure

Install

git clone https://github.com/ARAVINDHRAJA123/bq-mcp.git
cd bq-mcp
python3 -m venv venv && ./venv/bin/pip install -e .
export GCP_PROJECT=your-project   # uses Application Default Credentials

Add to your MCP client config (e.g. claude_desktop_config.json or Claude Code's .mcp.json):

{
  "mcpServers": {
    "bigquery": {
      "command": "/path/to/bq-mcp/venv/bin/bq-mcp",
      "env": { "GCP_PROJECT": "your-project", "BQ_LOCATION": "US" }
    }
  }
}

Stack

Python · google-cloud-bigquery · mcp (FastMCP)


Built by Aravindhraja R · part of a small BigQuery/AI toolset alongside QueryDoctor and BigQuery Cost Sentinel.

Multi-IDE MCP Setup (AGENTS.md, SKILL.md & Read-Only Annotations)

Every tool is annotated with MCP ToolAnnotations(readOnlyHint=True, destructiveHint=False, idempotentHint=True) so MCP clients recognize them as safe read-only operations.

  • Universal instructions & skill: AGENTS.md + .github/skills/bq-mcp/SKILL.md (agentskills.io-compliant).

  • VS Code Copilot (.vscode/mcp.json), Claude Code (.mcp.json), or Cursor (.cursor/mcp.json):

    {
      "mcpServers": {
        "bq-mcp": {
          "command": "bq-mcp",
          "env": {
            "GCP_PROJECT": "your-project",
            "BQ_LOCATION": "US",
            "BQ_MCP_MAX_COST_USD": "5.0"
          }
        }
      }
    }

License

MIT

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables LLMs to explore BigQuery datasets and tables, run safe read-only queries, and optionally perform vector search using BigQuery embeddings.
      10
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to run BigQuery queries safely under a configurable policy, with parsing, dry-run byte limits, row caps, and audit logging for every request.
      5
      MIT
    • 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