SkillAgentSearch skills...

postgres-mcp-server

๐Ÿ”„ PostgreSQL MCP Server โ€“ AI-Powered PostgreSQL Management & Monitoring. A powerful, AI-integrated PostgreSQL Model Context Protocol (MCP) server for automated database operations, monitoring, security, diagnostics, and optimization.

Install / Use

claude mcp add mukul975 -- npx -y github:mukul975/postgres-mcp-server

If the server publishes to npm under a different name, use that package instead โ€” check the repo README.

About this skill
๐Ÿ”Œ

MCP Server

Model Context Protocol server

Quality Score

72/100

Category

Security

Supported Platforms

Claude Code
Claude Desktop

Our assessment of postgres-mcp-server

postgres-mcp-server scores 72/100 on our quality scale, 1057th of 1,119 Security skills we index.

Its MCP Server is 23 KB long, well organised into 43 sections with 6 code examples: a thorough specification that gives an agent plenty to work with.

It has 10 GitHub stars, so there is little community track record yet; judge it on its content.

Substance
30/30
Structure
20/20
Description
15/15
Adoption
4/20
Freshness
11/15

Maintenance, license and trust

  • The repository was last updated about 7 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
  • It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 91/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit โ€” read the skill file before letting an agent act on it.

postgres-mcp-server compared with similar skills

All 4 of these similar skills score higher than postgres-mcp-server; compare them before choosing.

SkillScoreStarsUpdatedFormat
postgres-mcp-server (this skill)by mukul97572107mo agoMCP Server
claude-memby thedotmack10099.7ktodayCLAUDE.md
Agent-Reachby Panniantong10095.9k3d agoCLAUDE.md
headroomby headroomlabs-ai10075.1k1d agoCLAUDE.md
CowAgentby zhayujie10047.3ktodayCLAUDE.md

Frequently asked questions

How do I install postgres-mcp-server?
Run claude mcp add mukul975 -- npx -y github:mukul975/postgres-mcp-server. The install tabs above show the steps for each supported agent.
Which AI agents does postgres-mcp-server work with?
It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
Is postgres-mcp-server safe to use?
It is MIT-licensed and scores 91/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is postgres-mcp-server still maintained?
The repository was last updated about 7 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.

๐Ÿ”„ PostgreSQL MCP Server โ€“ AI-Powered PostgreSQL Management & Monitoring

A powerful, AI-integrated PostgreSQL Model Context Protocol (MCP) server for automated database operations, monitoring, security, diagnostics, and optimization. Seamlessly manage PostgreSQL with tools and prompts designed for AI assistants like Claude and ChatGPT.

Python License: MIT PostgreSQL MCP

GitHub Repository: https://github.com/mukul975/postgres-mcp-server.git


๐Ÿ“Œ Why Use This?

  • ๐Ÿ” Explore, diagnose & optimize PostgreSQL databases with over 200 specialized tools.
  • ๐Ÿ’ฌ Interact naturally using AI prompts for SQL generation, health checks, and performance reviews.
  • ๐Ÿ›ก๏ธ Built-in security, permission validation, and error handling.
  • โš™๏ธ Developer-ready integration for Claude, ChatGPT, and custom agents.

๐Ÿ”‘ Features at a Glance

๐Ÿ”ง Core Database Operations

  • โœ… Create/list databases & schemas
  • โœ… Describe tables, analyze indexes
  • โœ… Safe SELECT, UPDATE, DELETE execution

๐Ÿ“Š Monitoring & Performance

  • ๐Ÿ“ˆ Query performance & execution plan insights
  • ๐Ÿ”’ Lock analysis, replication lag checks
  • ๐Ÿš€ Index, query, and buffer pool optimization

๐Ÿ›ก๏ธ Security & Access Control

  • ๐Ÿ‘ฅ User creation, role auditing
  • ๐Ÿ” Privilege granting & connection monitoring

โš™๏ธ Diagnostic Utilities

  • ๐Ÿงช Table bloat check, autovacuum insights
  • ๐Ÿ’ฝ WAL logs, checkpoints, long transaction alerts

