Integrate VS Code with MCP beta
Microsoft Visual Studio Code (VS Code) is a powerful and popular integrated development environment (IDE).
These instructions are for integrating dbt MCP and VS Code. 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 or MCP: Open User Configuration, depending on whether you want to install the MCP server for this workspace or all workspaces for the user. -
Add your server configuration (
dbt
) to the providedmcp.json
file as one of the servers:
- Local MCP server
- Remote MCP server
{
"servers": {
"dbt": {
"command": "uvx",
"args": [
"--env-file",
"<path-to-.env-file>",
"dbt-mcp"
]
}
}
}
<path-to-.env-file>
is where you saved the .env
file from the Setup step
{
"mcpServers": {
"dbt": {
"url": "https://<host>/api/ai/v1/mcp/",
"headers": {
"Authorization": "token <token>",
"x-dbt-prod-environment-id": "<prod-id>",
}
}
}
}
- You can start, stop, and configure your MCP servers by:
- Running the
MCP: List Servers
command from the Command Palette (Control/Command + Shift + P) and selecting the server. - Utilizing the keywords inline within the
mcp.json
file.
Now you will be able to access the local dbt MCP server on VS Code through interfaces like GitHub Copilot.
Resources
- Microsoft VS Code MCP docs.