@qybbs/custom-bigquery-mcp
Provides tools for interacting with Google Cloud BigQuery, including listing allowed tables, describing schemas, estimating query costs, searching tables, and executing read-only SQL queries with FinOps guardrails.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@qybbs/custom-bigquery-mcp show me the schema for the allowed sales.orders table"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@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-mcpIntegration 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
userProjectso 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
list_allowed_tables: List all BigQuery tables allowed for query execution.describe_table: Get detailed schema, field descriptions, clustering, and partitioning info.estimate_query_cost: Perform dry-run calculation returning scanned bytes and estimated USD cost.execute_readonly_query: Execute read-only SQL queries against allowed tables.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=1000Local 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 startLicense
Available Tools
5 toolsdescribe_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
Scored across 5 tools
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.
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.
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.
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
Related MCP Connectors
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Governed SQL access to your databases: redaction, query review and an audit log.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
The BigQuery remote MCP server is a fully managed service that uses the Model Context Protocol to connect AI applications and LLMs to BigQuery data sources. It provides secure, standardized tools for AI agents to list datasets and tables, retrieve schemas, generate and execute SQL queries through natural language, and analyze data—enabling direct access to enterprise analytics data without requiring manual SQL coding.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables LLMs to explore BigQuery datasets and tables, run safe read-only queries, and optionally perform vector search using BigQuery embeddings.109 PyPI10MIT
- FlicenseNot gradedqualityDmaintenanceEnables read-only interaction with Google BigQuery, including SQL queries, dataset/table listing, schema retrieval, table preview, and metadata access via service account authentication.-
- FlicenseNot gradedqualityCmaintenanceEnables secure read-only interaction with Google BigQuery through natural language, including listing datasets, listing tables, retrieving metadata, and executing queries with cost controls.-
- AlicenseNot gradedqualityCmaintenanceEnables 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