Price Per TokenPrice Per Token
MCP-PostgreSQL-Ops

MCP-PostgreSQL-Ops

by call518

GitHub 137 865 uses Remote
0

About

MCP-PostgreSQL-Ops is a PostgreSQL database monitoring and operations tool that enables natural language diagnostics across PostgreSQL 12-17 databases. Key features of MCP-PostgreSQL-Ops: - Natural language queries for diagnosing slow queries, table bloat, replication lag, WAL health, and database locks. - Schema discovery with detailed relationship mapping and database structure exploration. - Intelligent maintenance monitoring including VACUUM effectiveness and autovacuum analysis. - Multi-database operations for seamless cross-database monitoring and analysis. - Production-safe read-only operations compatible with AWS RDS/Aurora using standard user permissions. - Enhanced query analytics when pg_stat_statements and pg_stat_monitor extensions are installed. - Real-time monitoring for connections, locks, background processes, and checkpoint statistics.

README

MCP Server for PostgreSQL Operations and Monitoring

[](https://opensource.org/licenses/MIT)

[](https://smithery.ai/server/@call518/mcp-postgresql-ops) [](https://www.buymeacoffee.com/call518)

[](https://github.com/call518/MCP-PostgreSQL-Ops/actions/workflows/pypi-publish.yml)

---

Architecture & Internal (DeepWiki)

[](https://deepwiki.com/call518/MCP-PostgreSQL-Ops)

---

Overview

MCP-PostgreSQL-Ops is a professional MCP server for PostgreSQL database operations, monitoring, and management. Supports PostgreSQL 12-17 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-17 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_statements and pg_stat_monitor for advanced query analytics.
  • Comprehensive Database Monitoring: Performance analysis, bloat detection, and maintenance recommendations.
  • Smart Query Analysis: Slow query identification with pg_stat_statements and pg_stat_monitor integration.
  • 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+).
  • Real-time connection and lock monitoring.
  • Background process and checkpoint analysis.
  • Replication status and WAL monitoring.
  • Database capacity and bloat analysis.
  • Tool Usage Examples

    📸 More Examples with Screenshots →

    ---

    ---

    ---

    ⭐ Quickstart (5 minutes)

    > Note: The postgresql container included in docker-compose.yml is 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 .env file (see POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB). > - In docker-compose.yml, comment out (disable) the postgres and postgres-init-extensions containers 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

    ### No need to modify defaults, but if using your own PostgreSQL server, edit below:
    POSTGRES_HOST=host.docker.internal
    POSTGRES_PORT=15432  # External port for host access (mapped to internal 5432)
    POSTGRES_USER=postgres
    POSTGRES_PASSWORD=changeme!@34
    POSTGRES_DB=ecommerce # Default connection DB. Superusers can access all DBs.
    

    > Note: PGDATA=/data/db is preconfigured for the Percona PostgreSQL Docker image, which requires this specific path for proper w

    Related MCP Servers

    AI Research Assistant

    AI Research Assistant

    hamid-vakilzadeh

    AI Research Assistant provides comprehensive access to millions of academic papers through the Semantic Scholar and arXiv databases. This MCP server enables AI coding assistants to perform intelligent literature searches, citation network analysis, and paper content extraction without requiring an API key. Key features include: - Advanced paper search with multi-filter support by year ranges, citation thresholds, field of study, and publication type - Title matching with confidence scoring for finding specific papers - Batch operations supporting up to 500 papers per request - Citation analysis and network exploration for understanding research relationships - Full-text PDF extraction from arXiv and Wiley open-access content (Wiley TDM token required for institutional access) - Rate limits of 100 requests per 5 minutes with options to request higher limits through Semantic Scholar

    Web & Search
    12 8
    Linkup

    Linkup

    LinkupPlatform

    Linkup is a real-time web search and content extraction service that enables AI assistants to search the web and retrieve information from trusted sources. It provides source-backed answers with citations, making it ideal for fact-checking, news gathering, and research tasks. Key features of Linkup: - Real-time web search using natural language queries to find current information, news, and data - Page fetching to extract and read content from any webpage URL - Search depth modes: Standard for direct-answer queries and Deep for complex research across multiple sources - Source-backed results with citations and context from relevant, trustworthy websites - JavaScript rendering support for accessing dynamic content on JavaScript-heavy pages

    Web & Search
    2 24
    Math-MCP

    Math-MCP

    EthanHenrickson

    Math-MCP is a computation server that enables Large Language Models (LLMs) to perform accurate numerical calculations through the Model Context Protocol. It provides precise mathematical operations via a simple API to overcome LLM limitations in arithmetic and statistical reasoning. Key features of Math-MCP: - Basic arithmetic operations: addition, subtraction, multiplication, division, modulo, and bulk summation - Statistical analysis functions: mean, median, mode, minimum, and maximum calculations - Rounding utilities: floor, ceiling, and nearest integer rounding - Trigonometric functions: sine, cosine, tangent, and their inverses with degrees and radians conversion support

    Developer Tools
    22 81