Skip to main content

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:

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:

  1. Update DBT_PROJECT_DIR with the full path to your dbt project (the folder containing dbt_project.yml).
  2. Update DBT_PATH with the full path to your dbt executable:
    • macOS/Linux: Run which dbt in Terminal.
    • Windows: Run where dbt in Command Prompt or PowerShell.
  3. Save the configuration.

Custom environment variables

If you need custom environment variable configuration or prefer to use service tokens:

  1. Click the following link with Cursor open:

    Add to Cursor

  2. In the template, add your environment variables to the env section based on your needs.

  3. 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

  1. Click the following application link with Cursor open:

    Add to Cursor

  2. Provide your URL/headers by updating the host, production environment ID, and service token in the template.

  3. 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.

0