guide10 min read

Claude Code + Snowflake/BigQuery/dbt: Integration Patterns for Data Teams

Specific MCP integration patterns with examples

Claude Code + Snowflake/BigQuery/dbt is an integration pattern where Claude Code connects to cloud warehouses and dbt through MCP servers — enabling natural-language schema exploration, automated dbt model generation, cost optimization, and end-to-end pipeline management from a single conversation grounded in your real data.

The modern data stack runs on three pillars: a cloud warehouse, a transformation layer, and AI-powered operations. Connecting Claude Code to Snowflake, BigQuery, and dbt via MCP unlocks workflows that were previously impossible. This article provides specific integration patterns, code examples, and architecture guidance for data teams connecting these tools to Claude Code through Data Workers.

Each tool in the modern data stack has its own interface, authentication model, and mental model. Snowflake has its web UI and SQL worksheet. BigQuery has its console and bq CLI. dbt has its CLI, Cloud IDE, and manifest files. Data engineers spend significant time switching between these interfaces, copying context from one to another, and keeping mental models synchronized. MCP eliminates this by giving Claude Code native access to all three.

Snowflake + Claude Code: Integration Patterns

The Snowflake MCP server connects Claude Code to your Snowflake account, exposing warehouse operations as callable tools. Here are the most valuable integration patterns:

Pattern 1: Natural Language Schema Exploration. Instead of writing SHOW SCHEMAS IN DATABASE, SHOW TABLES IN SCHEMA, and DESCRIBE TABLE commands, tell Claude Code: 'Show me all tables related to customer payments in the analytics database.' The agent uses the Snowflake MCP server to explore schemas, reads column names and comments, filters for relevance, and returns a structured summary — including relationships it infers from column names and foreign keys.

Pattern 2: Query Generation with Cost Awareness. Ask Claude to generate a query, and it writes the SQL. But with the Snowflake MCP server, it can also estimate the query cost before execution using Snowflake's dry-run capability. 'Write a query for monthly revenue by product line — but keep it under $1 in compute.' Claude generates the query, checks the cost estimate, and optimizes if it exceeds the threshold (adding column pruning, partition filters, or materialization suggestions).

Pattern 3: Performance Diagnosis. 'Why is the nightly aggregation query slow?' Claude queries QUERY_HISTORY, identifies the problematic query, reads its execution plan via GET_QUERY_PLAN, identifies bottlenecks (spill to remote storage, full table scans, join explosions), and recommends specific optimizations — clustering keys, materialized views, or warehouse size adjustments.

Snowflake ToolMCP FunctionExample Use
SHOW SCHEMAS/TABLESlist_schemas, list_tables'What tables exist in the raw schema?'
DESCRIBE TABLEdescribe_table'What columns does orders have and what types?'
SELECT queriesexecute_query'How many orders shipped last week?'
QUERY_HISTORYget_query_history'What were the most expensive queries yesterday?'
RESOURCE_MONITORSget_resource_usage'How much compute have we used this month?'
INFORMATION_SCHEMAget_table_statistics'How large is the events table and when was it last updated?'

BigQuery + Claude Code: Integration Patterns

BigQuery's MCP integration follows similar patterns but leverages BigQuery-specific features: slot-based pricing, INFORMATION_SCHEMA views, and native ML capabilities.

Pattern 1: Cost-Optimized Querying. BigQuery charges per byte scanned. The BigQuery MCP server exposes a dry_run tool that returns estimated bytes before execution. Claude automatically runs a dry run before any query and reports the cost. For tables with clustering and partitioning, Claude generates queries that leverage these features to minimize scan costs — adding partition filters and selecting only needed columns.

Pattern 2: Cross-Dataset Discovery. Large BigQuery deployments have hundreds of datasets across multiple projects. Claude Code connected to the BigQuery MCP server can search across all datasets: 'Find all tables that contain customer email addresses.' The agent queries INFORMATION_SCHEMA.COLUMNS across datasets, filters for email-like column names (email, email_address, user_email), and returns a map of where PII lives in your warehouse.

Pattern 3: Slot Usage and Reservation Management. 'Are we using our reserved slots efficiently?' Claude queries INFORMATION_SCHEMA.JOBS to analyze slot utilization over time, identifies queries that consume disproportionate slots, and recommends reservation adjustments or query optimizations to reduce contention.

dbt + Claude Code: Integration Patterns

