Back to MCP Catalog

BigQuery MCP Server

DatabasesPython
Access and query Google BigQuery databases
Available Tools

execute-query

Executes a SQL query using BigQuery dialect

list-tables

Lists all tables in the BigQuery database

describe-table

Describes the schema of a specific table

A Model Context Protocol server that provides access to Google BigQuery. This server enables AI assistants to inspect database schemas and execute SQL queries against BigQuery datasets, making it easy to analyze and visualize data stored in Google Cloud.

Overview

BigQuery MCP server provides AI assistants with the ability to interact with Google BigQuery databases. This enables AI models to explore database schemas, execute SQL queries, and analyze data stored in Google Cloud Platform.

Installation

Prerequisites

  • Google Cloud Platform account with BigQuery access
  • A GCP project with BigQuery datasets
  • Python 3.10 or higher
  • (Optional) A service account key file with BigQuery permissions

Installing via Smithery

The easiest way to install the BigQuery MCP server is through Smithery:

npx -y @smithery/cli install mcp-server-bigquery --client claude

Manual Installation

  1. Install the package using pip or uv:
pip install mcp-server-bigquery
# or
uv pip install mcp-server-bigquery
  1. Configure your AI assistant client to use the server.

Claude Desktop Configuration

For Claude Desktop, edit the configuration file:

  • MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json

Add the following to your configuration:

"mcpServers": {
  "bigquery": {
    "command": "uvx",
    "args": [
      "mcp-server-bigquery",
      "--project",
      "YOUR_GCP_PROJECT_ID",
      "--location",
      "YOUR_GCP_LOCATION"
    ]
  }
}

Configuration Options

The server can be configured using either command-line arguments or environment variables:

| Argument | Environment Variable | Required | Description | |----------|---------------------|----------|-------------| | --project | BIGQUERY_PROJECT | Yes | The GCP project ID | | --location | BIGQUERY_LOCATION | Yes | The GCP location (e.g., europe-west9) | | --dataset | BIGQUERY_DATASETS | No | Specific BigQuery datasets to use (can be repeated for multiple datasets) | | --key-file | BIGQUERY_KEY_FILE | No | Path to a service account key file |

When using environment variables, you can specify multiple datasets by separating them with commas: BIGQUERY_DATASETS=dataset1,dataset2.

Usage

Once configured, your AI assistant can use the BigQuery MCP server to:

  1. List available tables in your BigQuery datasets
  2. Describe table schemas to understand data structure
  3. Execute SQL queries against your BigQuery data

The AI will automatically use the appropriate tool based on your requests. For example:

  • "Show me the schema of the users table"
  • "List all tables in the analytics dataset"
  • "Run a query to count unique visitors by day"

Debugging

If you encounter issues, you can use the MCP Inspector for debugging:

npx @modelcontextprotocol/inspector uvx mcp-server-bigquery --project YOUR_PROJECT --location YOUR_LOCATION

This will provide a web interface for inspecting the communication between your AI assistant and the BigQuery server.

Security Considerations

  • The server will execute SQL queries as provided, so ensure your service account has appropriate permissions
  • Consider using a dedicated service account with limited access for this integration
  • Be cautious about exposing sensitive data through queries

Related MCPs

Milvus Vector Database
DatabasesPython

Connect to Milvus vector database for semantic search and vector operations

MotherDuck DuckDB
DatabasesPython

SQL analytics with DuckDB and MotherDuck for AI assistants

Alibaba Cloud Tablestore
DatabasesJava, Python

Connect to Alibaba Cloud Tablestore for vector search and RAG applications

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.