BigQuery MCP Server
by takuya0206
A Model Context Protocol (MCP) server for accessing Google BigQuery. This server enables Large Language Models (LLMs) to understand BigQuery dataset structures and execute SQL queries.
Last updated: N/A
What is BigQuery MCP Server?
The BigQuery MCP Server is a tool that allows Large Language Models (LLMs) to interact with Google BigQuery. It acts as a bridge, enabling LLMs to understand BigQuery's dataset structure and execute SQL queries to retrieve data.
How to use BigQuery MCP Server?
To use the server, you can install it locally or via Docker. Configure the server with your Google Cloud project ID, location, and authentication credentials (either Application Default Credentials or a service account key file). Then, integrate the server into your MCP configuration, specifying the command and arguments for execution. Use the provided tools (query, list_all_datasets, etc.) by sending requests to the server with the appropriate parameters.
Key features of BigQuery MCP Server
Supports Application Default Credentials (ADC) or service account key files for authentication.
Provides tools for executing read-only SQL queries, listing datasets and tables, retrieving table information, and performing dry-run queries.
Includes security features such as read-only access (SELECT queries only) and limits on query processing to prevent excessive costs.
Offers partition filter recommendations for partitioned tables to optimize query performance and cost.
Use cases of BigQuery MCP Server
Enabling LLMs to answer questions based on data stored in BigQuery.
Allowing LLMs to generate reports and visualizations from BigQuery data.
Integrating BigQuery data into LLM-powered applications and workflows.
Using LLMs to explore and understand BigQuery datasets.
FAQ from BigQuery MCP Server
How do I authenticate with BigQuery?
How do I authenticate with BigQuery?
You can authenticate using Application Default Credentials (ADC) or a service account key file. ADC is recommended for local development, while a service account key file is suitable for production environments.
What permissions are required for the service account?
What permissions are required for the service account?
The service account or user credentials should have roles/bigquery.user
(recommended) or both roles/bigquery.dataViewer
and roles/bigquery.jobUser
.
How can I prevent excessive costs?
How can I prevent excessive costs?
The server limits queries to SELECT statements only and has a default limit of 500GB for query processing. Partition filter recommendations are also provided for partitioned tables.
How do I test the server?
How do I test the server?
You can use the inspector tool from the Model Context Protocol project for testing and debugging. An example is provided in the README.
What is the default BigQuery location?
What is the default BigQuery location?
The default BigQuery location is asia-northeast1. You can change it using the --location command-line option.