Skip to main content

dbt MCP FAQs and troubleshooting

Find answers to common questions about the dbt Model Context Protocol (MCP) server and fixes for common setup issues. For client-specific steps, see the troubleshooting sections in the Get started and Setup and config pages.

FAQs​

The execute_sql tool in the dbt MCP server lets your AI assistant run SQL in your warehouse. These FAQs cover how it works and what its limits are.

 What does execute_sql do?

execute_sql lets your AI assistant run a SQL query against your data warehouse and read the results. It's part of the SQL toolset and runs on dbt platform, so you don't need dbt installed locally.

Here's what happens when your assistant calls it:

  1. The assistant writes a SQL query and calls execute_sql.
  2. The dbt MCP server forwards the request to dbt platform, along with your token, development environment ID, and user ID.
  3. dbt platform compiles the SQL (including any Jinja, such as ref()) and runs it in your warehouse using your development credentials.
  4. The results come back to your assistant as a table.
The AI assistant calls execute_sql. The dbt MCP server forwards the request to dbt platform, which compiles the SQL, runs it in the warehouse with your development credentials, and returns the results to the assistant.The AI assistant calls execute_sql. The dbt MCP server forwards the request to dbt platform, which compiles the SQL, runs it in the warehouse with your development credentials, and returns the results to the assistant.
 Is execute_sql the same as dbt show?

No. dbt show runs through the dbt platform CLI tools and previews a model's output while you develop. execute_sql sends SQL to dbt platform, which runs it in your warehouse.

 Whose warehouse credentials does execute_sql use?

Your personal development credentials for the project's development environment. These are the same credentials you use in Studio IDE. It doesn't use your production deployment credentials.

If you don't have development credentials, the query fails with a message that no warehouse credentials are configured. Ask a project admin to set them up.

 Is execute_sql read-only?

No. execute_sql doesn't block write statements. What a query can do depends on the permissions of the warehouse credentials it runs with. If those credentials can create or drop tables, so can your assistant.

To keep things safe:

  • Use least-privilege warehouse roles. Give each user's development credentials read-only access to production-like data and write access only to their own development schema.
  • Keep tool approval prompts on. Your assistant then asks before running SQL, so you can review it first.
  • Don't count on disabling the tool as a security control. You can turn off execute_sql with the x-dbt-disable-tools header, but whoever configures the MCP client sets it, so admins can't enforce it. Warehouse permissions are the control that holds.
 Who can use execute_sql?

Anyone with a developer seat or a read-only seat, as long as they connect with OAuth or a personal access token (PAT). Service tokens don't work because development credentials belong to a person.

Read-only seats can run plain SQL. SQL that contains Jinja, like ref() or source(), needs a developer seat.

For setup details, see Set up remote MCP.

 Why doesn't ref() point to my development tables?

Even though the query runs with your development credentials, ref('model') resolves to the production relation. It can't point to a table you built in your own development schema.

To query a development table, use its full name instead, for example my_dev_schema.my_model. Avoid source() too, and use full table names or ref() instead.

 Are there limits on query size or run time?

Yes. Long-running queries time out, and dbt caps large result sets. Add filters and limit clauses to keep queries small and fast.

 Can I see results as a chart or table?

Yes you can! Your AI tool can ask for results to show as a chart or table in the UI. Otherwise, only your assistant sees the results.

 When should I use something other than execute_sql?
If you want to...Use
Ask governed business questions with defined metricsThe Semantic Layer tools, like query_metrics
Preview a model's output while you developdbt platform CLI tools, like show, build, and run
Turn a question into SQL without running ittext_to_sql

Troubleshooting​

Can't find the uvx executable
OAuth login not initiating
Server not starting
Configuration not working in WSL (VS Code)
execute_sql tool not working
Toolset unavailable or showing as disabled
Pasting full URLs instead of IDs
Multi-cell or static subdomain account connection issues
Claude Desktop errors
Claude Code can't connect to the dbt MCP server
The connector won't authorize or the OAuth flow fails
The agent returns no metrics or empty results
Permission errors when creating the integration or MCP server

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

0
Loading