๐Ÿ“š Tool Categories

To help you navigate, tools are grouped under the following main categories:

  • ๐Ÿ”ง General Database Operations
  • ๐Ÿ‘ฅ User & Role Management
  • ๐Ÿ“ˆ Performance Monitoring & Tuning
  • ๐Ÿ” Replication & Backup
  • ๐Ÿ”’ Lock & Concurrency Management
  • โœ… Constraint & Integrity Management
  • ๐Ÿ“Š Resource and Activity Monitoring
  • ๐Ÿงฐ Index and Table Maintenance
  • ๐Ÿ”ฌ Advanced Analysis & Diagnostics

๐Ÿš€ Quick Start

1. Installation

python -m venv venv
source venv/bin/activate   # or venv\Scripts\activate on Windows
pip install -r requirements.txt

2. Configuration

cp .env.example .env  # or use copy on Windows
# Update with:
DATABASE_URL=postgresql://username:password@localhost:5432/db

3. Run the Server

python postgres_server.py

โœ… For MCP CLI users:

mcp dev postgres_server.py

๐Ÿง  Integrate with Claude Desktop

Example config (claude_desktop_config.json):

<details> <summary>Windows</summary>
{
  "mcpServers": {
    "postgres": {
      "command": "python",
      "args": ["postgres_server.py"],
      "cwd": "C:\\path\\to\\postgres-mcp-server",
      "env": {
        "DATABASE_URL": "postgresql://username:password@localhost:5432/database"
      }
    }
  }
}
</details> <details> <summary>macOS/Linux</summary>
{
  "mcpServers": {
    "postgres": {
      "command": "python",
      "args": ["postgres_server.py"],
      "cwd": "/absolute/path/to/postgres-mcp-server",
      "env": {
        "DATABASE_URL": "postgresql://username:password@localhost:5432/database"
      }
    }
  }
}
</details>

๐Ÿ” Tool Search & Complete Reference (238 Tools)

๐Ÿ”Ž Tool Search Bar

Quick Tool Finder: Use Ctrl+F (or Cmd+F) to search for specific tools by name, category, or functionality.

๐Ÿ“Š Tools by Category Overview

| Category | Count | Description | |----------|-------|-------------| | ๐Ÿงฑ Core Database | 26 | Basic database operations, schema management | | ๐Ÿ‘ฅ User & Security | 18 | User management, roles, permissions | | ๐Ÿ“ˆ Performance | 45 | Monitoring, analysis, optimization | | ๐Ÿ”’ Locks & Concurrency | 22 | Lock analysis, blocking queries, deadlocks | | ๐Ÿ› ๏ธ Maintenance | 28 | VACUUM, ANALYZE, table maintenance | | ๐Ÿ“Š Index Management | 15 | Index creation, analysis, optimization | | ๐Ÿ”„ Replication & Backup | 20 | Replication monitoring, backup status | | ๐Ÿ“‹ Table Operations | 25 | Table statistics, constraints, data | | ๐Ÿ“ฆ Extensions & Objects | 18 | Extensions, functions, triggers | | โš™๏ธ Configuration | 12 | Settings, variables, system info | | ๐Ÿงช Advanced Analysis | 29 | Deep diagnostics, predictions, recommendations |


๐Ÿ“š Complete Tool Reference

๐Ÿงฑ Core Database Operations (25 tools)

