Labsco
MCP SERVER

MCP PostgreSQL Server

by antonorlov

Run parameterised SELECTs and separate write statements against a PostgreSQL database, and read its schemas and table structure before you do.

Relational SQL DatabasesVerified
Summary
The read/write split is in the tool name, so an approval policy can act on it.

query runs SELECT and execute runs INSERT, UPDATE and DELETE, which puts the distinction where a reviewer of tool calls can see it instead of inside an SQL string. The default connection comes from configuration and connect_db is the exception — its own description says to reach for it only when asked or when other commands fail. Schema exploration exists before any SQL is written, which matters on a database nobody on the call has seen.

What it is

A PostgreSQL client of 6 tools that takes its connection from the environment and keeps reads and writes on separate tools.

What you get
  • Parameterised reads through query, which takes the SQL text and a params array.
  • Writes through execute, covering INSERT, UPDATE and DELETE.
  • Schema discovery — list_schemas across the database, list_tables within a schema, describe_table for one table's structure.
  • A connection that is already in place from configuration, with connect_db available to point the session at a different host or database.
Requirements

A reachable PostgreSQL database, addressed by PG_HOST, PG_PORT, PG_USER, PG_PASSWORD and PG_DATABASE.

Setup effort

One command plus a key — npx mcp-postgres-server, then supply credentials