Setting up BigQuery connection — I'll configure and test a connection to your source Google BigQuery project. I'll need a few connection details.
Prerequisites
A Google Cloud project with BigQuery enabled and the datasets you want to migrate
A service account JSON key with read access to the source data and catalog (INFORMATION_SCHEMA)
The service account granted roles/bigquery.dataViewer, roles/bigquery.jobUser, and roles/bigquery.readSessionUser on the project
The scai CLI installed and available
Required Connection Details
Service Account Auth (only auth method supported in MVP)
Parameter
Required
Description
-s, --source-connection
Yes
Friendly name for this source connection
--auth
Yes
service-account
--project-id
Yes
GCP project ID that owns the datasets and runs the queries
--dataset
No
Default dataset to scope discovery to (all datasets in the project if omitted)
--credentials-file
Yes
Path to the service account JSON key file
--location
No
Dataset location / region (e.g. US, EU, us-central1)
--connection-timeout
No
Connection timeout in seconds
BigQuery has no host or port to configure — the worker reaches the BigQuery API over HTTPS on port 443, and TLS is always enforced by the endpoint. BigQuery is read through the google-cloud-bigquery client (BigQuery Storage Read API), which stages Parquet — there is no ODBC install required on the worker host.
Workflow
Step 1: Ask How to Provide Credentials
Ask the user:
"I need the following to connect to BigQuery:
GCP project ID
Service account JSON key file (path)
Default dataset (optional)
Location (optional, e.g. US)
How would you like to provide these?"
Options:
1Password — Credentials stored in 1Password vault
Enter manually — Provide values directly
Step 2: Route Based on Answer
User says
Action
"1Password"
Follow ../1PASSWORD.md (BigQuery section)
"Enter manually"
Proceed to Step 3
Other credential manager
Check if ../references/<NAME>.md exists; if not, ask user to explain their setup
Omit --dataset to scope discovery to the whole project.
Omit --location unless your datasets live in a specific region and auto-detection fails.
Step 4: Save and Test Source Connection
Call the configure tool with source_connection set to <CONNECTION_NAME>. The MCP server runs scai connection test internally and only persists the connection if the test passes.
On success: the response includes connection_test: ok.
On failure: the tool returns an error containing the scai message. Surface it to the user, help them fix the issue, then re-run configure(source_connection=<CONNECTION_NAME>).
Common errors:
Error
Cause
Solution
Could not automatically determine credentials
Missing / wrong key file
Verify the --credentials-file path points to a valid service account JSON key
403 Access Denied / does not have permission
Missing IAM role
Grant roles/bigquery.dataViewer + roles/bigquery.jobUser (+ readSessionUser) on the project
404 Not found: Dataset ...
Wrong project or dataset
Verify the project ID and dataset name (and location)
invalid_grant / Reauthentication is needed
Expired / revoked key
Re-issue the service account key and re-add the connection
CHECKPOINT
Confirm with user:
configure returned connection_test: ok
Connection appears in scai connection list -l bigquery --json
Source connection saved to session config
On Completion
After the CHECKPOINT passes, tell the user:
Connection configured — Successfully connected to BigQuery using connection <connection_name>.
Then return to the calling skill.
Security Rules
NEVER log or display secrets (service account keys) in plain text.
NEVER include secrets in command-line arguments that might be logged. Prefer a credential manager (e.g. 1Password op run, or use /secrets capability from Cortex Code to store them). Pass the key as a file path, not inline JSON.
configure(source_connection=NAME) (runs the test internally)
List connections
scai connection list -l bigquery --json
Set default
scai connection set-default -l bigquery -c NAME
Extract code
scai code extract -s NAME --json
1---2name: bigquery-connection3description: BigQuery Connection Skill4---56# BigQuery Connection Skill78## On Entry910Tell the user:11> **Setting up BigQuery connection** — I'll configure and test a connection to your source Google BigQuery project. I'll need a few connection details.1213## Prerequisites1415- A Google Cloud project with BigQuery enabled and the datasets you want to migrate16- A service account JSON key with read access to the source data and catalog (`INFORMATION_SCHEMA`)17- The service account granted `roles/bigquery.dataViewer`, `roles/bigquery.jobUser`, and `roles/bigquery.readSessionUser` on the project18- The `scai` CLI installed and available1920## Required Connection Details2122### Service Account Auth (only auth method supported in MVP)2324| Parameter | Required | Description |25|-----------|----------|-------------|26| `-s, --source-connection` | Yes | Friendly name for this source connection |27| `--auth` | Yes | `service-account` |28| `--project-id` | Yes | GCP project ID that owns the datasets and runs the queries |29| `--dataset` | No | Default dataset to scope discovery to (all datasets in the project if omitted) |30| `--credentials-file` | Yes | Path to the service account JSON key file |31| `--location` | No | Dataset location / region (e.g. `US`, `EU`, `us-central1`) |32| `--connection-timeout` | No | Connection timeout in seconds |3334> BigQuery has no host or port to configure — the worker reaches the BigQuery API over HTTPS on port `443`, and TLS is always enforced by the endpoint. BigQuery is read through the `google-cloud-bigquery` client (BigQuery Storage Read API), which stages Parquet — there is no ODBC install required on the worker host.3536## Workflow3738### Step 1: Ask How to Provide Credentials3940Ask the user:41> "I need the following to connect to BigQuery:42> - **GCP project ID**43> - **Service account JSON key file** (path)44> - **Default dataset** (optional)45> - **Location** (optional, e.g. `US`)46>47> How would you like to provide these?"4849Options:501. **1Password** — Credentials stored in 1Password vault512. **Enter manually** — Provide values directly5253### Step 2: Route Based on Answer5455| User says | Action |56|-----------|--------|57| "1Password" | Follow `../1PASSWORD.md` (BigQuery section) |58| "Enter manually" | Proceed to Step 3 |59| Other credential manager | Check if `../references/<NAME>.md` exists; if not, ask user to explain their setup |6061### Step 3: Add the Connection6263```bash64scai connection add-bigquery \65 -s <CONNECTION_NAME> \66 --auth service-account \67 --project-id <GCP_PROJECT_ID> \68 --dataset <DATASET> \69 --credentials-file <PATH_TO_SERVICE_ACCOUNT_JSON> \70 --location <LOCATION>71```7273- Omit `--dataset` to scope discovery to the whole project.74- Omit `--location` unless your datasets live in a specific region and auto-detection fails.7576### Step 4: Save and Test Source Connection7778Call the `configure` tool with `source_connection` set to `<CONNECTION_NAME>`. The MCP server runs `scai connection test` internally and only persists the connection if the test passes.7980- **On success:** the response includes `connection_test: ok`.81- **On failure:** the tool returns an error containing the scai message. Surface it to the user, help them fix the issue, then re-run `configure(source_connection=<CONNECTION_NAME>)`.8283**Common errors:**8485| Error | Cause | Solution |86|-------|-------|----------|87| `Could not automatically determine credentials` | Missing / wrong key file | Verify the `--credentials-file` path points to a valid service account JSON key |88| `403 Access Denied` / `does not have permission` | Missing IAM role | Grant `roles/bigquery.dataViewer` + `roles/bigquery.jobUser` (+ `readSessionUser`) on the project |89| `404 Not found: Dataset ...` | Wrong project or dataset | Verify the project ID and dataset name (and location) |90| `invalid_grant` / `Reauthentication is needed` | Expired / revoked key | Re-issue the service account key and re-add the connection |9192## CHECKPOINT9394Confirm with user:95- [ ] `configure` returned `connection_test: ok`96- [ ] Connection appears in `scai connection list -l bigquery --json`97- [ ] Source connection saved to session config9899## On Completion100101After the CHECKPOINT passes, tell the user:102> **Connection configured** — Successfully connected to BigQuery using connection `<connection_name>`.103104Then return to the calling skill.105106## Security Rules107108- **NEVER** log or display secrets (service account keys) in plain text.109- **NEVER** include secrets in command-line arguments that might be logged. Prefer a credential manager (e.g. 1Password `op run`, or use /secrets capability from Cortex Code to store them). Pass the key as a file path, not inline JSON.110111## Quick Reference112113| Action | Command |114|--------|---------|115| Add connection | `scai connection add-bigquery -s NAME --auth service-account --project-id PROJECT --credentials-file KEY.json` |116| Test connection | `configure(source_connection=NAME)` (runs the test internally) |117| List connections | `scai connection list -l bigquery --json` |118| Set default | `scai connection set-default -l bigquery -c NAME` |119| Extract code | `scai code extract -s NAME --json` |
Run npx skillmds@latest add snowflake-labs/bigquery-connection in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
BigQuery Connection Skill It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
snowflake-labs (@snowflake-labs) published this skill. Their other Agent Skills are listed on their SkillMD profile.