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
DBT_PROJECT_DIRwith the full path to your dbt project (the folder containingdbt_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
DBT_PROJECT_DIRandDBT_PATHas described above. - Save the configuration.
Custom environment variables
If you need custom environment variable configuration or prefer to use service tokens:
-
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, click this link:
Add to Cursor (with .env file)
Then update <env-file-path> with the full path to your .env file.
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.
-
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.