MCP Postgresql Ops
M

MCP Postgresql Ops

MCP - PostgreSQL - Ops is a professional MCP server for PostgreSQL database operations and monitoring. It supports PostgreSQL versions 12 - 17 and provides comprehensive database analysis, performance monitoring, and intelligent maintenance suggestions. Database management is achieved through natural language queries.
3 points
0

What is MCP PostgreSQL Operations Server?

This is a professional PostgreSQL database management tool based on the Model Context Protocol (MCP). It allows users to monitor, analyze, and maintain PostgreSQL databases through natural language queries. It supports various database operations, including performance monitoring, table structure analysis, and query optimization suggestions.

How to use MCP PostgreSQL Operations Server?

After a simple Docker Compose deployment or direct installation of the Python package, and configuring the database connection information, you can use natural language for database queries and monitoring in clients that support the MCP protocol (such as Claude Desktop, OpenWebUI).

Use cases

Suitable for database administrators, developers, and operation and maintenance teams for daily database monitoring, performance analysis, fault troubleshooting, capacity planning, and maintenance optimization.

Main features

Zero - configuration deployment
Ready to use out of the box. Automatically detects PostgreSQL versions 12 - 17 without complex configuration.
Natural language query
Perform database operations using natural language like 'Show slow queries' or 'Analyze table bloat'.
Safe for production environments
Read - only operations, compatible with RDS/Aurora. Can run with normal user permissions.
Multi - database operations
Supports cross - database analysis and monitoring. Superusers can access all databases.
Performance monitoring
Monitors real - time database performance indicators, including connections, locks, I/O statistics, etc.
Schema analysis
In - depth analysis of database structure, table relationships, and index usage.
VACUUM intelligent analysis
Monitors the effectiveness of maintenance operations in real - time and provides optimization suggestions.
Extension enhancement
Optionally supports pg_stat_statements and pg_stat_monitor extensions, providing advanced query analysis.
Advantages
Supports all PostgreSQL versions from 12 to 17 and automatically adapts to the characteristics of different versions.
No superuser permissions are required. Basic monitoring can be performed by ordinary users.
Natural language interaction reduces the usage threshold.
Comprehensive monitoring coverage, from connection management to performance analysis.
Safe for production environments. All operations are read - only.
Limitations
Some advanced functions require the installation of PostgreSQL extensions.
Requires a network connection to the PostgreSQL server.
Some statistical functions require specific PostgreSQL configuration parameters.
Real - time performance monitoring may impose a slight load on the database.

How to use

Environment preparation
Clone the project and configure environment variables.
Start the service
Use Docker Compose to start all services.
Access OpenWebUI
Open a browser to access the OpenWebUI interface.
Configure the tool
Register the MCP tool in OpenWebUI.
Start using
Use natural language for database queries and monitoring.

Usage examples

Monitor database connections
View the current database connection status and active sessions in real - time.
Analyze query performance
Identify and optimize slow queries to improve database performance.
Check table health
Analyze table bloat to determine tables that need maintenance.
Monitor database performance
Comprehensively monitor database performance indicators.
Analyze database relationships
Explore foreign key relationships and dependencies between tables.

Frequently Asked Questions

What version of PostgreSQL is required?
Is superuser permission required?
How to install the necessary extensions?
Does it support cloud databases such as RDS/Aurora?
How to solve the 'No data found' error?
Can multiple databases be monitored?

Related resources

GitHub project repository
Complete source code and documentation
Tool usage examples
Actual usage examples with screenshots
PostgreSQL official documentation
PostgreSQL official documentation and reference guide
MCP protocol specification
Model Context Protocol official specification
OpenWebUI project
OpenWebUI chat interface project

Installation

Copy the following command to your Client for configuration
{
  "mcpServers": {
    "postgresql-ops": {
      "command": "uvx",
      "args": ["--python", "3.11", "mcp-postgresql-ops"],
      "env": {
        "POSTGRES_HOST": "127.0.0.1",
        "POSTGRES_PORT": "15432",
        "POSTGRES_USER": "postgres",
        "POSTGRES_PASSWORD": "changeme!@34",
        "POSTGRES_DB": "ecommerce"
      }
    }
  }
}

{
  "mcpServers": {
    "postgresql-ops": {
      "command": "uv",
      "args": ["run", "python", "-m", "src.mcp_postgresql_ops.mcp_main"],
      "env": {
        "PYTHONPATH": "/path/to/MCP-PostgreSQL-Ops",
        "POSTGRES_HOST": "127.0.0.1",
        "POSTGRES_PORT": "15432",
        "POSTGRES_USER": "postgres",
        "POSTGRES_PASSWORD": "changeme!@34",
        "POSTGRES_DB": "ecommerce"
      }
    }
  }
}

