Skip to Content
dbmcp

VS Code

Add dbmcp to VS Code with the one-click install buttons or in .vscode/mcp.json

One-click install

VS Code asks for the backend, host, user, password, and database name when you install. The password prompt hides its input.

Install in VS Code Install in VS Code Insiders

The buttons add the npx entry from below, with an input for each DBMCP_DB_* value.

Manual setup

Add the server to .vscode/mcp.json in your workspace, or to your user profile with MCP: Open User Configuration. VS Code uses servers, not mcpServers, and prompts for each ${input:...} value on first start:

.vscode/mcp.json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "db-password",
      "description": "Database password",
      "password": true
    }
  ],
  "servers": {
    "dbmcp": {
      "type": "stdio",
      "command": "dbmcp",
      "args": [],
      "env": {
        "DBMCP_DB_BACKEND": "mysql",
        "DBMCP_DB_HOST": "127.0.0.1",
        "DBMCP_DB_USER": "root",
        "DBMCP_DB_PASSWORD": "${input:db-password}",
        "DBMCP_DB_NAME": "mydb"
      }
    }
  }
}

For a server you started with DBMCP_TRANSPORT=http:

.vscode/mcp.json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "dbmcp-token",
      "description": "dbmcp bearer token",
      "password": true
    }
  ],
  "servers": {
    "dbmcp": {
      "type": "http",
      "url": "http://127.0.0.1:9001/mcp",
      "headers": { "Authorization": "Bearer ${input:dbmcp-token}" }
    }
  }
}

On this page