Install and setup

PGSandbox MCP is designed for local MCP clients via npm, npx, or Homebrew. It needs an admin Postgres connection that can create databases and roles.

npm

npm install -g pgsandbox-mcp
pgsandbox-mcp setup --client codex --admin-url postgres://postgres:postgres@localhost:5432/postgres

npx

npx -y pgsandbox-mcp setup --client codex --admin-url postgres://postgres:postgres@localhost:5432/postgres

For npx, edit the generated MCP config to pin a version or replace it after installing globally.

Homebrew

brew tap LVTD-LLC/tap
brew install pgsandbox-mcp
pgsandbox-mcp setup --client codex --admin-url postgres://postgres:postgres@localhost:5432/postgres

Supported clients

pgsandbox-mcp setup --client codex --admin-url "$PGSANDBOX_ADMIN_DATABASE_URL"
pgsandbox-mcp setup --client cursor --scope project --admin-url "$PGSANDBOX_ADMIN_DATABASE_URL"
pgsandbox-mcp setup --client vscode --scope project --admin-url "$PGSANDBOX_ADMIN_DATABASE_URL"
pgsandbox-mcp setup --client claude-desktop --admin-url "$PGSANDBOX_ADMIN_DATABASE_URL"
pgsandbox-mcp setup --client all --admin-url "$PGSANDBOX_ADMIN_DATABASE_URL"

Verify

pgsandbox-mcp doctor
pgsandbox-mcp smoke-test

Restart your MCP client after setup. In Codex, run /mcp to verify the pgsandbox server is available.