bq-mcp-py

debitCredit/bq-mcp-py

3.2

If you are the rightful owner of bq-mcp-py and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A minimal MCP server providing passthrough access to Google Cloud BigQuery commands using existing gcloud CLI authentication.

Tools
  1. get_bq_schema

    Get the schema for a BigQuery table in project.dataset.table format

BigQuery MCP Server

CI Code style: ruff Type checker: mypy

A minimal MCP (Model Context Protocol) server that provides passthrough access to Google Cloud BigQuery commands. This server uses your existing gcloud CLI authentication and provides tools for querying BigQuery table schemas, routine information, and executing BigQuery queries with safety checks.

Features

  • Minimal setup: Uses your existing gcloud CLI authentication
  • Schema inspection: Get BigQuery table and view schemas in JSON format
  • Routine information: Get BigQuery routine (TVF, stored procedure, function) details
  • Query execution: Execute BigQuery queries with safety checks and cost estimation
  • Passthrough commands: Direct access to bq and gcloud commands

Prerequisites

  • Google Cloud SDK (gcloud and bq commands) installed and configured
  • Python 3.13+
  • uv package manager

Installation for coding agents

Add this MCP server to Claude Code user settings:

claude mcp add -s user bq-mcp -- uv --directory /path/to/bq-mcp-py/ run bq-mcp.py

Add this to Gemini CLI ~/.gemini/settings.json settings:

"bq-mcp": {
  "command": "uv",
  "args": [
    "--directory",
    "/path/to/bq-mcp-py",
    "run",
    "bq-mcp.py"
  ]
}

Add this to VS Code user settings:

"mcp": {
    "servers": {
    "bq-schema": {
        "type": "stdio",
        "command": "uv",
        "args": [
            "--directory",
            "/path/to/bq-mcp-py",
            "run",
            "bq-mcp.py"
        ]
    }
    }
}

Usage

Once installed, the server provides the following tools:

  • get_bq_schema(table_id): Get the schema for a BigQuery table or view in project.dataset.table format
  • get_bq_routine(routine_id): Get information about a BigQuery routine (TVF, stored procedure, function) in project.dataset.routine_name format
  • execute_bq_query(query, project_id, confirmation_token): Execute BigQuery queries with safety checks, cost estimation, and confirmation tokens for dangerous operations

Authentication

This server uses your existing gcloud CLI authentication. Make sure you're authenticated with Google Cloud:

gcloud auth login
gcloud config set project YOUR_PROJECT_ID