About MCP-PostgreSQL-Ops
MCP-PostgreSQL-Ops is an MCP server published by call518 in the Developer Tools category: give AI assistants full PostgreSQL DBA superpowers — 30+ tools for performance analysis, bloat detection, lock/deadlock monitoring, autovacuum & schema inspection. No extensions required. PG 12-18. Conduid read 37 tools from its source: get_active_connections, get_all_tables_stats, get_async_io_status, get_autovacuum_activity, get_autovacuum_status, get_bgwriter_stats and 31 more. No package is published for it, so it installs from a source checkout.
The repository has 164 stars and 28 forks, is licensed MIT, and its last commit was on 23 Nov 2026. The latest release is 3.4.0 (9 Oct 2026): 3.4.0 Key Fix Fix explicit null handling in MCP tool arguments (#71): Updated 41 optional parameters across 28 tools to accept null. It follows 3.3.7 (30 Apr 2026), and the 4 most recent releases go back to 3.3.5 (27 Apr 2026). It passes 5 of the 6 static checks Conduid ran on the repository; it does not pass Scoped permissions. Its topics include data, management, fastmcp, database and database-management.
Install
git clone https://github.com/call518/MCP-PostgreSQL-OpsTools (37)
get_active_connections❌ Noneget_all_tables_stats[Tool Purpose]: Get comprehensive statistics for all tables (including system tables if requested)| Parameter | Type | Description |
|---|---|---|
| database_name | string | Database name to analyze (uses default database if omitted) |
| include_system | boolean | Include system tables in results (default: False) |
get_async_io_status[Tool Purpose]: Monitor asynchronous I/O subsystem status (PostgreSQL 18+)| Parameter | Type | Description |
|---|---|---|
| database_name | string | Database name (uses default if omitted) |
get_autovacuum_activity❌ None| Parameter | Type | Description |
|---|---|---|
| database_name | string | Target database name (uses default database from POSTGRES_DB env var if omitted) |
| hours_back | integer | Time period to analyze in hours (default: 24, max: 168 for 7 days) |
| limit | integer | Maximum number of tables to show (1-100, default: 50) |
| schema_name | string | Schema to analyze (analyzes all user schemas if omitted) |
get_autovacuum_status❌ None| Parameter | Type | Description |
|---|---|---|
| database_name | string | Target database name (uses default database from POSTGRES_DB env var if omitted) |
| limit | integer | Maximum number of tables to analyze (1-100, default: 50) |
| schema_name | string | Schema to analyze (analyzes all user schemas if omitted) |
| table_pattern | string | Table name pattern to filter (SQL LIKE pattern, e.g., 'user%', '%log%', 'temp_*') |
get_bgwriter_stats[Tool Purpose]: Analyze background writer and checkpoint performance statistics with version compatibilityget_current_database_info❌ None| Parameter | Type | Description |
|---|---|---|
| database_name | string | Target database to get info for (uses default connection if omitted) |
get_database_bloat_overview❌ None| Parameter | Type | Description |
|---|---|---|
| database_name | string | Target database name (uses default database from POSTGRES_DB env var if omitted) |
| limit | integer | Maximum number of schemas to show (1-50, default: 10) |
get_database_conflicts_stats❌ None| Parameter | Type | Description |
|---|---|---|
| database_name | string | Database name to analyze (uses default database if omitted) |
get_database_list❌ Noneget_database_schema_info❌ None| Parameter | Type | Description |
|---|---|---|
| database_name * | string | Database name to query (REQUIRED - specify which database to analyze) |
| schema_name | string | Specific schema name to analyze (if None, shows all schemas) |
get_database_size_info❌ Noneget_database_stats❌ Noneget_index_io_stats❌ None| Parameter | Type | Description |
|---|---|---|
| database_name | string | Database name to analyze (uses default database if omitted) |
| schema_name | string | Schema name to filter (default: public) |
get_index_usage_stats❌ None| Parameter | Type | Description |
|---|---|---|
| database_name | string | Database name to analyze (uses default database if omitted) |
get_io_stats[Tool Purpose]: Analyze comprehensive I/O statistics across all database operations with version compatibility| Parameter | Type | Description |
|---|---|---|
| database_name | string | Target database name (optional) |
| limit | integer | Maximum number of results to return (1-100, default 20) |
get_lock_monitoring❌ None| Parameter | Type | Description |
|---|---|---|
| database_name | string | Database name to analyze (uses default database if omitted) |
| granted | string | Filter by granted status ("true" or "false") |
| locktype | string | Filter by lock type ("relation", "transactionid", "virtualxid", etc.) |
| mode | string | Filter by lock mode ("AccessShareLock", "ExclusiveLock", etc.) |
| state | string | Filter by session state ("active", "idle", "idle in transaction", etc.) |
| username | string | Filter by specific username |
get_per_backend_io_stats[Tool Purpose]: Analyze per-backend I/O and WAL statistics (PostgreSQL 18+)| Parameter | Type | Description |
|---|---|---|
| database_name | string | Database name (uses default if omitted) |
| limit | integer | Maximum results (1-100, default 20) |
get_pg_stat_monitor_recent_queriesPG12: `total_time` → `total_exec_time`; PG13+: native `total_exec_time`| Parameter | Type | Description |
|---|---|---|
| database_name | string | Database name to analyze (uses default database if omitted) |
| limit | integer | Number of recent queries to retrieve (default: 20, max: 100) |
get_pg_stat_statements_top_queriesPG12: `total_time` → `total_exec_time`; PG13+: native `total_exec_time`; PG17+: `stats_since`| Parameter | Type | Description |
|---|---|---|
| database_name | string | Database name to analyze (uses default database if omitted) |
| limit | integer | Number of top queries to retrieve (default: 20, max: 100) |
get_postgresql_config❌ None| Parameter | Type | Description |
|---|---|---|
| config_name | string | Specific configuration parameter name to retrieve (shows all configs if omitted) |
| filter_text | string | Text to filter configuration names or descriptions (optional) |
get_replication_status[Tool Purpose]: Monitor PostgreSQL replication status and statisticsget_running_vacuum_operations❌ None| Parameter | Type | Description |
|---|---|---|
| database_name | string | Target database name (shows operations in all databases if omitted) |
get_server_info❌ Noneget_table_bloat_analysis❌ None| Parameter | Type | Description |
|---|---|---|
| database_name | string | Target database name (uses default database from POSTGRES_DB env var if omitted) |
| limit | integer | Maximum number of results to return (1-100, default: 20) |
| min_dead_tuples | integer | Minimum dead tuples to include in results (default: 1, shows all tables with any bloat) |
| schema_name | string | Schema to analyze (analyzes all user schemas if omitted) |
| table_pattern | string | Table name pattern to filter (SQL LIKE pattern, e.g., 'user%', '%log%', 'temp_*') |
get_table_io_stats❌ None| Parameter | Type | Description |
|---|---|---|
| database_name | string | Database name to analyze (uses default database if omitted) |
| schema_name | string | Schema name to filter (default: public) |
get_table_list❌ None| Parameter | Type | Description |
|---|---|---|
| database_name | string | Database name to query (uses currently connected database if omitted) |
get_table_relationships❌ None| Parameter | Type | Description |
|---|---|---|
| database_name * | string | Database name to query (REQUIRED - specify which database to analyze) |
| relationship_type | string | Type of relationships to show ("all", "foreign_keys", "dependencies", "inheritance") |
| schema_name | string | Schema name to search in (default: "public") |
| table_name | string | Specific table name to analyze (if None, shows database-wide relationship overview) |
get_table_schema_info❌ None| Parameter | Type | Description |
|---|---|---|
| database_name * | string | Database name to query (REQUIRED - specify which database to analyze) |
| schema_name | string | Schema name to search in (default: "public") |
| table_name | string | Specific table name to analyze (if None, shows all tables) |
get_table_size_info❌ None| Parameter | Type | Description |
|---|---|---|
| database_name | string | Database name to analyze (uses default database if omitted) |
| schema_name | string | Schema name to analyze (default: "public") |
get_user_functions_stats[Tool Purpose]: Analyze performance statistics for user-defined functions| Parameter | Type | Description |
|---|---|---|
| database_name | string | Database name to analyze (uses default database if omitted) |
get_user_list❌ Noneget_vacuum_analyze_stats❌ None| Parameter | Type | Description |
|---|---|---|
| database_name | string | Database name to analyze (uses default database if omitted) |
get_vacuum_effectiveness_analysis❌ None| Parameter | Type | Description |
|---|---|---|
| database_name | string | Target database name (uses default database from POSTGRES_DB env var if omitted) |
| limit | integer | Maximum number of tables to analyze (1-100, default: 30) |
| schema_name | string | Schema to analyze (analyzes all user schemas if omitted) |
get_wait_events[Tool Purpose]: List available wait event types and their descriptions (PostgreSQL 17+)| Parameter | Type | Description |
|---|---|---|
| database_name | string | Database name to analyze (uses default if omitted) |
| wait_event_type | string | Filter by wait event type (e.g., "Lock", "IO", "LWLock") |
get_wal_status❌ Noneget_wal_summarizer_status[Tool Purpose]: Monitor WAL summarizer status for incremental backup support (PostgreSQL 17+)| Parameter | Type | Description |
|---|---|---|
| database_name | string | Database name (uses default if omitted) |
Security checks
Static checks derived from the repository 10 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 6.7K words.
- ✓License declaredThe repository declares the MIT license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedDependency versions are pinned by uv.lock.
- ✓No dynamic code executionScanned 6 source files and found no eval, dynamic Function or shell execution.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
What the source scan found
- Transport
- stdio and Streamable HTTPsrc/mcp_postgresql_ops/mcp_main.py:4115, src/mcp_postgresql_ops/mcp_main.py:4111
- Starts other programs
- No calls that start other programs
- Outbound network calls
- No outbound network calls
- Writes or deletes files
- No file writes or deletes
- Lockfile
- uv.lock
Pattern matches on the source text of 6 files: places to read, not proof of what the code does at run time.
Releases
README
The repository's README runs to about 6.7K words, fetched a month ago. The original in the repository is authoritative.
Read full README