BigQuery MCP

v26.11.14
com.renzojohnson/bigquery-mcp Checked 2 hours ago Published 18 days ago

BigQuery MCP server: list datasets and tables, read schemas, run SELECT queries with a byte limit.

The server speaks MCP over stdio, so you normally let your AI agent start it, as below. Or add it to .mcp.json in your project (or ~/.claude.json for every project): Add the same block to ~/.cursor/mcp.json (or .cursor/mcp.json in a project):

Summary extracted from the README.

BigQuery MCP

npm License: MIT

BigQuery MCP server for Claude Code, Cursor, Copilot and five more AI agents. This is the MCP server from the BigQuery MCP VS Code extension, packaged to run with npx in any MCP client.

Requires Node.js 22 or newer.

npx -y @renzo.johnson/bigquery-mcp

The server speaks MCP over stdio, so you normally let your AI agent start it, as below.

Claude Code

claude mcp add bigquery-mcp -- npx -y @renzo.johnson/bigquery-mcp

Or add it to .mcp.json in your project (or ~/.claude.json for every project):

{
  "mcpServers": {
    "bigquery-mcp": {
      "command": "npx",
      "args": ["-y", "@renzo.johnson/bigquery-mcp"],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service-account.json"
      }
    }
  }
}

Cursor

Add the same block to ~/.cursor/mcp.json (or .cursor/mcp.json in a project):

{
  "mcpServers": {
    "bigquery-mcp": {
      "command": "npx",
      "args": ["-y", "@renzo.johnson/bigquery-mcp"],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service-account.json"
      }
    }
  }
}

Credentials

The server signs in to Google in this order:

Option Environment Best for
OAuth user GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET, GOOGLE_OAUTH_REFRESH_TOKEN (all three) Personal Google accounts
Service account or saved credentials GOOGLE_APPLICATION_CREDENTIALS = path to a JSON key Servers, Workspace admins
gcloud none: run gcloud auth application-default login once Developers with the Google Cloud CLI

Setting only some of the three OAuth variables stops the server with an error that names the missing ones. Enable the BigQuery API in your Google Cloud project.

Optional settings:

Variable What it does
BIGQUERY_MCP_PROJECT_ID Google Cloud project ID used when a request does not name one
BIGQUERY_MCP_MAX_BYTES_BILLED Largest number of bytes a query may scan (default 1000000000)

Set bigqueryMcp.projectId to the project that runs your queries. bq_query runs only SELECT statements and dry-runs each one first; a query that would scan more than bigqueryMcp.maxBytesBilled (1 GB by default) is refused instead of billed.

Available Tools (5)

Tool What It Does Example Prompt
bq_list_datasets Datasets in a project "List my datasets"
bq_list_tables Tables and views in a dataset "What tables are in analytics?"
bq_get_table Schema, row count and size "Show the schema of analytics.events"
bq_query Run a SELECT, after a dry-run cost check "Orders per day last week"

Safety

BigQuery MCP runs SELECT queries only, with a byte limit. Every query is dry-run first. Anything other than a single SELECT, or a query that would scan more than BIGQUERY_MCP_MAX_BYTES_BILLED (1 GB by default), is refused before it runs or bills.

VS Code

Prefer a setup wizard that registers the server with eight agents for you? Install the BigQuery MCP extension instead (also on the VS Code Marketplace). Use one or the other, not both.


By Renzo Johnson