BigQuery

by takada-at

Not rated
GitHub

About

Access and cache Google Cloud BigQuery metadata.

Details

Author
takada-at
Categories
Database, Other

Setup

Install BigQuery in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/takada-at/bq_mcp

Follow the installation instructions in the repository README, then restart your MCP client.

This is a Python-based MCP (Model Context Protocol) server that retrieves dataset, table, and schema information from Google Cloud BigQuery, caches it locally, and serves it via MCP. Its primary purpose is to enable generative AI systems to quickly understand BigQuery's structure and execute queries securely.

- Metadata Management: Retrieves and caches information about BigQuery datasets, tables, and columns
- Keyword Search: Supports keyword search of cached metadata
- Secure Query Execution: Provides SQL execution capabilities with automatic LIMIT clause insertion and cost control
- File Export: Execute queries and save results to local files in CSV or JSONL format
- MCP Compliance: Offers tools via the Model Context Protocol
- get_datasets- Retrieves a list of all datasets
- get_tables- Retrieves all tables within a specified dataset (requires dataset_id, optionally accepts project_id)
- search_metadata- Searches metadata for datasets, tables, and columns
- execute_query- Safely executes BigQuery SQL queries with automatic LIMIT clause insertion and cost control
- check_query_scan_amount- Retrieves the scan amount for BigQuery SQL queries
- save_query_result- Executes BigQuery SQL queries and saves results to local files (CSV or JSONL format)

Thesave_query_resulttool provides advanced query execution with file export capabilities:

- sql(required): SQL query to execute
- output_path(required): Local file path to save results
- format(optional): Output format -"csv"(default) or"jsonl"
- project_id(optional): Target GCP project ID
- include_header(optional): Include header row in CSV output (default: true)

- No Automatic LIMIT: Unlikeexecute_query, this tool does not automatically add LIMIT clauses to your SQL queries
- Cost Control: Maintains scan amount limits (default: 1GB) and safety checks to prevent expensive queries
- Security: Path validation prevents directory traversal attacks
- Flexible Formats: Supports both CSV and JSONL output formats
- Large Dataset Support: Handles large query results efficiently within scan limits

-- Export all rows without LIMIT restriction (subject to scan amount limits) SELECT customer_id, order_date, total_amount FROM project.dataset.orders WHERE order_date >= '2024-01-01'

Important Note:While this tool doesn't add LIMIT clauses, it still enforces scan amount limits for cost protection. Queries that would scan more than the configured limit (default: 1GB) will be rejected.

- Python 3.11 or later
- Google Cloud Platform account
- GCP project with BigQuery API enabled

This project usesuvfor package management:

# Install uv if not already installed curl -LsSf https://astral.sh/uv/install.sh | sh # Install dependencies uv sync

For a list of configuration values, see:

claude mcp add bq_mcp_server -- uvx --from git+https://github.com/takada-at/bq_mcp_server bq_mcp_server --project-ids <your project ids>
{ "mcpServers": { "bq_mcp_server": { "command": "uvx", "args": [ "--from", "git+https://github.com/takada-at/bq_mcp_server", "bq_mcp_server", "--project-ids", "<your project ids>" ] } } }
uvicorn bq_mcp_server.adapters.web:app --reload
# Code formatting ruff format # Linting checks ruff check # Automatic fixes ruff check --fix
# Adding new dependencies uv add <package> # Adding development dependencies uv add --dev <package> # Updating dependencies uv sync

Explore, query, and manage data in Google BigQuery.

Access Google BigQuery to understand dataset structures and execute SQL queries.

Execute and validate SQL queries against Google BigQuery. It safely runs SELECT queries under 1TB and returns results in JSON format.

A secure, self-hosted Model Context Protocol (MCP) server for Google BigQuery. Hard table allowlists, per-query scan ceilings, built-in rate limiting, and predictable costs on Cloud Run. Works with Claude, ChatGPT, Cursor, Gemini, and any MCP-compatible AI agent.

Unified MCP server giving AI coding agents direct access to your databases: 70+ SQL databases via SqlKit (PostgreSQL, MySQL, SQL Server, SQLite, ClickHouse, Snowflake, BigQuery) and NoSQL via DocKit (Elasticsearch, MongoDB, DynamoDB). Local-first: credentials never leave your machine, read-only by default, 79 tools.

Turn SQL templates + YAML into REST APIs and MCP tools — one static binary with embedded DuckDB (Parquet, Postgres, BigQuery, S3 and 50+ sources), per-tool RBAC, and DuckLake caching.

LangGrant turns AI data questions into reusable, governed Data Plans, joining data across multiple databases (Snowflake, Oracle, Postgres, BigQuery and more) and plugging into your MCP tools.

Securely access BigQuery datasets with intelligent caching, schema tracking, and query analytics via Supabase integration.

Create and monitor AI marketing-automation tasks across Google Ads, GA4, BigQuery and more, from any MCP client.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.