The dbt MCP server is where Claude Code becomes a true data engineering partner. dbt's project structure, manifest, and testing framework give Claude rich context for generating, modifying, and validating transformation logic.

Pattern 1: Model Generation from Requirements. 'Create a dbt model that calculates customer lifetime value as the sum of all order amounts, grouped by customer, with a 12-month rolling window.' Claude reads your existing dbt project structure (from the manifest), follows your naming conventions (from CLAUDE.md and existing models), generates the SQL with appropriate ref() calls, writes the schema YAML with tests, and runs dbt compile to validate.

Pattern 2: Lineage-Aware Refactoring. 'Rename the column user_id to customer_id in stg_orders.' This is not a simple find-and-replace. Claude uses the dbt manifest to trace every downstream model that references stg_orders.user_id, updates all references, regenerates documentation, runs dbt test to verify nothing broke, and presents the full change set for review.

Pattern 3: Test Coverage Expansion. 'Add tests to all models in the marts/finance directory that are currently untested.' Claude reads the dbt manifest to identify untested models, analyzes the SQL logic to determine which tests are appropriate (not_null for required fields, unique for primary keys, accepted_values for status columns, relationships for foreign keys), generates the schema YAML entries, and runs the tests to verify they pass.

dbt ToolMCP FunctionExample Use
dbt runrun_model'Run the customer_ltv model and its dependencies'
dbt testtest_model'Test all models in the staging schema'
dbt compilecompile_model'Compile this model so I can see the raw SQL'
dbt lslist_models'List all models tagged as finance'
manifest.jsonget_lineage'What models depend on stg_orders?'
dbt docsget_model_docs'Show me the documentation for fct_revenue'

Cross-Tool Integration: Where the Real Power Lives

Individual tool integrations are useful. Cross-tool integrations are transformative. When Claude Code has simultaneous access to Snowflake (or BigQuery), dbt, and Data Workers, it can execute workflows that span the entire data lifecycle:

  • End-to-end debugging. 'The finance dashboard is showing wrong revenue numbers.' Claude traces from the dashboard back through dbt models to the source table in Snowflake, identifies where the discrepancy originates, and proposes a fix — all in one conversation.
  • Automated impact analysis. 'We are adding a new column to the customers table in Snowflake.' Claude checks every dbt model that references that table, every downstream dashboard, and every metric definition that might be affected, then generates a migration plan.
  • Cost-performance optimization. Claude analyzes Snowflake query history to find expensive queries, traces them to the dbt models that generate them, identifies optimization opportunities (materializations, clustering, incremental models), and implements the changes.
  • Semantic layer enforcement. Claude reads metric definitions from dbt's semantic layer, validates that warehouse queries match those definitions, and flags any ad-hoc queries that calculate metrics differently from the governed definitions.

Data Workers: Unified Agent Layer for Snowflake, BigQuery, and dbt

Data Workers provides 15 specialized MCP agents that are pre-integrated with Snowflake, BigQuery, and dbt. Instead of configuring individual MCP servers for each tool, you connect Data Workers and get coordinated agents that understand the relationships between your warehouse, your transformation layer, and your operational tools.

The Schema Agent understands both Snowflake and BigQuery schemas and can compare across warehouses. The Query Agent generates SQL optimized for your specific warehouse platform. The Quality Agent runs validation queries that leverage warehouse-specific features (Snowflake time travel, BigQuery table snapshots). The Pipeline Agent manages dbt runs and monitors their interaction with warehouse resources.

Each agent is Apache 2.0 licensed and works within Claude Code, Cursor, and VS Code. The agents share context through file-based memory — when the Schema Agent discovers a table relationship in Snowflake, the Query Agent uses that knowledge to generate better joins, and the Documentation Agent updates the catalog. This shared intelligence across tools and agents is what delivers the $1.3 million+ annual savings that Data Workers teams report.

Snowflake, BigQuery, and dbt are the foundation of the modern data stack. Claude Code + MCP is the layer that connects them. Data Workers is the agent swarm that operates them. Together, they transform your data stack from a collection of tools you operate into an infrastructure that operates itself. Book a demo to see these integration patterns in action with your specific stack, or visit the documentation for setup guides and code examples.

Go from data platform to
agentic platform.

With autonomous AI agents working across your entire data stack — MCP-native, open-source, deployed in minutes.

Book a Demo →

Related Resources