The premise for below is that you have Cursor IDE and want to connect it directly to your BigQuery data warehouse using Model Context Protocol (MCP). There's a lot of mystery around how to set this up for Data Teams, and honestly, most people don't even know this is possible. I think it's time to skill up and understand this step in the Full Data Stack. This setup will literally let you chat with your data warehouse through your AI coding assistant. Let me show you exactly how to do it.
Let's Get Started:
Today we are going to set up a fully functional BigQuery MCP integration with Cursor that will let you query your data warehouse using natural language. This setup is meant to bridge the gap between your AI coding assistant and your actual data. No more copying and pasting queries or switching between tabs. Your AI will have direct access to your BigQuery datasets, tables, and can even execute queries for you. This integration will sit between Cursor and your Google Cloud project, acting as a bridge that understands both your natural language requests and BigQuery's API.
Here's what it will look like:
- Ask Cursor: "What datasets do I have in BigQuery?"
- Cursor responds with actual data from your warehouse
- Ask: "Show me the schema of my users table"
- Cursor pulls the real schema and explains it
- Say: "Write a query to find our top customers by revenue"
- Cursor writes AND executes the query against your actual data
Here's what you need:
1. Cursor IDE installed on your machine
2. Google Cloud CLI (gcloud) installed and configured
3. A BigQuery MCP toolbox binary (I'll show you where to get this)
4. A Google Cloud project with BigQuery enabled and some data in it
5. About 15 minutes and a willingness to level up your data workflow
A Quick Note About Security:
This setup uses Google's Application Default Credentials, which is the recommended secure way to authenticate with BigQuery from local applications. Your credentials stay on your machine, and you maintain all the same BigQuery access controls you already have. The MCP server acts as a local bridge - it's not sending your data anywhere external.
What is MCP and Why Should Data Teams Care?
From the official Anthropic documentation, Model Context Protocol (MCP) is:
> An open protocol that enables AI assistants to securely connect to data sources, tools, and services. MCP provides a standardized way for AI systems to request and receive information from external systems.
So essentially, what MCP does is it lets your AI coding assistant talk directly to external services like databases, APIs, and tools. Instead of you having to manually query BigQuery, copy results, and paste them into Cursor, the AI can do all of that seamlessly in the background.
This differs from just asking ChatGPT or Claude to write you SQL queries in that your AI assistant has actual, real-time access to your data schemas, can execute queries, and can iterate on analysis based on actual results. It's like having a data analyst sitting next to your AI that can instantly fact-check and validate everything.
Some other options for this kind of integration involve complex API setups or building custom tools, but MCP provides a standardized, secure way to make these connections. For Data Teams, this means you can finally have AI that understands your actual data structure, not just generic SQL patterns.
Let's Go Through the Setup
OK, so with that high level out of the way, let's walk through the actual setup. I'm going to assume you already have Cursor and gcloud set up. If you don't have those, go get them first.
Step 1: Get Your MCP Toolbox
First, you need the BigQuery MCP toolbox binary. This is a small executable that acts as the bridge between Cursor and BigQuery.
Check that your toolbox is executable:
```bash
ls -la toolbox
# Should show: -rwxr-xr-x (executable permissions)
```
If it's not executable, fix that:
```bash
chmod +x toolbox
```
Step 2: The Authentication Dance
Here's where most people get tripped up. You need Application Default Credentials, not just regular gcloud authentication. Regular `gcloud auth login` is for CLI commands. ADC is for applications (like our MCP server) to authenticate on your behalf.
Run this command:
```bash
gcloud auth application-default login
```
This will:
- Open a browser for authentication
- Save credentials to `~/.config/gcloud/application_default_credentials.json`
- Configure your project for ADC billing and quota
Don't skip this step!
Step 3: Configure MCP in Cursor
Now we need to tell Cursor about our new BigQuery MCP server. Create or update your MCP configuration file at `~/.cursor/mcp.json`:
Note: You can edit this file via Cursor's MCP Tools settings as well
```json
{
"mcpServers": {
"bigquery": {
"command": "/absolute/path/to/your/toolbox",
"args": ["--prebuilt","bigquery","--stdio"],
"env": {
"BIGQUERY_PROJECT": "your-project-id"
}
}
}
}
```
⚠️ Critical Detail: Use the absolute path to your toolbox binary. Don't use relative paths like `"./toolbox"`. MCP servers run in different working directories, so relative paths will break. Get your absolute path with:
```bash
pwd
# Then combine with /toolbox
```
Replace `your-project-id` with your actual Google Cloud project ID. You can find this in your Google Cloud Console or by running `gcloud config get-value project`.
Step 4: Test the Connection
Before restarting Cursor, let's make sure our toolbox can actually start:
```bash
./toolbox --prebuilt bigquery --stdio &
# Should start without errors - you might see some initialization messages
pkill -f "toolbox.*bigquery" # Clean up the test
```
If you see errors here, stop and fix them before proceeding. Common issues:
- Wrong project ID in environment variable
- Missing ADC authentication
- Toolbox binary not executable
Step 5: Restart and Verify
Restart Cursor completely (not just reload - actually quit and restart). Once it's back up, you should see the BigQuery server in Cursor's MCP Tools settings.
You should now have access to these tools:
- `mcp_bigquery_list_dataset_ids` - Lists your datasets
- `mcp_bigquery_list_table_ids` - Lists tables in a dataset
- `mcp_bigquery_get_dataset_info` - Gets dataset metadata
- `mcp_bigquery_get_table_info` - Gets table schema and info
- `mcp_bigquery_execute_sql` - Runs SQL queries
Let's Take It for a Test Drive
Now for the fun part. Open a new chat in Cursor and try these prompts:
"What datasets do I have in BigQuery?"
Cursor should use the MCP tools to actually query your BigQuery project and return your real datasets. Not a generic example - your actual data.
"Show me the tables in my [dataset-name] dataset and describe what each table contains."
Watch as Cursor lists your real tables and, if you have table descriptions or can infer from column names, explains what each table likely contains.
"Get the schema of my [table-name] table and explain what this data structure is optimized for."
Cursor will pull your actual table schema and provide insights about the data structure.
"Write and execute a query to show me the first 10 rows of [your-table-name]."
This is where it gets really powerful - Cursor will write the query AND execute it against your real data.
What This Unlocks for Data Teams
This setup fundamentally changes how you interact with your data warehouse. Instead of:
1. Opening BigQuery Console
2. Writing a query
3. Copying results
4. Pasting into your analysis
5. Going back to modify the query
6. Repeating the cycle
You can now:
1. Ask your AI: "What's the average order value by customer segment this month?"
2. AI writes and executes the query
3. AI explains the results and suggests follow-up analysis
4. You iterate naturally in conversation
For data exploration, this is a game-changer. You can have natural conversations about your data:
"Which customers haven't purchased anything in the last 90 days?"
"What's our retention rate by cohort?"
"Are there any anomalies in yesterday's transaction data?"
The AI has context of your actual data structure and can provide real insights, not just generic advice.
Troubleshooting the Inevitable Issues
Red Light in MCP Settings
If you see a red light in the MCP settings but the tools are listed, the server may still be functional. Test it by asking Cursor to query your data. Sometimes the health check is overly sensitive.
Authentication Errors
If you see "could not find default credentials":
- Double-check you ran `gcloud auth application-default login` (not just `gcloud auth login`)
- Verify the credentials file exists at `~/.config/gcloud/application_default_credentials.json`
- Make sure your BIGQUERY_PROJECT environment variable matches your actual project ID
Path Issues
- Always use absolute paths in the MCP configuration
- Don't use `~` in paths - expand to the full path
- Verify the toolbox binary exists at the path you specified
Permission Denied
If you get permission errors:
- Check that the toolbox binary is executable (`chmod +x toolbox`)
- Verify your Google Cloud account has BigQuery access in the specified project
- Try running a simple BigQuery query through gcloud CLI to test your permissions
Let's Talk About Costs and Limits
The BigQuery MCP integration uses your existing BigQuery quota and billing. Each query executed through Cursor counts against your BigQuery usage just like any other query.
For most data exploration and development work, this falls well within BigQuery's generous free tier (1 TB of query data processed per month). However, if you start doing large analytical queries through this interface, you'll want to keep an eye on your BigQuery billing.
The nice thing is that you maintain full control - the MCP server is running locally and using your credentials, so you're never charged for anything you wouldn't be charged for anyway.
One tip: You can ask Cursor to explain a query and estimate its cost before executing it, especially for large table scans.
Conclusion: The Future is Conversational Data
The time has come for Data Teams to embrace conversational interfaces for data work. This BigQuery MCP setup represents a fundamental shift in how we interact with our data warehouses. Instead of context-switching between tools and manually bridging the gap between AI and data, we can have fluid, natural conversations that incorporate real data at every step.
In the new world of AI-assisted data work, the teams that learn to integrate their AI tools directly with their data infrastructure will have a massive competitive advantage. They'll be able to explore data faster, catch issues sooner, and generate insights more naturally than teams still working with disconnected tools.
This setup is just the beginning. As MCP evolves and more data tools add MCP support, we'll see AI assistants that can seamlessly work across our entire data stack - from ingestion to transformation to analysis to visualization.
Let's start getting comfortable with these integrations now, so we're ready for the conversational data future that's already here.
---
*P.S. - If you found this helpful and want to see more deep dives into the Full Data Stack, subscribe below. I'm working on similar guides for leveraging MCP and also agentic coding for BI tools. The future of data work is going to be wild, and I want to make sure we're all ready for it.*
Love the MCP tutorial. I did something similar recently, but through Keboola. https://substack.com/@datacareerjumpstart/p-166078157
I'm hitting subscribe!