That is the whole argument for this one: start it with --read-only and there is no write_query, no delete_query and no alter_table on the surface at all, so an agent cannot be talked into one. The EXPLAIN pre-check is the second layer — a CRUD statement is planned and the plan compared before it runs, which catches the accidental full-table update. Being a single Go binary means no runtime to install alongside it. The author is upfront that this is early work and adapted from a MySQL server.
A Postgres client shipped as one Go binary, with no Node.js or Python runtime to install. Ten tools split between schema work and data work, and two flags that decide how much of that surface exists at all.
- Schema inspection: the databases on the server, the tables in one, and the structure of a named table (list_database, list_table, desc_table).
- Schema changes from SQL you supply — creating a table, or altering an existing one, where the model is told not to drop a table or a column (create_table, alter_table).
- Reads and writes as separate tools rather than one execute: a read-only query, an insert returning rows affected and the last insert id, an update, and a delete (read_query, write_query, update_query, delete_query).
- A row count for a named table without writing the SQL for it (count_query).
- A read-only mode that exposes only the tools whose names begin with list, read_ or desc_ — the write tools are not present to be called.
- A query-plan check that runs EXPLAIN before a CRUD statement executes and compares the plan against the expected pattern, on by default.
- Tool descriptions localised by a language flag, currently English and Simplified Chinese, with the locale files open to additions.
The binary from a release, or `go install` if you have Go. A Postgres connection string passed as --dsn, and nothing else — no account, no key beyond your own database credentials. Stdio is the default; --t sse with --ip and --port serves it over the network instead. Two flags are worth deciding on before you start: --read-only removes every write tool, and --with-explain-check turns off the EXPLAIN pre-check that is otherwise on. Changing --read-only takes a restart of the server. The author describes the project as a work in progress and not yet ready for production.
One command plus a key — go install -v github.com/guoling2008/go-mcp-postgres@latest, then supply credentials
