{"name":"io.github.jpka/sw-postgres-mcp","slug":"jpka-sw-postgres-mcp","title":"sw-postgres-mcp","description":"Safe-write Postgres MCP server with preview-before-execute writes and rollback safety.","url":"https://mcp.market/server/jpka-sw-postgres-mcp","rating":null,"grade":"B","score":83,"certified":false,"status":"active","category":"data","tags":["data"],"presence":{"score":23,"stars":0,"forks":0,"downloads_week":31,"last_push_at":"2026-09-04T21:10:31.000Z","license":"MIT"},"uptime":null,"claimed":false,"transport":"npm","callable_via_gateway":false,"default_price_micros":0,"repository":"https://github.com/jpka/sw-postgres-mcp","website":null,"version":"0.3.1","remotes":[],"packages":[{"registryType":"npm","identifier":"sw-postgres-mcp","version":"0.3.1","transport":{"type":"stdio"},"environmentVariables":[{"description":"Postgres connection string for the read-only role.","isRequired":true,"format":"string","isSecret":true,"name":"DATABASE_URL_READONLY"},{"description":"Postgres connection string for the writer role.","isRequired":true,"format":"string","isSecret":true,"name":"DATABASE_URL_WRITER"}]}],"tools":[{"name":"delete_rows","description":"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.","write_action":true,"price_micros":0,"input_schema":null},{"name":"describe_schema","description":"Describe the database schema: tables, columns with types, foreign keys, and row-count estimates. Respects the read allowlist in config.","write_action":false,"price_micros":0,"input_schema":null},{"name":"execute_plan","description":"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","write_action":true,"price_micros":0,"input_schema":null},{"name":"explain_plan","description":"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.","write_action":false,"price_micros":0,"input_schema":null},{"name":"insert_rows","description":"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 previewi","write_action":true,"price_micros":0,"input_schema":null},{"name":"query","description":"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.","write_action":true,"price_micros":0,"input_schema":null},{"name":"run_migration","description":"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 execut","write_action":true,"price_micros":0,"input_schema":null},{"name":"update_rows","description":"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).","write_action":true,"price_micros":0,"input_schema":null}],"scan":{"score":83,"grade":"B","scanned_at":"2026-09-23T11:53:03.176Z","report":{"scannerVersion":"0.1.9","scannedAt":"2026-09-23T11:53:03.166Z","components":{"code":{"score":25,"max":25,"notes":["38 source files scanned"]},"reliability":{"score":-1,"max":20,"notes":["no gateway calls yet and no remote to probe"]},"poisoning":{"score":-1,"max":15,"notes":["tools not inspected (local package is not executed); not counted"]},"auth":{"score":6,"max":15,"notes":["static API keys via environment variables"]},"maintenance":{"score":15,"max":15,"notes":["last push 19 days ago"]},"identity":{"score":8,"max":10,"notes":["registry namespace matches repository owner","GitHub account older than a year"]}},"findings":[],"inputs":{"packages":[{"registryType":"npm","identifier":"sw-postgres-mcp","version":"0.3.1","found":true,"license":"MIT","hasInstallScripts":false,"dependencyCount":4,"publishedAt":"2026-08-15T15:23:07.579Z","repositoryUrl":"git+https://github.com/jpka/sw-postgres-mcp.git","weeklyDownloads":31}],"repo":{"found":true,"owner":"jpka","repo":"sw-postgres-mcp","archived":false,"pushedAt":"2026-09-04T21:10:31Z","stars":0,"forks":0,"openIssues":0,"ownerType":"User","ownerAvatarUrl":"https://avatars.githubusercontent.com/u/509540?v=4","ownerCreatedAt":"2010-12-04T19:42:17Z","license":"MIT"},"icon":{"url":"https://avatars.githubusercontent.com/u/509540?v=4&s=128","source":"github"},"presence":{"stars":0,"forks":0,"downloadsWeek":31,"license":"MIT","lastPushAt":"2026-09-04T21:10:31.000Z","score":23}}}},"grade_history":[],"reviews":[]}