Postgres
Provides a safe, read-only interface for querying PostgreSQL databases following the Model Context Protocol.
pg-mcp is a PostgreSQL Model Context Protocol (MCP) server implemented in Go, designed to offer a secure, read-only interface for PostgreSQL databases. It enables safe execution of `SELECT` or `WITH` queries, preventing any destructive write operations like `INSERT`, `UPDATE`, `DELETE`, or `DROP`. The server also provides MCP tools for listing and describing tables, and supports both stdio and HTTP transport modes for flexible integration into various systems, from CLI agents to standalone services. It comes ready for Docker deployment, simplifying setup.
Key Features
01Safe execution of `SELECT` and `WITH` queries only
02Automatic blocking of destructive SQL operations (`INSERT`, `UPDATE`, `DELETE`, `DROP`, etc.)
03Schema discovery when queries fail
04Flexible transport modes: stdio for CLI/agent integration and HTTP for service exposure
05Docker-ready with pre-built images for arm64 and amd64 architectures
060 GitHub stars
Use Cases
01Integrating PostgreSQL database access into CLI tools or external agents requiring secure, read-only interaction.
02Exposing PostgreSQL data as a controlled HTTP API for reporting, analysis, or front-end applications.
03Providing a safe sandbox for data exploration without risk of accidental modifications.