Database · Monitoring

MCP PostgreSQL Ops

call518/mcp-postgresql-ops

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.

Install

uvx --python 3.12 mcp-postgresql-ops

Client configuration

{
  "mcpServers": {
    "mcp-postgresql-ops": {
      "command": "uvx",
      "args": [
        "--python",
        "3.12",
        "mcp-postgresql-ops"
      ],
      "env": {
        "POSTGRES_HOST": "<POSTGRES_HOST>",
        "POSTGRES_PORT": "<POSTGRES_PORT>",
        "POSTGRES_USER": "<POSTGRES_USER>",
        "POSTGRES_PASSWORD": "<POSTGRES_PASSWORD>",
        "POSTGRES_DB": "<POSTGRES_DB>"
      }
    }
  }
}

Environment variables

POSTGRES_HOSTPOSTGRES_PORTPOSTGRES_USERPOSTGRES_PASSWORDPOSTGRES_DBREMOTE_SECRET_KEY
Author
@call518
Category
Database, Monitoring
License
MIT
Updated
Oct 6, 2026

About MCP PostgreSQL Ops

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_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.

Tools (40)

  • Enterprise-Ready

    Safe read-only operations with RDS/Aurora compatibility.

  • Developer-Friendly

    Simple codebase for easy customization and tool extension.

  • PostgreSQL

    container starts first with database initialization

  • OpenWebUI

    container starts last and may take additional time to load the web interface

  • ecommerce

    E-commerce system

  • analytics

    Analytics & reporting

  • inventory

    Warehouse management

  • hr_system

    HR management

  • get_server_info

    version(), pg_extension

  • get_active_connections

    pg_stat_activity

  • get_postgresql_config

    pg_settings

  • get_database_list

    pg_database

  • get_table_list

    information_schema.tables

  • get_table_schema_info

    information_schema.*, pg_indexes

  • get_database_schema_info

    pg_namespace, pg_class, pg_proc

  • get_table_relationships

    information_schema.* (constraints)

  • get_user_list

    pg_user, pg_roles

  • get_index_usage_stats

    pg_stat_user_indexes

  • get_database_size_info

    pg_database_size()

  • get_table_size_info

    pg_total_relation_size()

  • get_vacuum_analyze_stats

    Enhanced

  • get_current_database_info

    pg_database, current_database()

  • get_table_bloat_analysis

    pg_stat_user_tables

  • get_database_bloat_overview

    pg_stat_user_tables

  • get_autovacuum_status

    pg_stat_user_tables

  • get_autovacuum_activity

    pg_stat_user_tables

  • get_running_vacuum_operations

    pg_stat_activity

  • get_vacuum_effectiveness_analysis

    pg_stat_user_tables

  • get_lock_monitoring

    pg_locks, pg_stat_activity

  • get_wal_status

    pg_current_wal_lsn()

  • get_database_stats

    Enhanced

  • get_table_io_stats

    pg_statio_user_tables

  • get_index_io_stats

    pg_statio_user_indexes

  • get_database_conflicts_stats

    pg_stat_database_conflicts

  • get_io_stats

    Enhanced

  • get_bgwriter_stats

    Special

  • get_replication_status

    Compatible

  • get_all_tables_stats

    Compatible

  • get_user_functions_stats

    Config Required

  • get_wait_events

    Fallback

Details on this page are taken from the project's README. Open README

Supported clients

Clients mentioned in this server's README:

View all
Claude Desktop logo

Claude Desktop

Desktop · Freemium · Proprietary

Anthropic's official Claude AI desktop application. Supports MCP servers to extend functionality.

WindowsMacOS

Related MCP servers

More servers
Supabase MCP logo

Supabase MCP

supabase-community/supabase-mcp

1.3k

The Model Context Protocol (MCP) standardizes how Large Language Models (LLMs) talk to external services like Supabase. It connects AI assistants directly with your Supabase project and allows them to perform tasks like managing tables, fetching config, and querying data. See the full list of tools.

Database
Genai Toolbox logo

Genai Toolbox

googleapis/genai-toolbox

769

MCP Toolbox for Databases is an open source Model Context Protocol (MCP) server that connects your AI agents, IDEs, and applications directly to your enterprise databases.

Database
Supabase MCP Server logo

Supabase MCP Server

alexander-zuev/supabase-mcp-server

677

Query MCP is an open-source MCP server that lets your IDE safely run SQL, manage schema changes, call the Supabase Management API, and use Auth Admin SDK — all with built-in safety controls.

Database
Awesome MCP List logo

Awesome MCP List

MobinX/awesome-mcp-list

645

This is a continuously updated curated list of MCP servers, covering categories such as browser control, arts and culture, cloud platforms, command line, communication, customer data platforms, databases, developer tools, data science tools, file systems, finance and fintech, gaming, knowledge and memory, location services, marketing, monitoring, search and utilities. Each project includes a GitHub link and star count for quick reference and use.

Database
PostgreSQL Model Context Protocol (PG MCP) Server logo

PostgreSQL Model Context Protocol (PG MCP) Server

stuzero/pg-mcp-server

440

PG-MCP is a server implementation of the Model Context Protocol for PostgreSQL databases. It provides a comprehensive API for AI agents to discover, connect to, query, and understand PostgreSQL databases through MCP's resource-oriented architecture.

Database
dbhub logo

dbhub

bytebase/dbhub

332

[!NOTE] If you need an enterprise-level database MCP server with built-in guardrails like approval flow, access control, data masking, and audit logging beyond what DBHub offers, check out Bytebase.

Database