sw-postgres MCP Server
by jpkaio.github.jpka/sw-postgres-mcpv0.3.1
Safe-write Postgres MCP server with preview-before-execute writes and rollback safety.
context tax
queued
security
queued
cold start
queued
freshness
Maintained35d ago
Install sw-postgres MCP server
Install in Claude Code
claude mcp add sw-postgres -e DATABASE_URL_READONLY='<database-url-readonly>' -e DATABASE_URL_WRITER='<database-url-writer>' -- npx -y sw-postgres-mcpInstall in Cursor
{
"mcpServers": {
"sw-postgres": {
"command": "npx",
"args": [
"-y",
"sw-postgres-mcp"
],
"env": {
"DATABASE_URL_READONLY": "<database-url-readonly>",
"DATABASE_URL_WRITER": "<database-url-writer>"
}
}
}
}Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).
Install in Claude Desktop
{
"mcpServers": {
"sw-postgres": {
"command": "npx",
"args": [
"-y",
"sw-postgres-mcp"
],
"env": {
"DATABASE_URL_READONLY": "<database-url-readonly>",
"DATABASE_URL_WRITER": "<database-url-writer>"
}
}
}
}Settings → Developer → Edit Config (claude_desktop_config.json), then restart.
Install in VS Code
{
"servers": {
"sw-postgres": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"sw-postgres-mcp"
],
"env": {
"DATABASE_URL_READONLY": "<database-url-readonly>",
"DATABASE_URL_WRITER": "<database-url-writer>"
}
}
}
}Add to .vscode/mcp.json in your workspace.
Install in Windsurf
{
"mcpServers": {
"sw-postgres": {
"command": "npx",
"args": [
"-y",
"sw-postgres-mcp"
],
"env": {
"DATABASE_URL_READONLY": "<database-url-readonly>",
"DATABASE_URL_WRITER": "<database-url-writer>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json.
Configuration
| Variable | Required | Secret | Description |
|---|---|---|---|
| DATABASE_URL_READONLY | yes | yes | Postgres connection string for the read-only role. |
| DATABASE_URL_WRITER | yes | yes | Postgres connection string for the writer role. |
Freshness
Maintained — last maintenance signal 35d ago. The newest of the signals below sets the band.
Last commit (default branch)
2026-09-04 · 35d ago · GitHub
Latest release
no data · GitHub
Package published
no data · npm/PyPI
Registry entry updated
2026-08-15 · 55d ago · official registry · v0.3.1
FAQ
›How do I install the sw-postgres MCP server in Claude Code?
Run: claude mcp add sw-postgres -e DATABASE_URL_READONLY='<database-url-readonly>' -e DATABASE_URL_WRITER='<database-url-writer>' -- npx -y sw-postgres-mcp. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.
›Does sw-postgres require an API key?
Yes. It expects DATABASE_URL_READONLY, DATABASE_URL_WRITER, of which 2 are secrets.
›Can I use sw-postgres as a remote (hosted) MCP server?
No hosted endpoint is published; it runs locally over stdio.
›Is sw-postgres in the official MCP registry?
Yes, as io.github.jpka/sw-postgres-mcp.
Alternatives to sw-postgres
Other database MCP servers.