Skip to main content
VS Code has native MCP support through GitHub Copilot. Create .vscode/mcp.json in your project root:
.vscode/mcp.json
{
  "servers": {
    "dbhub": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "@bytebase/dbhub",
        "--transport",
        "stdio",
        "--dsn",
        "postgres://user:password@localhost:5432/dbname"
      ]
    }
  }
}

Using Input Variables

For sensitive data like passwords, use input variables:
.vscode/mcp.json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "db-dsn",
      "description": "Database connection string",
      "password": true
    }
  ],
  "servers": {
    "dbhub": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "@bytebase/dbhub",
        "--transport",
        "stdio",
        "--dsn",
        "${input:db-dsn}"
      ]
    }
  }
}

Using Config File

For multi-database setups, use a config file:
.vscode/mcp.json
{
  "servers": {
    "dbhub": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "@bytebase/dbhub",
        "--transport",
        "stdio",
        "--config",
        "${workspaceFolder}/dbhub.toml"
      ]
    }
  }
}

References