Skip to content
VS Code

SQL Preview for VS Code

io.github.fadnavismehul/sql-preview

Run governed SQL queries and inspect database schemas from MCP agents.

client:VS Code transport:stdio runtime:npm

Install SQL Preview in VS Code

.vscode/mcp.json

{
  "inputs": [
    {
      "type": "promptString",
      "id": "sql-preview-connections",
      "description": "SQL_PREVIEW_CONNECTIONS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "sql-preview-mcp-safe-mode",
      "description": "SQL_PREVIEW_MCP_SAFE_MODE",
      "password": true
    },
    {
      "type": "promptString",
      "id": "sql-preview-max-rows",
      "description": "SQL_PREVIEW_MAX_ROWS",
      "password": true
    }
  ],
  "servers": {
    "sql-preview": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "sql-preview"
      ],
      "env": {
        "SQL_PREVIEW_CONNECTIONS": "${input:sql-preview-connections}",
        "SQL_PREVIEW_MCP_SAFE_MODE": "${input:sql-preview-mcp-safe-mode}",
        "SQL_PREVIEW_MAX_ROWS": "${input:sql-preview-max-rows}"
      }
    }
  }
}

VS Code prompts for each input the first time the server starts, so no secret is written to the file. VS Code docs

SQL Preview in other clients