Integrate Cursor with dbt MCP
Cursor is an AI-powered code editor, powered by Microsoft Visual Studio Code (VS Code).
After setting up your MCP server, you connect it to Cursor. Log in to Cursor and follow the steps that align with your use case.
Set up with local dbt MCP server
Choose your setup based on your workflow:
- OAuth for dbt platform connections
- CLI only if using dbt Core or the dbt Fusion engine locally.
- Configure environment variables if you're using them in your dbt platform account.
OAuth or CLI
Click one of the following application links with Cursor open to automatically configure your MCP server:
- CLI only (dbt Core and Fusion)
- OAuth with dbt platform
Local configuration for users who only want to use dbt CLI commands with dbt Core or dbt Fusion engine (no dbt platform features).
Add dbt Core or Fusion to Cursor
After clicking:
- Update with the full path to your dbt project (the folder containing
dbt_project.yml). - Update
DBT_PATHwith the full path to your dbt executable:- macOS/Linux: Run
which dbtin Terminal. - Windows: Run
where dbtin Command Prompt or PowerShell.
- macOS/Linux: Run
- Save the configuration.
Configuration settings for users who want OAuth authentication with the dbt platform EnterpriseEnterprise +
After clicking:
- Replace
<your-dbt-host-with-custom-subdomain>with your actual host (for example,abc123.us1.dbt.com). - (For dbt platform + CLI) Update and
DBT_PATHas described above. - Save the configuration.
Custom environment variables
Use this method if you need custom environment variables or prefer to use service tokens. Refer to the Environment variables reference for the complete list of available environment variables for the local MCP server.
-
Click the following link with Cursor open:
-
In the template, add your environment variables to the
envsection based on your needs. -
Save the configuration.
Using an .env file
If you prefer to manage environment variables in a separate file, put the .env file in your dbt project root (same folder as dbt_project.yml). Click this link:
Add to Cursor (with .env file)
Then update env-file-path with the absolute path to your .env file (for example, /absolute/path/to/your-dbt-project/.env).
Set up with remote dbt MCP server
-
Click the following application link with Cursor open:
-
Provide your URL/headers by updating the host, production environment ID, and service token in the template.
IDs are integers, not URLsDBT_PROD_ENV_ID,DBT_USER_ID, andDBT_DEV_ENV_IDmust be numeric IDs (for example,54321), not full URLs.DBT_HOSTfield accepts thehttps://prefix and without thehttps://prefix. The following are valid examples:DBT_HOST=https://ab123.us1.dbt.com
DBT_HOST=ab123.us1.dbt.com -
Save, and now you have access to the dbt MCP server!
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.