# BigQuery MCP

> BigQuery MCP is an open-source MCP server for databases. Read-only BigQuery access for agents with a per-query byte limit. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** vscode, CLI, self-hosted
- **Website:** https://renzojohnson.com/contributions/bigquery-mcp
- **MCP Registry name:** com.renzojohnson/bigquery-mcp
- **Categories:** databases, analytics and data
- **Listing updated:** 2026-11-14

## About

Every query is dry-run first, and one that would scan more than the ceiling is refused before it costs anything. The default ceiling is 1 GB, set through bigqueryMcp.maxBytesBilled or BIGQUERY_MCP_MAX_BYTES_BILLED. Only a single SELECT statement runs, and results are capped at 1,000 rows per call.

It ships as a VS Code extension that registers itself with the agents it finds: Copilot, Claude Code, Cursor, Codex, Gemini, Windsurf, Continue.dev and Cline. It is also on npm for any MCP client and needs Node.js 22 or newer. Credentials come from an OAuth client, a service account key file or gcloud Application Default Credentials.

The page says it is independent of Google's own managed BigQuery server, runs on your machine, and has no telemetry.

## Features

- **Spending guard:** Dry-runs each query and refuses those over the byte ceiling.
- **SELECT only:** Rejects anything other than a single SELECT statement.
- **Schema reads:** Returns a table's schema, row count, size and description.
- **Dry-run switch:** Lets the agent ask how many bytes a query would scan.
- **Multi-agent registration:** The extension writes config for eight agents.

## Good for

- Ask questions of a GA4 export in plain language
- Estimate the cost of a query before running it
- Read table schemas before writing application SQL
- Find the largest tables in a dataset

## Install

### Claude Code (Terminal)

```sh
claude mcp add bigquery-mcp --env GOOGLE_OAUTH_CLIENT_SECRET='<GOOGLE_OAUTH_CLIENT_SECRET>' --env GOOGLE_OAUTH_REFRESH_TOKEN='<GOOGLE_OAUTH_REFRESH_TOKEN>' -- npx -y @renzo.johnson/bigquery-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "bigquery-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@renzo.johnson/bigquery-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>",
        "GOOGLE_OAUTH_REFRESH_TOKEN": "<GOOGLE_OAUTH_REFRESH_TOKEN>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "bigquery-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@renzo.johnson/bigquery-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>",
        "GOOGLE_OAUTH_REFRESH_TOKEN": "<GOOGLE_OAUTH_REFRESH_TOKEN>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "bigquery-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@renzo.johnson/bigquery-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>",
        "GOOGLE_OAUTH_REFRESH_TOKEN": "<GOOGLE_OAUTH_REFRESH_TOKEN>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "bigquery-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@renzo.johnson/bigquery-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>",
        "GOOGLE_OAUTH_REFRESH_TOKEN": "<GOOGLE_OAUTH_REFRESH_TOKEN>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "bigquery-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@renzo.johnson/bigquery-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>",
        "GOOGLE_OAUTH_REFRESH_TOKEN": "<GOOGLE_OAUTH_REFRESH_TOKEN>"
      }
    }
  }
}
```

## Tools

- `bq_list_datasets`: Lists the datasets in a project.
- `bq_list_tables`: Lists the tables and views in a dataset.
- `bq_get_table`: Gets a table's schema, row count, size and description.
- `bq_query`: Runs a read-only SQL SELECT with optional location, dry run and up to 1,000 rows.

## FAQ

### Can it modify tables?

No; statements other than a single SELECT are rejected.

### How is it licensed?

MIT, free; BigQuery charges are separate.

### Where does data go?

Only to Google; the server runs locally with no telemetry.

### Is BigQuery MCP free?

Yes. BigQuery MCP is open source, so you can use and self-host it for free.

### How do I add BigQuery MCP to Claude Code?

Run this command in your terminal: claude mcp add bigquery-mcp --env GOOGLE_OAUTH_CLIENT_SECRET='<GOOGLE_OAUTH_CLIENT_SECRET>' --env GOOGLE_OAUTH_REFRESH_TOKEN='<GOOGLE_OAUTH_REFRESH_TOKEN>' -- npx -y @renzo.johnson/bigquery-mcp

### What are the best alternatives to BigQuery MCP?

The closest alternatives to BigQuery MCP are Agent-Native Analytics, Google Ads + Meta Ads + SEO/GEO MCP, Tapetide - Indian Stock Market MCP, Midplane and World Monitor.

## Alternatives

- [Agent-Native Analytics](https://ai-powered.com/mcp/agent-native-analytics): Agent-Native Analytics is an open-source MCP server for analytics and data.
- [Google Ads + Meta Ads + SEO/GEO MCP](https://ai-powered.com/mcp/google-ads-meta-ads-seo-geo-mcp): Google Ads + Meta Ads + SEO/GEO MCP is a freemium MCP server for marketing and seo.
- [Tapetide - Indian Stock Market MCP](https://ai-powered.com/mcp/tapetide-indian-stock-market-mcp): Tapetide - Indian Stock Market MCP is a freemium MCP server for finance and payments.
- [Midplane](https://ai-powered.com/mcp/midplane): Midplane is an open-source MCP server for databases.
- [World Monitor](https://ai-powered.com/mcp/world-monitor): World Monitor is a freemium MCP server for analytics and data.
- [CompanyData](https://ai-powered.com/mcp/companydata): CompanyData is a paid MCP server for analytics and data.
- [ChartAnt](https://ai-powered.com/mcp/chartant): ChartAnt is a freemium MCP server for design and media.
- [Quantivex Research](https://ai-powered.com/mcp/quantivex-research): Quantivex Research is a free MCP server for finance and payments.

---
Source: https://ai-powered.com/mcp/bigquery-mcp
