MCP MCP Server

MCP-PostgreSQL-Ops is a professional MCP server for PostgreSQL database operations, monitoring, and management. Supports PostgreSQL 12-17 with

Local serverstdioPython

What is the MCP MCP server?

MCP MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. 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.

What you get

  1. logging in to OpenWebUI with an admin account 1. go to "Settings" → "Tools" from the top menu. 1. Enter the postgresql-ops Tool address (e.g., http://localhost:8003/postgresql-ops) to connect MCP Tools. 1. Setup Ollama or OpenAI.
  • 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

Setting it up

Installation goes through your MCP client rather than a global install: point it at mcp-postgresql-ops on PyPI and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

What the assistant can call

Once MCP is connected, these are the calls the assistant has available:

  • get_server_info — ❌ None
  • get_active_connections — ❌ None
  • get_postgresql_config — ❌ None
  • get_database_list — ❌ None
  • get_table_list — ❌ None
  • get_table_schema_info — ❌ None
  • get_database_schema_info — ❌ None
  • get_table_relationships — ❌ None
  • get_user_list — ❌ None
  • get_index_usage_stats — ❌ None
  • get_database_size_info — ❌ None
  • get_table_size_info — ❌ None

Configuration and credentials

You will need 5 environment variables: POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch MCP.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the mcp mcp server does with a few real requests.

Choosing this one

This sits in the database access group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. MCP's toolset — get_server_info, get_active_connections, get_postgresql_config and 11 more — is a fair guide to whether it matches your workflow.

This entry was verified against MCP's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Available tools

ToolWhat it does
get_server_info❌ None
get_active_connections❌ None
get_postgresql_config❌ None
get_database_list❌ None
get_table_list❌ None
get_table_schema_info❌ None
get_database_schema_info❌ None
get_table_relationships❌ None
get_user_list❌ None
get_index_usage_stats❌ None
get_database_size_info❌ None
get_table_size_info❌ None
get_vacuum_analyze_stats❌ None
get_current_database_info❌ None

How to install the MCP MCP server

{
  "mcpServers": {
    "mcp-postgresql-ops": {
      "command": "uvx",
      "args": ["--python", "3.12", "mcp-postgresql-ops"],
      "env": {
        "POSTGRES_HOST": "127.0.0.1",
        "POSTGRES_PORT": "15432",
        "POSTGRES_USER": "postgres",
        "POSTGRES_PASSWORD": "changeme!@34",
        "POSTGRES_DB": "ecommerce"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
POSTGRES_HOSTEndpoint or connection string the server talks to.Optional
POSTGRES_PORTConfiguration value read at startup.Optional
POSTGRES_USERConfiguration value read at startup.Optional
POSTGRES_PASSWORDConfiguration value read at startup.Optional
POSTGRES_DBConfiguration value read at startup.Optional

Example prompts to try

  • Use MCP to get server info.
  • Use MCP to get active connections.
  • Use MCP to get postgresql config.

Frequently asked questions

It connects MCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (get_server_info, get_active_connections, get_postgresql_config, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with MCP directly.