Integrate VS Code with MCP
Microsoft Visual Studio Code (VS Code) is a powerful and popular integrated development environment (IDE).
VS Code can connect to either the local dbt MCP server (runs on your machine, supports CLI commands like dbt run) or the remote dbt MCP server (HTTP, no install, consumption-focused). Before starting, make sure you have:
- VS Code installed with the latest updates.
- For local MCP: completed the local MCP setup and configured your dbt project paths.
- For remote MCP: your MCP URL from Account settings → Access URLs → MCP Endpoint URL in dbt platform.
Set up with local dbt MCP server
To get started, in VS Code:
-
Open the Settings menu and select the correct tab atop the page for your use case:
- Workspace: Configures the server in the context of your workspace
- User: Configures the server in the context of your user
Note for WSL users: If you're using VS Code with Windows Subsystem for Linux (WSL), you'll need to configure WSL-specific settings. Run the Preferences: Open Remote Settings command from the Command Palette (F1) or select the Remote tab in the Settings editor. Local user settings are reused in WSL but can be overridden with WSL-specific settings. Configuring MCP servers in the local user settings will not work properly in a WSL environment.
-
Select Features --> Chat
-
Ensure that MCP is Enabled
-
Open the command palette
Control/Command + Shift + P, and select either:- MCP: Open Workspace Folder MCP Configuration — if you want to install the MCP server for this workspace
- MCP: Open User Configuration — if you want to install the MCP server for the user
-
Add your server configuration (
dbt) to the providedmcp.jsonfile as one of the servers:tipYou do not need to clone the dbt-mcp repository. Install uv and run
uvx dbt-mcp(or use the config below); cloning is only for contributing. -
You can start, stop, and configure your MCP servers by:
- Running the
MCP: List Serverscommand from the Command Palette (Control/Command + Shift + P) and selecting the server. - Utilizing the keywords inline within the
mcp.jsonfile.
- Running the
Now, you can access the dbt MCP server in VS Code through interfaces like GitHub Copilot.
Set up with remote dbt MCP server
The remote dbt MCP server runs in dbt platform — no uvx or local install needed. VS Code connects to it over HTTP from the same mcp.json you use for local servers.
Remote MCP OAuth is available for Enterprise and Enterprise+ accounts. Contact your account manager to join the private beta.
-
Open the command palette (
Control/Command + Shift + P) and select one of:- MCP: Open Workspace Folder MCP Configuration — for this workspace.
- MCP: Open User Configuration — for your user.
-
Get your MCP URL:
You can copy your full MCP URL from Account settings → Access URLs → MCP Endpoint URL in dbt platform, and paste it directly into your AI tool.
-
Add a
dbtentry under the top-levelserverskey. (VS Code usesservers, notmcpServers.) Pick the tab that matches your auth method:- OAuth (remote)
- Token-based
OAuth is in private beta for Enterprise and Enterprise+ accounts.
Before you connect
- Your MCP client must support OAuth for HTTP-based MCP servers. If it doesn't, use token-based authentication instead.
- On first connect, your client opens a browser for sign-in. dbt then shows a consent screen with the scopes (the specific permissions the client is allowed to use) it's requesting — see Scopes and consent for what each scope means.
- Most modern MCP clients self-register on first connect via dynamic registration (RFC 7591). Clients that don't support it need an admin to register them in Account settings → Integrations → App integrations. See Manual registration.
For the full flow, sessions, and limitations, refer to OAuth (remote MCP).
Add the following to
mcp.json. VS Code opens a browser for sign-in and consent the first time the server connects.{
"servers": {
"dbt": {
"type": "http",
"url": "https://YOUR_DBT_HOST_URL/api/ai/v1/mcp/"
}
}
}Replace
YOUR_DBT_HOST_URLwith your hostname (for example,abc123.us1.dbt.com). You can find the URL in dbt platform under Account settings → Access URLs → MCP Endpoint URL.Use token-based auth when your client doesn't yet support OAuth for HTTP MCP servers, or when you need a shared/CI setup.
{
"servers": {
"dbt": {
"type": "http",
"url": "https://YOUR_DBT_HOST_URL/api/ai/v1/mcp/",
"headers": {
"Authorization": "Token YOUR_DBT_ACCESS_TOKEN",
"x-dbt-prod-environment-id": "DBT_PROD_ENV_ID",
"x-dbt-user-id": "DBT_USER_ID",
"x-dbt-dev-environment-id": "DBT_DEV_ENV_ID"
}
}
}
}For token-based remote MCP, set these headers in your client's MCP config:
Authorization(required) —Token YOUR_DBT_ACCESS_TOKENorBearer YOUR_DBT_ACCESS_TOKEN. Use a personal access token (PAT) or a service token with at least Semantic Layer, Metadata, and Developer permissions.x-dbt-prod-environment-id(required) — your dbt platform production environment ID. Find it on the Orchestration page.x-dbt-dev-environment-id— required forexecute_sqland Fusion tools.x-dbt-user-id— required forexecute_sql. Refer to Find your user ID.
Use numeric IDs, not full URLsHeaders like
x-dbt-prod-environment-id,x-dbt-dev-environment-id, andx-dbt-user-idexpect numeric IDs (for example,54321), not full URLs copied from your browser. The host in theurlfield, on the other hand, must includehttps://.execute_sqldoes not work with service tokens — you must use a PAT. For the complete list of headers (including tool-disable options) and the full table, refer to Set up remote MCP. -
Save the file. Use MCP: List Servers from the command palette to start the server, then ask Copilot Chat a data-related question to confirm the connection.
Troubleshooting
This section contains troubleshooting steps for errors you might encounter when integrating VS Code with MCP.
Resources
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

