Skip to content
VS Code

Grain for VS Code

io.github.pattrnlabs/grain

Run SQL queries and inspect database schemas through safe, visible MCP tools.

client:VS Code transport:stdio runtime:npm

Install Grain in VS Code

.vscode/mcp.json

{
  "inputs": [
    {
      "type": "promptString",
      "id": "grain-connections",
      "description": "GRAIN_CONNECTIONS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "grain-mcp-safe-mode",
      "description": "GRAIN_MCP_SAFE_MODE",
      "password": true
    },
    {
      "type": "promptString",
      "id": "grain-max-rows",
      "description": "GRAIN_MAX_ROWS",
      "password": true
    }
  ],
  "servers": {
    "grain": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "grain-tools"
      ],
      "env": {
        "GRAIN_CONNECTIONS": "${input:grain-connections}",
        "GRAIN_MCP_SAFE_MODE": "${input:grain-mcp-safe-mode}",
        "GRAIN_MAX_ROWS": "${input:grain-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

Grain in other clients