execute_sql tool not working
Symptoms: The execute_sql tool returns an authentication error or is unavailable.
Cause: How you fix this depends on how you connected:
- Remote MCP with OAuth: Sign in through your MCP client when prompted. You don't need a personal access token.
- Remote MCP with token-based auth: You need a personal access token (PAT). Service tokens won't work. You also need
x-dbt-dev-environment-idandx-dbt-user-idheaders. The user ID must match the user who created the PAT. - Local MCP: Set
DBT_TOKENto a personal access token (PAT). Service tokens won't work.
Solution:
- If you use OAuth for remote MCP, confirm you completed sign-in and consent in your MCP client.
- If you use token-based auth or local MCP, create a personal access token (PAT) in Account settings → API tokens → Personal tokens.
- For token-based remote MCP, add the PAT to the
Authorizationheader asToken YOUR_PAT. For local MCP, set the PAT as yourDBT_TOKENvalue. - Also ensure
DBT_DEV_ENV_IDandDBT_USER_IDare set (local MCP) orx-dbt-dev-environment-idandx-dbt-user-idheaders are set (remote MCP). Refer to Finding your IDs for details.
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
0