MCP-PostgreSQL-Ops

MCP-PostgreSQL-Ops

Professional MCP server for PostgreSQL operations, monitoring, and management using natural language queries.

124
Stars
17
Forks
0
Releases

Overview

The MCP-PostgreSQL-Ops server is a professional MCP server designed to provide PostgreSQL operations, monitoring, and management via natural language queries. It supports PostgreSQL versions 12-17 and offers comprehensive database analysis, performance monitoring, and intelligent maintenance recommendations. Most features operate independently, with advanced query analysis enhanced when optional extensions pg_stat_statements and pg_stat_monitor are installed. The server enables zero-configuration operation with automatic version detection and read-only access for safe production usage, including RDS/Aurora compatibility. It supports multi-database analysis across multiple PostgreSQL databases, cross-database query capabilities, and schema/relationship discovery. The architecture provides a suite of tools for real-time statistics, IO, bloat detection, VACUUM analysis, replication/WAL status, locks, and more. It exposes tools via a CLI or HTTP API (OpenWebUI) with a flexible MCP transport and authentication options (Bearer token for streamable-http). It is designed to be developer-friendly and easily extensible with new MCP tools. Installation can be via PyPI or from source; example flows include local testing with a built-in test container. The README also includes a compatibility matrix and detailed prerequisites for extensions and PostgreSQL configuration.

Details

Owner
call518
Language
Python
License
MIT License
Updated
2025-12-07

Features

Zero Configuration

Works with PostgreSQL 12-17 out-of-the-box with automatic version detection.

Natural Language

Ask questions like "Show me slow queries" or "Analyze table bloat" and get actionable insights.

Production Safe

Read-only operations with RDS/Aurora compatibility using regular user permissions.

Extension Enhanced

Optional pg_stat_statements and pg_stat_monitor support for advanced query analytics.

Comprehensive Database Monitoring

Performance analysis, bloat detection, and maintenance recommendations across databases.

Smart Query Analysis

Identifies slow queries and analyzes query performance with enhanced analytics.

Schema & Relationship Discovery

Explore database structure with detailed relationship mapping between tables.

VACUUM & Autovacuum Intelligence

Real-time maintenance monitoring and effectiveness analysis to guide VACUUM decisions.

Audience

DBARequests natural language queries to monitor, analyze, and maintain PostgreSQL databases.
DevOpsObserves and analyzes multi-database PostgreSQL deployments with read-only access.
Data EngineerPerforms cross-database analytics and monitoring for PostgreSQL environments.

Tags

postgresqlmcpmonitoringdatabase-analyticsread-onlynatural-languageextensionspg_stat_statementspg_stat_monitorcross-databasebloatvacuummaintenance