pg-mcp-server

MCP.Pizza Chef: stuzero

Point this at one or more Postgres databases and your assistant can find out what tables exist, read a few sample rows, and run look-only queries on your behalf. It never writes or deletes. The project has had no new commits since September 2025, so treat it as unmaintained. It also needs Python 3.13 or Docker and a database address you supply yourself, which puts it firmly in developer territory rather than something a casual user can switch on.

Unmaintained · no commits since September 2025
Coding
Data

Use This MCP server To

Ask which tables my database has and what they hold Pull a summary of last month's orders without writing queries Preview a few sample rows from a table I don't know Find out why one of my slow queries is slow Compare figures across two different databases in one conversation

README

PostgreSQL Model Context Protocol (PG-MCP) Server

A Model Context Protocol (MCP) server for PostgreSQL databases with enhanced capabilities for AI agents.

More info on the pg-mcp project here:

Overview

PG-MCP is a server implementation of the Model Context Protocol for PostgreSQL databases. It provides a comprehensive API for AI agents to discover, connect to, query, and understand PostgreSQL databases through MCP's resource-oriented architecture.

This implementation builds upon and extends the reference Postgres MCP implementation with several key enhancements:

  1. Full Server Implementation: Built as a complete server with SSE transport for production use
  2. Multi-database Support: Connect to multiple PostgreSQL databases simultaneously
  3. Rich Catalog Information: Extracts and exposes table/column descriptions from the database catalog
  4. Extension Context: Provides detailed YAML-based knowledge about PostgreSQL extensions like PostGIS and pgvector
  5. Query Explanation: Includes a dedicated tool for analyzing query execution plans
  6. Robust Connection Management: Proper lifecycle for database connections with secure connection ID handling

Features

Connection Management

  • Connect Tool: Register PostgreSQL connection strings and get a secure connection ID
  • Disconnect Tool: Explicitly close database connections when done
  • Connection Pooling: Efficient connection management with pooling

Query Tools

  • pg_query: Execute read-only SQL queries using a connection ID
  • pg_explain: Analyze query execution plans in JSON format

pg-mcp-server FAQ

Is this project still maintained?
It looks dormant. The last change landed in September 2025 and nothing has followed, so expect no fixes or new features.
Can I use this to answer questions about my company database?
Yes — you ask in plain English and it reads the answer out of Postgres for you, without changing anything.
Do I need an access key?
Not for the server itself. You hand it your database address and sign-in details once, and it gives back a short code it uses from then on.
Which apps does it work in?
Any assistant that speaks MCP. The project ships small example programs for Claude, Gemini and Ollama.
Can it change or delete my data?
No. It runs in look-only mode by default, so it can read but not touch.
How hard is setup?
Hard. You need Python 3.13 or Docker, and you run and keep the server going yourself.