BigQuery Analysis MCP Server logo

BigQuery Analysis MCP Server

by gotalab

This server is an MCP server designed for executing SQL queries against Google BigQuery. It provides features for query validation, safe query execution (limited to SELECT queries under 1TB), and returns results in JSON format.

View on GitHub

Last updated: N/A

What is BigQuery Analysis MCP Server?

The BigQuery Analysis MCP Server is a tool that allows users to execute SQL queries against Google BigQuery through the Model Context Protocol (MCP). It focuses on providing a safe and validated query execution environment.

How to use BigQuery Analysis MCP Server?

To use the server, you need to install it and configure it with Claude Desktop by adding the server configuration to the claude_desktop_config.json file. You also need to set up Google Cloud authentication using either the gcloud CLI or a service account. Once configured, you can use the dry_run_query and run_query_with_validation tools with appropriate SQL queries.

Key features of BigQuery Analysis MCP Server

  • Query validation (dry run) to estimate processing size

  • Safe query execution, limiting to SELECT queries under 1TB

  • JSON-formatted results

  • DML statement detection and rejection

  • Integration with Claude Desktop

Use cases of BigQuery Analysis MCP Server

  • Validating BigQuery queries before execution to prevent costly mistakes

  • Safely executing queries without the risk of data modification

  • Integrating BigQuery data analysis into Claude Desktop workflows

  • Estimating query costs before running large queries

  • Automated data extraction and analysis from BigQuery

FAQ from BigQuery Analysis MCP Server

What is the purpose of the dry_run_query tool?

The dry_run_query tool validates a BigQuery query and estimates its processing size without actually executing it.

What types of queries are allowed by the run_query_with_validation tool?

The run_query_with_validation tool only allows SELECT queries that process less than 1TB of data. It rejects DML statements (data modification queries).

How do I set up authentication for the server?

You can set up authentication using either the gcloud CLI (gcloud auth application-default login) or by using a service account key (setting the GOOGLE_APPLICATION_CREDENTIALS environment variable).

How do I install the server?

Install dependencies using npm install, build the server using npm run build, and then configure it within Claude Desktop.

How can I debug the server?

Debugging can be challenging due to stdio communication. It is recommended to use the MCP Inspector (npm run inspector) to access debugging tools in your browser.