Skip to content
Agentmart
Submit a tool

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

IndexedMITLocal (stdio)
Write a review

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.

We use your email only for this newsletter. Privacy

About

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

No 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_schema
  • explain_plan

Write 3 · Create, change, send or run things.

  • execute_plan
  • insert_rows
  • update_rows

Delete 2 · Delete, drop, revoke or wipe things.

  • delete_rows
  • run_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_READONLY
  • DATABASE_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_rows

    Preview 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_schema

    Describe the database schema: tables, columns with types, foreign keys, and row-count estimates. Respects the read allowlist in config.

  • execute_plan

    Execute 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_plan

    Return 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_rows

    Preview 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.

  • query

    Run 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_migration

    Preview 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_rows

    Preview 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
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from jpka

Cite this page

sw-postgres-mcp. Agent Mart. https://agentmart.dev/connectors/jpka-sw-postgres-mcp (last updated 2026-10-24)