PostgreSQL MCP Read-Only Query Tool
A query component of the archived PostgreSQL MCP reference server that runs SQL inside a read-only transaction and returns result rows as JSON text.
About this listing
This is the query tool inside the archived PostgreSQL MCP reference server, not a hosted database service or a separate server package. It accepts an SQL string and uses the server's configured PostgreSQL connection to execute it.
The implementation begins a read-only transaction before executing the supplied SQL, serializes the returned rows into an MCP text result, and attempts a rollback before releasing the database client. This makes the component useful to study when connecting an MCP client to existing PostgreSQL data. Read-only transactions are not a substitute for properly scoped database credentials or a security review.
The repository is archived; assess maintenance and security requirements before deployment. The source code is available under the MIT licence. Free refers to the code only: a PostgreSQL database, hosting and any separate model or infrastructure charges are not included. No hosted endpoint is provided by this listing.