BigQuery MCP Server
- Databases
This is a server that lets your LLMs (like Claude) talk directly to your BigQuery data! Think of it as a friendly translator that sits between your AI assistant and your database, making sure they can chat securely and efficiently.
Prompts
Interactive templates invoked by user choice
Name | Description |
---|---|
No prompts |
Resources
Contextual data attached and managed by the client
Name | Description |
---|---|
No resources |
Tools
Functions exposed to the LLM to take actions
Name | Description |
---|---|
query | Run a read-only BigQuery SQL query |
Server Configuration
Describes the environment variables required to run the server.
Name | Required | Description | Default |
---|---|---|---|
key-file | No | Path to service account key JSON file | |
location | No | BigQuery location | us-central1 |
project-id | Yes | Your Google Cloud project ID |
BigQuery MCP Server
<div align="center"> <img src="assets/mcp-bigquery-server-logo.png" alt="BigQuery MCP Server Logo" width="400"/> </div>What is this? π€
This is a server that lets your LLMs (like Claude) talk directly to your BigQuery data! Think of it as a friendly translator that sits between your AI assistant and your database, making sure they can chat securely and efficiently.
Quick Example
No more writing SQL queries by hand - just chat naturally with your data!
How Does It Work? π οΈ
This server uses the Model Context Protocol (MCP), which is like a universal translator for AI-database communication. While MCP is designed to work with any AI model, right now it's available as a developer preview in Claude Desktop.
Here's all you need to do:
- Set up authentication (see below)
- Add your project details to Claude Desktop's config file
- Start chatting with your BigQuery data naturally!
What Can It Do? π
- Run SQL queries by just asking questions in plain English
- Access both tables and materialized views in your datasets
- Explore dataset schemas with clear labeling of resource types (tables vs views)
- Analyze data within safe limits (1GB query limit by default)
- Keep your data secure (read-only access)
Quick Start π
Prerequisites
- Node.js 14 or higher
- Google Cloud project with BigQuery enabled
- Either Google Cloud CLI installed or a service account key file
- Claude Desktop (currently the only supported LLM interface)
Option 1: Quick Install via Smithery (Recommended)
To install BigQuery MCP Server for Claude Desktop automatically via Smithery, run this command in your terminal:
The installer will prompt you for:
- Your Google Cloud project ID
- BigQuery location (defaults to us-central1)
Once configured, Smithery will automatically update your Claude Desktop configuration and restart the application.
Option 2: Manual Setup
If you prefer manual configuration or need more control:
- Authenticate with Google Cloud (choose one method):
- Using Google Cloud CLI (great for development):Copygcloud auth application-default login
- Using a service account (recommended for production):Copy# Save your service account key file and use --key-file parameter # Remember to keep your service account key file secure and never commit it to version control
- Using Google Cloud CLI (great for development):
- Add to your Claude Desktop config
Add this to your
claude_desktop_config.json
:- Basic configuration:Copy{ "mcpServers": { "bigquery": { "command": "npx", "args": [ "-y", "@ergut/mcp-bigquery-server", "--project-id", "your-project-id", "--location", "us-central1" ] } } }
- With service account:Copy{ "mcpServers": { "bigquery": { "command": "npx", "args": [ "-y", "@ergut/mcp-bigquery-server", "--project-id", "your-project-id", "--location", "us-central1", "--key-file", "/path/to/service-account-key.json" ] } } }
- Basic configuration:
- Start chatting! Open Claude Desktop and start asking questions about your data.
Command Line Arguments
The server accepts the following arguments:
--project-id
: (Required) Your Google Cloud project ID--location
: (Optional) BigQuery location, defaults to 'us-central1'--key-file
: (Optional) Path to service account key JSON file
Example using service account:
Permissions Needed
You'll need one of these:
roles/bigquery.user
(recommended)- OR both:
roles/bigquery.dataViewer
roles/bigquery.jobUser
Developer Setup (Optional) π§
Want to customize or contribute? Here's how to set it up locally:
Then update your Claude Desktop config to point to your local build:
Current Limitations β οΈ
- MCP support is currently only available in Claude Desktop (developer preview)
- Connections are limited to local MCP servers running on the same machine
- Queries are read-only with a 1GB processing limit
- While both tables and views are supported, some complex view types might have limitations
Support & Resources π¬
- π Report issues
- π‘ Feature requests
- π Documentation
License π
MIT License - See LICENSE file for details.
Author βοΈ
Salih ErgΓΌt
Version History π
See CHANGELOG.md for updates and version history.
GitHub Badge
Glama performs regular codebase and documentation scans to:
- Confirm that the MCP server is working as expected.
- Confirm that there are no obvious security issues with dependencies of the server.
- Extract server characteristics such as tools, resources, prompts, and required parameters.
Our directory badge helps users to quickly asses that the MCP server is safe, server capabilities, and instructions for installing the server.
Copy the following code to your README.md file: