sw-postgres-mcp
Safe-write Postgres MCP server with preview-before-execute writes and rollback safety.
Connector by jpka · GitHub account verified by the MCP Registry
Chalk Labs
Need help deploying sw-postgres-mcp?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Codex, VS Code, Cursor, Windsurf, Claude Desktop. Read the repository before you give any tool access to your data.
npx agentmarket install connector/jpka-sw-postgres-mcp
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this server can do and what it asks for, from its tool list and install config. Checked Oct 25, 2026.
- Tools
- 2 read · 3 write · 2 delete · 1 not yet classified
- Secrets
- 2 (API keys, tokens or passwords)
- Install scripts
- Not scanned yet
- Runs as
- Node.js package
Tools by what they do 8
Read from the source code; the running server may list different tools.
Read 2 · Look things up without changing anything.
describe_schemaexplain_plan
Write 3 · Create, change, send or run things.
execute_planinsert_rowsupdate_rows
Delete 2 · Delete, drop, revoke or wipe things.
delete_rowsrun_migration
Not yet classified 1 · We could not tell from the name and description.
query
Secrets and settings it asks for
Secrets: values you paste in that let it act as you.
DATABASE_URL_READONLYDATABASE_URL_WRITER
Tools (8)
Read from the source code; the running server may differ. Descriptions are the server’s own words; hidden characters are shown as [U+…].
delete_rowsPreview a DELETE (two-phase). Runs the statement inside a transaction, returns the exact affected row count and a sample of affected rows, then rolls back. Nothing is changed until execute_plan is called with the returned plan_token. Requires a WHERE clause unless confirm_full_table is true.
describe_schemaDescribe the database schema: tables, columns with types, foreign keys, and row-count estimates. Respects the read allowlist in config.
execute_planExecute a previously previewed write. Pass the exact plan_token, statement, and params from the preview (delete_rows, insert_rows, update_rows, or run_migration). The token is single-use, expires, and refuses any statement that does not match the preview. For delete_rows and update_rows, it also refuses to commit if the affected row set changed since the preview; insert_rows and run_migration have no matching row set to compare (a rolled-back preview insert still consumes sequence values; DDL has no RETURNING-based row set at all), so both rely on the token's fingerprint, single-use, and expir…
explain_planReturn the planner's estimated cost and row count for a candidate read statement, without executing it. A cheap pre-check to reject obviously expensive statements before running them. Takes a `reason` string.
insert_rowsPreview an INSERT (two-phase). Runs the statement inside a transaction, returns the exact row count and a sample of inserted rows via RETURNING, then rolls back. Nothing is changed until execute_plan is called with the returned plan_token. Note: a rolled-back preview still advances any serial/identity sequence the table's columns default from — Postgres sequences are not transactional, so previewing an insert leaves a permanent gap in that column's values even though no row was actually written.
queryRun a read-only SELECT against the database and return the rows. Runs on the readonly role, so mutating statements are refused by the database. Respects the read allowlist in config. Takes a `reason` string.
run_migrationPreview a DDL migration (two-phase): CREATE TABLE, ALTER TABLE, DROP TABLE, or CREATE INDEX. Runs the statement inside a transaction, then rolls back — Postgres DDL is transactional, so nothing is changed until execute_plan is called with the returned plan_token. Unlike delete_rows/insert_rows/update_rows, run_migration ALWAYS requires human approval through the localhost approval UI before execute_plan will run it, regardless of write.approvalRequiredAboveRows/hardMaxRows — a migration affecting zero rows (e.g. adding a column) can still be highly destructive, so row count is deliberately not…
update_rowsPreview an UPDATE (two-phase). Runs the statement inside a transaction, returns the exact affected row count and a sample of affected rows (post-update) via RETURNING, then rolls back. Nothing is changed until execute_plan is called with the returned plan_token. Requires a WHERE clause unless confirm_full_table is true (the same guard delete_rows uses).
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit
- Sep 4, 2026 (1 month ago)
- Last release
- Aug 15, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- Registry name
io.github.jpka/sw-postgres-mcp- Version
- 0.3.1
- Auth
- API key
- Packages
- npm sw-postgres-mcp
- License
- MIT
- Repository
- github.com/jpka/sw-postgres-mcp
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
More from jpka
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get sw-postgres-mcp running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
sw-postgres-mcp. Agent Mart. https://agentmart.dev/connectors/jpka-sw-postgres-mcp (last updated 2026-10-24)