<details> <summary>Click to expand Core Database tools</summary>
  • PostgreSQL_analyze_database - Run ANALYZE on entire database
  • PostgreSQL_create_schema - Create new database schema
  • PostgreSQL_describe_table - Get detailed table information
  • PostgreSQL_drop_schema - Drop database schema
  • PostgreSQL_execute_select_query - Execute SELECT queries
  • PostgreSQL_execute_update_query - Execute INSERT/UPDATE/DELETE
  • PostgreSQL_explain_query - Show query execution plan
  • PostgreSQL_get_database_config - Get database configuration
  • PostgreSQL_get_database_growth_trend - Analyze database growth
  • PostgreSQL_get_database_size - Get database size information
  • PostgreSQL_get_database_size_by_tablespace - Size by tablespace
  • PostgreSQL_get_estimated_row_counts - Get estimated row counts
  • PostgreSQL_get_server_version - Get PostgreSQL version info
  • PostgreSQL_get_table_count - Get row count of table
  • PostgreSQL_get_table_size - Get table size information
  • PostgreSQL_get_table_size_summary - Comprehensive table sizes
  • PostgreSQL_get_tablespace_info - Get tablespace information
  • PostgreSQL_get_tablespace_usage - Tablespace usage statistics
  • PostgreSQL_list_databases - List all databases
  • PostgreSQL_list_schemas - List all schemas
  • PostgreSQL_list_tables - List tables in schema
  • PostgreSQL_list_views - List views in schema
  • PostgreSQL_use_database - Switch to different database
  • PostgreSQL_vacuum_analyze_table - VACUUM ANALYZE table
  • PostgreSQL_kill_connection - Terminate database connection
</details>

๐Ÿ‘ฅ User & Security Management (18 tools)

<details> <summary>Click to expand User & Security tools</summary>
  • PostgreSQL_create_user - Create database user/role
  • PostgreSQL_drop_user - Drop database user/role
  • PostgreSQL_get_column_privileges - Get column-level privileges
  • PostgreSQL_get_role_attributes - Get role attributes and details
  • PostgreSQL_get_table_permissions - Get table permissions
  • PostgreSQL_grant_privileges - Grant table privileges
  • PostgreSQL_list_roles_with_login - List roles with login capability
  • PostgreSQL_list_roles_with_superuser - List superuser roles
  • PostgreSQL_list_users_and_roles - List all users and roles
  • PostgreSQL_revoke_privileges - Revoke table privileges
  • PostgreSQL_security_audit - Basic security audit
  • PostgreSQL_get_active_connections - Get active connections
  • PostgreSQL_get_connection_limits - Connection limits and usage
  • PostgreSQL_get_connection_pool_stats - Connection pool statistics
  • PostgreSQL_get_idle_connections - Find idle connections
  • PostgreSQL_connection_churn_analysis - Analyze connection patterns
  • PostgreSQL_get_concurrent_connection_analysis - Concurrent connections
  • PostgreSQL_analyze_connection_pool_efficiency - Pool efficiency
</details>

๐Ÿ“ˆ Performance Monitoring & Analysis (45 tools)

