Blog
guide

How to Connect BigQuery to Claude Code Using Sequel

Musthaq Ahamad
Musthaq Ahamad
How to Connect BigQuery to Claude Code Using Sequel

Google BigQuery holds your company's most valuable data: event logs, revenue records, user behavior, product analytics. Claude Code is Anthropic's AI CLI that runs in your terminal. With Sequel's MCP server, you can ask BigQuery questions in plain English without writing SQL or switching tools.

What You'll Accomplish

After completing this setup, you'll be able to run Claude Code and ask:

  • "What are the top 10 products by revenue this month?"
  • "How many new users signed up each day last week?"
  • "Which marketing campaigns drove the most conversions this quarter?"

Prerequisites

  • A Sequel accountSign up free at sequel.sh
  • A GCP project with BigQuery enabled — and your Project ID ready
  • Claude Code installed — run npm install -g @anthropic-ai/claude-code if needed

Step 1: Connect Your BigQuery Project to Sequel

Sign in to sequel.sh and click Data Sources in the left sidebar.

Sequel Data Sources page

Click New Connection. On the "Choose a connector" page, select BigQuery.

Choose a connector

Click Connect with Google and sign in with the Google account that has access to your BigQuery project. Sequel requests read-only access (bigquery.readonly scope) — it cannot modify your data.

After authorizing, enter your GCP Project ID (e.g. my-company-analytics-123). You can find this in the Google Cloud Console at the top of the dashboard.

Click Connect to verify and save.

Step 2: Get Your Sequel API Key

Click Settings in the left sidebar, then select API Keys from the settings navigation.

Sequel API Keys page

Click New key, name it claude-code-bigquery, and copy the key (starts with sql_).

Step 3: Configure Claude Code to Use Sequel MCP

In your terminal:

claude mcp add sequel \
  --transport http \
  https://api.sequel.sh/mcp \
  --header "Authorization: Bearer sql_your_api_key"

Replace sql_your_api_key with the key from Step 2. Verify with:

claude mcp list

Step 4: Query Your BigQuery Data

Start a Claude Code session and ask questions about your data:

What are the top 10 events by count in the last 7 days?
Show me daily revenue for the past 30 days.
Which countries have the highest number of active users this month?

Claude Code translates these into BigQuery standard SQL, runs the query through Sequel, and returns results in your terminal.

What You Can Do Now

  • Revenue analysis — ask "What's the month-over-month revenue growth for each product category?"
  • User behavior — ask "What's the average session duration by device type this week?"
  • Funnel analysis — ask "What percentage of users who viewed a product page made a purchase?"
  • Schema navigation — ask "What tables are in my analytics dataset?" to orient yourself
  • Incident response — ask "Are error rates higher than usual in the past hour?" during an incident
  • Executive reporting — ask "Give me key KPIs for this quarter vs. last quarter"

Try Sequel

Meet your always-on data analyst.

Connect your database and get instant answers in plain English. Free for up to 3 seats - no credit card required.

Get started free

Frequently asked questions

Do I need a GCP service account key to connect BigQuery to Claude Code?

No. Sequel uses Google OAuth 2.0 — you authorize with your Google account directly in the browser. No JSON key files, no environment variables. Sequel requests read-only access so it can only run SELECT queries on your BigQuery data.

What credentials do I need to connect BigQuery to Sequel?

You need a Google account with access to your GCP project and BigQuery API enabled. After OAuth, you enter your GCP Project ID (e.g. my-project-123). That's it.

Will running queries through Claude Code cost me BigQuery credits?

Yes — BigQuery charges based on bytes scanned per query. Claude Code generates efficient standard SQL queries, but on very large tables you should use partition filters. You can add custom instructions to your Sequel connection to always filter by partition columns.

Can I use this with BigQuery sandbox (free tier)?

Yes. Sequel works with any BigQuery project including the free sandbox tier. The sandbox gives you 10 GB of storage and 1 TB of queries per month at no cost.

Does Claude Code support BigQuery-specific SQL features?

Yes. Claude Code generates BigQuery standard SQL (GoogleSQL), which supports all BigQuery-specific functions including ARRAY_AGG, STRUCT, window functions, partitioned table filters, and BigQuery ML.

Where do I find my GCP Project ID?

Open the Google Cloud Console at console.cloud.google.com. Your Project ID appears in the project selector at the top of the dashboard — it looks like my-company-analytics-123, not a number or display name.

Written by

Musthaq Ahamad
Musthaq Ahamad

Co-founder and CEO of Sequel. Previously built developer tools and data infrastructure. Passionate about making data accessible for everyone.