Labsco
MCP SERVER

PostgreSQL MCP Server

by aadarshjain

Point an assistant at a PostgreSQL database and let it list the tables, read the schemas and run the SELECT.

Relational SQL Databases
Summary
Exploration and querying over one connection string.

Discovery, schema and query are separate tools, so an assistant can find its footing in an unfamiliar database before writing SQL against it. The statistics tool answers the other question people open a client for — what is big in here.

What it is

A PostgreSQL MCP server for database exploration and querying: it connects with a standard connection string and exposes discovery, schema, filtering and statistics as tools.

What you get
  • Every table in the connected database listed
  • Detailed schema information for any table you name
  • Custom SELECT queries executed, with results returned in structured form
  • Simple equality filtering over records, for the common case that does not need SQL written at all
  • Database statistics — size, table count and the largest tables
Requirements

Python 3.7+ with the packages in requirements.txt (mcp, pg8000, sqlalchemy). The database is addressed by a standard PostgreSQL connection string passed on the command line, which means the credentials live in your client config.