The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
MCP PostgreSQL Ops
Give AI assistants full PostgreSQL DBA superpowers — 30+ tools for performance analysis, bloat detection, lock/deadlock monitoring, autovacuum & schema inspection. No…
Install
pip install mcp-postgresql-opsInstall command taken from the project's README or registry entry. Always review code before running it.
README excerpt
Read full README on GitHub →MCP Server for PostgreSQL Operations and Monitoring
Architecture & Internal (DeepWiki)
Overview
MCP-PostgreSQL-Ops is a professional MCP server for PostgreSQL database operations, monitoring, and management. Supports PostgreSQL 12-18 with comprehensive database analysis, performance monitoring, and intelligent maintenance recommendations through natural language queries. Most features work independently, but advanced query analysis capabilities are enhanced when pg_stat_statements and (optionally) pg_stat_monitor extensions are installed.
Features
- ✅ Zero Configuration: Works with PostgreSQL 12-18 out-of-the-box with automatic version detection.
- ✅ Natural Language: Ask questions like "Show me slow queries" or "Analyze table bloat."
- ✅ Production Safe: Read-only operations, RDS/Aurora compatible with regular user permissions.
- ✅ Extension Enhanced: Optional
pg_stat_statementsandpg_stat_monitorfor advanced query analytics. - ✅ Comprehensive Database Monitoring: Performance analysis, bloat detection, and maintenance recommendations.
- ✅ Smart Query Analysis: Slow query identification with
pg_stat_statementsandpg_stat_monitorintegration. - ✅ Schema & Relationship Discovery: Database structure exploration with detailed relationship mapping.
- ✅ VACUUM & Autovacuum Intelligence: Real-time maintenance monitoring and effectiveness analysis.
- ✅ Multi-Database Operations: Seamless cross-database analysis and monitoring.
- ✅ Enterprise-Ready: Safe read-only operations with RDS/Aurora compatibility.
- ✅ Developer-Friendly: Simple codebase for easy customization and tool extension.
🔧 Advanced Capabilities
- Version-aware I/O statistics (enhanced on PostgreSQL 16+, byte columns on PG 18+).
- Real-time connection and lock monitoring.
- Background process and checkpoint analysis.
- Replication status and WAL monitoring.
- Database capacity and bloat analysis.
- Wait event catalog with descriptions (PG 17+).
- WAL summarizer monitoring for incremental backups (PG 17+).
- Async I/O subsystem monitoring (PG 18+).
- Per-backend I/O and WAL statistics (PG 18+).
Tool Usage Examples
📸 More Examples with Screenshots →
⭐ Quickstart (5 minutes)
Note: The
postgresqlcontainer included indocker-compose.ymlis intended for quickstart testing purposes only. You can connect to your own PostgreSQL instance by adjusting the environment variables as needed.
If you want to use your own PostgreSQL instance instead of the built-in test container:
- Update the target PostgreSQL connection information in your
.envfile (see POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB).- In
docker-compose.yml, comment out (disable) thepostgresandpostgres-init-extensionscontainers to avoid starting the built-in test database.
Flow Diagram of Quickstart/Tutorial
1. Environment Setup
Note: While superuser privileges provide access to all databases and system information, the MCP server also works with regular user permissions for basic monitoring tasks.
git clone https://github.com/call518/MCP-PostgreSQL-Ops.git
cd MCP-PostgreSQL-Ops
### Check and modify .env file
cp .env.example .env
vim .env
Similar plugs
Reverse engineer anything with agents, from app behavior down to native binaries.
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)