Safe-write Postgres MCP server with preview-before-execute writes and rollback safety.
Connect Runs on your machine
claude mcp add sw-postgres-mcp -e DATABASE_URL_READONLY=<DATABASE_URL_READONLY> -e DATABASE_URL_WRITER=<DATABASE_URL_WRITER> -- npx -y [email protected]
{
"mcpServers": {
"sw-postgres-mcp": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"DATABASE_URL_READONLY": "<DATABASE_URL_READONLY>",
"DATABASE_URL_WRITER": "<DATABASE_URL_WRITER>"
}
}
}
}
{
"mcpServers": {
"sw-postgres-mcp": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"DATABASE_URL_READONLY": "<DATABASE_URL_READONLY>",
"DATABASE_URL_WRITER": "<DATABASE_URL_WRITER>"
}
}
}
}
{
"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
| Name | Description |
|---|---|
DATABASE_URL_READONLYRequired, secret | Postgres connection string for the read-only role. |
DATABASE_URL_WRITERRequired, secret | Postgres connection string for the writer role. |
Details
| Package | [email protected] (NPM, stdio) |
| First published | 15 Aug 2026 |
| Last updated | 15 Aug 2026 |
| Registry name | io.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.