<details> <summary>Click to expand Performance tools</summary>
  • PostgreSQL_analyze_query_complexity - Analyze query complexity
  • PostgreSQL_buffer_cache_hit_ratio - Cache hit ratios
  • PostgreSQL_check_long_running_queries - Find long-running queries
  • PostgreSQL_get_active_transactions - Get active transactions
  • PostgreSQL_get_buffer_cache_contents - Buffer cache contents
  • PostgreSQL_get_buffer_hit_ratios_detailed - Detailed hit ratios
  • PostgreSQL_get_cache_hit_ratio - Cache hit ratios
  • PostgreSQL_get_cache_hit_ratios - Buffer and index cache ratios
  • PostgreSQL_get_checkpoint_analysis - Checkpoint analysis
  • PostgreSQL_get_checkpoint_info - Checkpoint information
  • PostgreSQL_get_checkpoint_stats - Checkpoint statistics
  • PostgreSQL_get_column_statistics - Column statistics
  • PostgreSQL_get_long_running_transactions - Long transactions
  • PostgreSQL_get_memory_context_analysis - Memory context analysis
  • PostgreSQL_get_memory_usage_stats - Memory usage statistics
  • PostgreSQL_get_query_error_analysis - Query error analysis
  • PostgreSQL_get_query_plan_cache_analysis - Query plan cache
  • PostgreSQL_get_query_plan_cache_stats - Plan cache statistics
  • PostgreSQL_get_query_plans - Query execution plans
  • PostgreSQL_get_query_runtime_distribution - Query runtime stats
  • PostgreSQL_get_slow_queries - Get slow queries
  • PostgreSQL_get_slow_query_patterns - Slow query patterns
  • PostgreSQL_get_slow_query_statements - Slow query statements
  • PostgreSQL_get_table_access_patterns - Table access patterns
  • PostgreSQL_get_table_io_stats - Table I/O statistics
  • PostgreSQL_get_table_statistics - Table statistics
  • PostgreSQL_get_temp_file_stats - Temporary file statistics
  • PostgreSQL_get_temp_files - Temporary file usage
  • PostgreSQL_get_top_heavy_queries - Top resource-heavy queries
  • PostgreSQL_get_transaction_age_monitoring - Transaction age monitoring
  • PostgreSQL_get_wait_events - Current wait events
  • PostgreSQL_analyze_advanced_buffer_usage - Advanced buffer analysis
  • PostgreSQL_buffer_cache_relation_analysis - Buffer cache per relation
  • PostgreSQL_checkpoint_activity - Detailed checkpoint activity
  • PostgreSQL_connection_pool_stats - Connection pool stats
  • PostgreSQL_get_connection_pool_analysis - Connection pool analysis
  • PostgreSQL_get_performance_regression_indicators - Performance regression
  • PostgreSQL_high_io_tables - High I/O tables
  • PostgreSQL_memory_usage_analysis - Memory usage analysis
  • PostgreSQL_table_io_patterns - Table I/O patterns
  • PostgreSQL_temp_file_usage - Temporary file usage monitoring
  • PostgreSQL_temporary_objects_usage - Temporary objects analysis
  • PostgreSQL_active_temp_file_users - Active temp file users
  • PostgreSQL_get_high_wait_events - High wait events
  • PostgreSQL_query_cancellation_analysis - Query cancellation analysis
</details>

๐Ÿ”’ Locks & Concurrency Management (22 tools)

<details> <summary>Click to expand Lock & Concurrency tools</summary>
  • PostgreSQL_check_blocking_queries - Get blocking queries
  • PostgreSQL_detect_conflicting_queries - Detect conflicting queries
  • PostgreSQL_detect_foreign_key_lock_contention - FK lock contention
  • PostgreSQL_detect_index_lock_waits - Index lock waits
  • PostgreSQL_foreign_key_conflicts - Foreign key conflicts
  • PostgreSQL_get_blocking_locks - Blocking and blocked queries
  • PostgreSQL_get_lock_monitoring - Monitor current locks
  • PostgreSQL_get_lock_statistics - Lock statistics with wait times
  • PostgreSQL_get_lock_waits - Current lock waits
  • PostgreSQL_get_locks_info - Current database locks
  • PostgreSQL_deadlock_analysis - Deadlock history and patterns
  • PostgreSQL_analyze_foreign_key_locks - Foreign key lock analysis
  • PostgreSQL_predicate_lock_analysis - Predicate lock analysis
  • PostgreSQL_longest_idle_transactions - Longest idle transactions
  • PostgreSQL_long_running_prepared_transactions - Long prepared transactions
  • PostgreSQL_orphaned_prepared_transactions - Orphaned prepared transactions
  • PostgreSQL_prepared_transaction_retention - Prepared transaction retention
  • PostgreSQL_get_prepared_transactions - Get prepared transactions
  • PostgreSQL_analyze_transaction_wraparound - Transaction wraparound
  • PostgreSQL_detect_transaction_wraparound_risk - Wraparound risk
  • `PostgreSQL_transaction_wraparound

Truncated for display โ€” read the full file on GitHub.

Related Skills

View on GitHub
GitHub Stars10
CategorySecurity
Updated7mo ago
Forks10

Languages

Python

Trust signals

91/100

From repository metadata: license, adoption, age and documentation. Not a code audit โ€” see the Safety scan above for what the skill file itself contains.

1 low1 info
postgres-mcp-server โ€” MCP Server: Install & Safety Check | SkillAgent