{
  "mcpServers": {
    "Postgresql-A": {
      "command": "uvx",
      "args": ["--python", "3.11", "mcp-postgresql-ops"],
      "env": {
        "POSTGRES_HOST": "a.foo.com",
        "POSTGRES_PORT": "5432",
        "POSTGRES_USER": "postgres",
        "POSTGRES_PASSWORD": "postgres",
        "POSTGRES_DB": "postgres"
      }
    },
    "Postgresql-B": {
      "command": "uvx",
      "args": ["--python", "3.11", "mcp-postgresql-ops"],
      "env": {
        "POSTGRES_HOST": "b.bar.com",
        "POSTGRES_PORT": "5432",
        "POSTGRES_USER": "postgres",
        "POSTGRES_PASSWORD": "postgres",
        "POSTGRES_DB": "postgres"
      }
    }
  }
}
Note: Your key is sensitive information, do not share it with anyone.

Alternatives

M
MCP Alchemy
Certified
MCP Alchemy is a tool that connects Claude Desktop to multiple databases, supporting SQL queries, database structure analysis, and data report generation.
Python
11.8K
4.2 points
P
Postgresql MCP
A PostgreSQL database MCP service based on the FastMCP library, providing CRUD operations, schema inspection, and custom SQL query functions for specified tables.
Python
13.0K
4 points
A
Awesome MCP List
This is a continuously updated curated list of MCP servers, covering multiple categories such as browser control, art and culture, cloud platforms, command - line, communication, customer data platforms, databases, developer tools, data science tools, file systems, finance and fintech, games, knowledge and memory, location services, marketing, monitoring, search, and utilities. Each project comes with a GitHub link and the number of stars, making it easy for users to quickly understand and use.
12.6K
5 points
W
Wren
Wren Engine is a semantic engine designed for MCP clients and AI agents, providing semantic layer support to enable AI to accurately understand enterprise data models and business logic. It supports multiple data sources and is embedded in MCP clients to ensure the accuracy and governance of data interaction.
Java
12.2K
4 points
M
MCP Redis
Certified
Redis MCP Server is a natural language interface service designed for Redis, supporting AI agents to query and manage Redis data through natural language, integrating the MCP protocol, and providing multiple data structures and search functions.
Python
13.5K
4.5 points
2
2344
Opik is an open-source LLM evaluation framework that supports tracking, evaluating, and monitoring LLM applications, helping developers build more efficient and cost-effective LLM systems.
TypeScript
17.3K
5 points
S
Supabase MCP Server
The Supabase MCP Server is an open - source tool that allows IDEs to securely execute SQL, manage schema changes, call the Supabase management API, and use the Auth Admin SDK, with built - in security control.
Python
13.0K
5 points
D
Dbhub
DBHub is a general database gateway that implements the Model Context Protocol (MCP) and supports connections to and operations on multiple databases.
TypeScript
10.8K
4 points
N
Notion Api MCP
Certified
A Python-based MCP Server that provides advanced to-do list management and content organization functions through the Notion API, enabling seamless integration between AI models and Notion.
Python
15.9K
4.5 points
D
Duckduckgo MCP Server
Certified
The DuckDuckGo Search MCP Server provides web search and content scraping services for LLMs such as Claude.
Python
44.7K
4.3 points
M
Markdownify MCP
Markdownify is a multi-functional file conversion service that supports converting multiple formats such as PDFs, images, audio, and web page content into Markdown format.
TypeScript
25.0K
5 points
G
Gitlab MCP Server
Certified
The GitLab MCP server is a project based on the Model Context Protocol that provides a comprehensive toolset for interacting with GitLab accounts, including code review, merge request management, CI/CD configuration, and other functions.
TypeScript
17.0K
4.3 points
U
Unity
Certified
UnityMCP is a Unity editor plugin that implements the Model Context Protocol (MCP), providing seamless integration between Unity and AI assistants, including real - time state monitoring, remote command execution, and log functions.
C#
19.4K
5 points
F
Figma Context MCP
Framelink Figma MCP Server is a server that provides access to Figma design data for AI programming tools (such as Cursor). By simplifying the Figma API response, it helps AI more accurately achieve one - click conversion from design to code.
TypeScript
45.3K
4.5 points
G
Gmail MCP Server
A Gmail automatic authentication MCP server designed for Claude Desktop, supporting Gmail management through natural language interaction, including complete functions such as sending emails, label management, and batch operations.
TypeScript
15.0K
4.5 points
M
Minimax MCP Server
The MiniMax Model Context Protocol (MCP) is an official server that supports interaction with powerful text-to-speech, video/image generation APIs, and is suitable for various client tools such as Claude Desktop and Cursor.
Python
29.9K
4.8 points
AIBase
Zhiqi Future, Your AI Solution Think Tank
© 2025AIBase