NestDaddy

sw-postgres-mcp

io.github.jpka/sw-postgres-mcp · v0.3.1

Safe-write Postgres MCP server with preview-before-execute writes and rollback safety.

Connect Runs on your machine

Terminal
claude mcp add sw-postgres-mcp -e DATABASE_URL_READONLY=<DATABASE_URL_READONLY> -e DATABASE_URL_WRITER=<DATABASE_URL_WRITER> -- npx -y [email protected]
claude_desktop_config.json
{
  "mcpServers": {
    "sw-postgres-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "DATABASE_URL_READONLY": "<DATABASE_URL_READONLY>",
        "DATABASE_URL_WRITER": "<DATABASE_URL_WRITER>"
      }
    }
  }
}
~/.cursor/mcp.json
{
  "mcpServers": {
    "sw-postgres-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "DATABASE_URL_READONLY": "<DATABASE_URL_READONLY>",
        "DATABASE_URL_WRITER": "<DATABASE_URL_WRITER>"
      }
    }
  }
}
.vscode/mcp.json
{
  "servers": {
    "sw-postgres-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "DATABASE_URL_READONLY": "<DATABASE_URL_READONLY>",
        "DATABASE_URL_WRITER": "<DATABASE_URL_WRITER>"
      }
    }
  }
}

Replace the values in angle brackets with your own. Keys stay on your machine; we never see them.

Tools

This server runs locally, so its tools are listed by your MCP client once it starts.

Environment variables

NameDescription
DATABASE_URL_READONLY
Required, secret
Postgres connection string for the read-only role.
DATABASE_URL_WRITER
Required, secret
Postgres connection string for the writer role.

Details

Package[email protected] (NPM, stdio)
First published15 Aug 2026
Last updated15 Aug 2026
Registry nameio.github.jpka/sw-postgres-mcp

More databases servers See all

Listing data from the official MCP registry. Status and tools from NestDaddy's daily check. Browse all MCP servers.