mcp-server-bigquery

MCP.Pizza Chef: LucasHild

Three tools: list the tables you have, show what one of them contains, and run a query. Two things the write-up gets wrong. The query tool claims to accept only read commands, but nothing enforces that, so a command that empties or removes a table runs just as happily if your Google sign-in permits it. And the setting that limits things to chosen datasets only trims the table listing, never the queries. BigQuery also bills by how much data each query reads.

Coding
Data

Use This MCP server To

Ask a question about my data without writing the query myself Find out which tables exist and what sits in them Pull last month's totals into the middle of a conversation Check what a column really contains before trusting it Get a quick count without opening the Google console

README

BigQuery MCP server

smithery badge

A Model Context Protocol server that provides access to BigQuery. This server enables LLMs to inspect database schemas and execute queries.

Components

Tools

The server implements one tool:

  • 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

Configuration

The server can be configured either with 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 Only take specific BigQuery datasets into consideration. Several datasets can be specified by repeating the argument (e.g. --dataset my_dataset_1 --dataset my_dataset_2) or by joining them with a comma in the environment variable (e.g. BIGQUERY_DATASETS=my_dataset_1,my_dataset_2). If not provided, all datasets in the project will be considered.
--key-file BIGQUERY_KEY_FILE No Path to a service account key file for BigQuery. If not provided, the server will use the default credentials.
--timeout BIGQUERY_TIMEOUT No Maximum time in seconds to wait for a query to complete. If not provided, queries will wait indefinitely.

Installation

Installing via Smithery

To install BigQuery Server for Claude Desktop automatically via Smithery:

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

Claude Code

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

Claude Desktop

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

{
  "mcpServers": {
    "bigquery": {
      "command": "uvx",
      "args": ["mcp-server-bigquery"],
      "env": {
        "BIGQUERY_PROJECT": "{{GCP_PROJECT_ID}}",
        "BIGQUERY_LOCATION": "{{GCP_LOCATION}}"
      }
    }
  }
}

Cursor

  1. Open Cursor Settings → MCP
  2. Click Add new global MCP server
  3. Add an entry for the BigQuery MCP, following the pattern below:
{
  "mcpServers": {
    "bigquery": {
      "command": "uvx",
      "args": ["mcp-server-bigquery"],
      "env": {
        "BIGQUERY_PROJECT": "{{GCP_PROJECT_ID}}",
        "BIGQUERY_LOCATION": "{{GCP_LOCATION}}"
      }
    }
  }
}

mcp-server-bigquery FAQ

Do I need to buy a key?
No key to buy, but the machine has to be signed in to Google Cloud already, either through Google's own command-line sign-in or by pointing the tool at a downloaded account file.
Is it read-only?
No, despite what the tool calls itself. It hands your query straight to Google with no filtering, so anything your Google account is allowed to do, this can do. The only real protection is giving that account read-only rights in Google.
If I limit it to one dataset, is the rest of my data safe?
No, and this one catches people out. That setting only shortens the list of tables it shows you. Queries can still reach anything the signed-in account can see.
Can I use this to answer a question about my company's figures?
Yes, and it is the main reason to install it. Ask in plain English, and it works out the tables involved and comes back with numbers.
Will it cost me anything?
It can. Google charges for the amount of data each query reads, so a broad question against a large table is a real bill. There is also no time limit on a query unless you set one, so a runaway query just keeps going.
Which apps does it work in?
Claude Desktop, Claude Code and Cursor are all documented, and there is a one-line installer that writes the configuration for you.
Does it keep a record of what I asked?
Yes. It writes a detailed log file into your computer's temporary folder that includes the text of every query run, which matters if those queries mention sensitive things.
How hard is setup?
A short snippet pasted into your assistant, once you have signed in to Google Cloud on that machine. The Google sign-in is the only fiddly part.