BigQuery MCP Server Cursor IDE Setup 2026: Query Your Data Warehouse with AI
Connect Google BigQuery to Cursor IDE using MCP. Run SQL, explore datasets, and analyze billions of rows from Composer — full setup guide with IAM config.
BigQuery holds the kind of data that shapes engineering decisions — event logs, product analytics, financial records, and more. Connecting it to Cursor via MCP means you can ask natural language questions against your data warehouse and get SQL results without leaving your editor. This guide covers the full setup.
What This Integration Enables
With BigQuery MCP running in Cursor, you can:
Prerequisites
New to MCP in Cursor? The general Cursor setup guide covers the mcp.json mechanics this guide assumes. BigQuery is also a good illustration of why credential shape matters: it accepts either Application Default Credentials or a service-account JSON key, and the guide to MCP authentication patterns walks through when each is the right call.
Step 1: Set Up Google Cloud Authentication
The BigQuery MCP server uses Application Default Credentials (ADC). The easiest path:
gcloud auth application-default login
This opens a browser and stores credentials at ~/.config/gcloud/application_default_credentials.json. The MCP server picks these up automatically.
Alternatively, create a service account:
1. In Google Cloud Console, go to IAM & Admin → Service Accounts.
2. Click Create Service Account → name it "cursor-mcp".
3. Grant the role BigQuery Data Viewer (for read-only) or BigQuery User + BigQuery Data Editor (for queries + write).
4. Click Done, then open the account → Keys → Add Key → JSON.
5. Download the JSON key file and store it securely.
Step 2: Install the BigQuery MCP Server
The most widely used option is the community @dataengineeringwithalex/mcp-bigquery server:
npm install -g @dataengineeringwithalex/mcp-bigquery
Or run it with npx (no global install):
npx @dataengineeringwithalex/mcp-bigquery --help
Alternatively, there's a Python-based option:
pip install mcp-server-bigquery
Step 3: Configure Cursor
Edit ~/.cursor/mcp.json (macOS/Linux) or %APPDATA%\Cursor\mcp.json (Windows):
Using ADC (recommended):
{
"mcpServers": {
"bigquery": {
"command": "npx",
"args": ["-y", "@dataengineeringwithalex/mcp-bigquery"],
"env": {
"GOOGLE_CLOUD_PROJECT": "your-gcp-project-id"
}
}
}
}
Using a service account key:
{
"mcpServers": {
"bigquery": {
"command": "npx",
"args": ["-y", "@dataengineeringwithalex/mcp-bigquery"],
"env": {
"GOOGLE_CLOUD_PROJECT": "your-gcp-project-id",
"GOOGLE_APPLICATION_CREDENTIALS": "/absolute/path/to/service-account-key.json"
}
}
}
}
Replace your-gcp-project-id with your actual GCP project ID (visible in the Cloud Console header).
Step 4: Restart and Verify
Quit Cursor completely and reopen it. Go to Settings → Features → MCP and confirm the "bigquery" server appears with a green status.
In Composer, test with:
List the datasets available in my BigQuery project
If you get a list of datasets back, you're connected.
Real-World Use Cases
Exploratory Data Analysis
You're working on a feature that reads from a BigQuery table but you're not sure of the schema:
Describe the schema for the events.user_sessions table in BigQuery
Show me a sample of 10 rows from events.user_sessions
where created_at is in the last 7 days
Debugging a Data Pipeline
Your dbt model is producing unexpected output. Ask Cursor:
Query BigQuery: SELECT COUNT(*) as total, status, COUNT(DISTINCT user_id)
FROM analytics.orders
WHERE created_at >= '2026-04-01'
GROUP BY status
ORDER BY total DESC
Validating a Migration
Before deploying a schema change:
Check how many rows in bigquery table analytics.events
have a null value in the session_id column
Writing Queries Based on Business Questions
Write a BigQuery SQL query that shows me daily active users
for the past 30 days from the analytics.events table,
using the user_id field and event_date timestamp
Cursor writes the SQL, then you can run it directly in the MCP interface.
Troubleshooting
Authentication errors
gcloud auth application-default print-access-token — if it errors, re-run gcloud auth application-default login.GOOGLE_CLOUD_PROJECT matches exactly what's in your GCP console — it's case-sensitive."Access Denied" on specific tables
Query timeout
"BIGQUERY_TIMEOUT": "60" to your env block.LIMIT clause to your prompt.Server starts but no tools appear
GCLOUD_PROJECT instead of GOOGLE_CLOUD_PROJECT. Try both.npx @dataengineeringwithalex/mcp-bigquery and check for startup errors.Results are truncated
LIMIT 100 explicitly in your prompts for exploratory queries.Cost Awareness
BigQuery charges per bytes scanned. When running queries through MCP:
SELECT specific_columns instead of SELECT * to reduce bytes scanned.SELECT COUNT(*) before running wide queries.A well-structured AI query should cost less than $0.01. Unfiltered table scans on terabyte datasets can be expensive.
Using Multiple GCP Projects
If you work across multiple GCP projects, configure separate MCP servers:
{
"mcpServers": {
"bigquery-prod": {
"command": "npx",
"args": ["-y", "@dataengineeringwithalex/mcp-bigquery"],
"env": {
"GOOGLE_CLOUD_PROJECT": "my-prod-project"
}
},
"bigquery-dev": {
"command": "npx",
"args": ["-y", "@dataengineeringwithalex/mcp-bigquery"],
"env": {
"GOOGLE_CLOUD_PROJECT": "my-dev-project"
}
}
}
}
Then reference them explicitly: "Query bigquery-dev for the orders table schema."
Security
mcp.json — add it to .gitignore.BigQuery Data Viewer) unless you need to write or create tables.A warehouse connection is one of the higher-stakes things you can hand an assistant, since a single tool call can read a lot of rows at once. Our server-side security checklist covers the wider pattern, including validating inputs and requiring confirmation before any write-capable tool runs.
Combining with Other MCP Servers
BigQuery pairs naturally with:
dbt build and dbt test against those models directly, rather than only reading the output tablesIf your organization runs Snowflake alongside (or instead of) BigQuery, the setup looks structurally different — Snowflake's MCP server is account-managed rather than an npx package you install, with its own Programmatic Access Token flow. See the Snowflake MCP server setup guide if you need to connect both warehouses in the same Cursor config.
If your analytics workload runs on ClickHouse instead of (or alongside) BigQuery — high-cardinality event data, real-time dashboards — see the ClickHouse MCP server setup guide. It's read-only by default, which is worth knowing if you're weighing which warehouse's AI tooling to trust with less supervision.
If you need broader Google Cloud access beyond BigQuery itself — Cloud SQL, AlloyDB, Spanner — that's a separate server: Google's MCP Toolbox for Databases, configured through a tools.yaml file rather than this guide's npx package. See the Google Cloud MCP server setup guide for that broader setup.
If your organization runs Databricks instead of (or alongside) BigQuery, the setup is structurally closer to Snowflake's than to this guide's npx package — Databricks exposes managed MCP endpoints scoped to Unity Catalog, AI/Vector Search, and Genie rather than a single connection string. See the Databricks MCP server setup guide if you need both warehouses wired into the same Cursor config.
See the full MCP server directory to expand your AI-powered data workflow.
Related guides
- Brave Search MCP Server Setup for Cursor IDE (2026): Live Web Results in Chat
- Buildkite MCP Server Cursor IDE Setup 2026 (Pipelines, Builds, Test Insights)
- Cal.com MCP Server Cursor IDE Setup 2026: Hosted OAuth vs. Local API Key
- Canva MCP Server Cursor IDE Setup 2026: Remote Server via mcp-remote, OAuth Login