MCP-PostgreSQL-Ops is an MCP server that connects LLM clients to PostgreSQL databases for monitoring, administration, and performance analysis. It enables database administrators, backend developers, and site reliability engineers to inspect database health and run operational tasks using plain text queries. The server supports PostgreSQL versions 12 through 18, providing automatic version adaptation without requiring complex setup. It safely performs read-only diagnostic operations, making it suitable for production environments including Amazon RDS and Aurora. Users can monitor active connections, identify slow queries, detect table and index bloat, and track autovacuum activity. While the core features rely purely on standard PostgreSQL system catalogs, the server also integrates with pg_stat_statements and pg_stat_monitor extensions to deliver detailed query execution analysis. By bridging AI assistants with database telemetry, it simplifies schema exploration, relationship discovery, and index optimization across single or multi-database environments.
Category: Databases & Data Stores
Tags: database-management, performance monitoring, postgresql, SQL
To install and run MCP-PostgreSQL-Ops using Docker Compose: 1. Clone the repository: bash git clone https://github.com/call518/MCP-PostgreSQL-Ops.git cd MCP-PostgreSQL-Ops 2. Copy the sample environment file and configure your database parameters: bash cp .env.example .env Edit .env to set POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB. 3. Start the application services: bash docker-compose up -d 4. For client integration (such as OpenWebUI), navigate to Settings > Tools and register the tool URL (for example, http://localhost:8003/postgresql-ops). Check the repository README for further MCP client configuration options: https://github.com/call518/MCP-PostgreSQL-Ops
Part of MCP Servers
You can install MCP-PostgreSQL-Ops by cloning its GitHub repository and running the provided docker-compose configuration. You configure database credentials like host, port, user, and password inside a .env file, then run docker-compose up to start the server and its proxy services.
The server inspects database schemas, tracks real-time connections, detects table bloat, monitors autovacuum operations, and identifies slow queries. It adapts to PostgreSQL versions 12 through 18 and provides detailed diagnostics using system catalogs and optional extensions like pg_stat_statements.
Yes, it is designed for production safety. The server uses read-only operations and functions with standard user permissions, making it fully compatible with managed cloud databases such as Amazon RDS and AWS Aurora without risking data modification.
No extensions are required for core features. Tools for connection tracking, table listings, schema mapping, and database size function out-of-the-box using standard system views. Installing pg_stat_statements or pg_stat_monitor is optional and only necessary for advanced query execution analysis.
Yes, MCP-PostgreSQL-Ops is open source software released under the MIT license. You can freely inspect the source code, modify it, and extend its database operations on GitHub.