Get the FREE Ultimate OpenClaw Setup Guide →

mcp -bigquery

A Model Context Protocol server that provides access to BigQuery

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio lucashild-mcp-server-bigquery uvx mcp-server-bigquery \
  --env BIGQUERY_PROJECT="<YOUR_GCP_PROJECT_ID>" \
  --env BIGQUERY_TIMEOUT="<OPTIONAL_QUERY_TIMEOUT_IN_SECONDS>" \
  --env BIGQUERY_DATASETS="<OPTIONAL_COMMA_OR_LIST_OF_DATASETS>" \
  --env BIGQUERY_KEY_FILE="<PATH_TO_SERVICE_ACCOUNT_KEY_IF_NOT_USING_DEFAULT_CREDENTIALS>" \
  --env BIGQUERY_LOCATION="<YOUR_GCP_LOCATION>"

How to use

This MCP server provides programmatic access to BigQuery via the Model Context Protocol. It exposes three tools: execute-query to run a SQL query using BigQuery dialect, list-tables to enumerate tables in the configured datasets, and describe-table to return the schema of a specific table. To use it, run the server (via uvx) with your Google Cloud credentials or default credentials and point your MCP client to the bigquery entry. Once connected, you can invoke the tools by name (execute-query, list-tables, describe-table) with appropriate parameters through your MCP client. The server reads configuration from environment variables (project, location, datasets, key file, timeout) or command-line arguments when launching, enabling flexible deployment in cloud or local environments.

How to install

Prerequisites:

  • Access to Google Cloud with BigQuery permissions.
  • An installation method for MCP servers (via uvx or Smithery).

Option A: Install and run via uvx (no Node.js runtime required for this server):

  1. Ensure uvx is installed and available in your PATH.
  2. Start the server (example): uvx mcp-server-bigquery --project <YOUR_GCP_PROJECT_ID> --location <YOUR_GCP_LOCATION> (If using environment variables, set BIGQUERY_PROJECT and BIGQUERY_LOCATION accordingly and use the command without explicit flags.)

Option B: Install via Smithery (recommended for Claude Desktop/Claude Desktop integration):

  1. Install the MCP server for Claude: npx -y @smithery/cli install mcp-server-bigquery --client claude
  2. Start the server as instructed by Smithery/Claude integration, ensuring environment variables are provided for project and location (BIGQUERY_PROJECT, BIGQUERY_LOCATION).

Option C: Claude integration example (from README):

  • Claude Code: claude mcp add bigquery --scope user --transport stdio -- uvx mcp-server-bigquery --project {PROJECT_ID} --location {LOCATION}

Prerequisites recap: ensure you have access to a Google Cloud project, the BigQuery API enabled, and either set up credentials via a service account key file or rely on default application credentials. Adjust the BIGQUERY_* environment variables as needed for your deployment.

Additional notes

Notes and tips:

  • The BIGQUERY_DATASETS environment variable can be used to restrict which datasets are considered (comma-separated or repeated --dataset occurrences in CLI).
  • If you don’t provide BIGQUERY_KEY_FILE, the server will use default credentials (e.g., Google Cloud SDK or Google Application Default Credentials).
  • BIGQUERY_TIMEOUT controls query waiting time; omit to wait indefinitely.
  • When integrating with Claude Desktop or Cursor, you can embed the server configuration in your config.json under mcpServers.bigquery with command 'uvx' and appropriate args/env as shown in the README example.
  • Ensure networking allows the MCP server to reach BigQuery endpoints and that authentication scopes permit reading datasets and running queries.

Related MCP Servers

Sponsor this space

Reach thousands of developers