# PostgreSQL Ops MCP server

> Lets AI assistants inspect a PostgreSQL database read-only for slow queries, locks, bloat, VACUUM, indexes, replication, and WAL.

- Repository: https://github.com/call518/MCP-PostgreSQL-Ops
- Page: https://hostedmcp.org/servers/call518/mcp-postgresql-ops
- Transport: —
- Stars: 164
- License: MIT

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `DEFAULT_MODEL_PARAMS` | no | no |  |
| `POSTGRES_DB` | no | no |  |
| `POSTGRES_HOST` | no | no |  |
| `POSTGRES_PASSWORD` | no | no |  |
| `POSTGRES_PORT` | no | no |  |
| `POSTGRES_USER` | no | no |  |
| `REMOTE_AUTH_ENABLE` | no | no |  |
| `REMOTE_SECRET_KEY` | no | no |  |

## Tools (37)

- `get_server_info`
- `get_active_connections`
- `get_postgresql_config`
- `get_database_list`
- `get_table_list`
- `get_table_schema_info`
- `get_database_schema_info`
- `get_table_relationships`
- `get_user_list`
- `get_index_usage_stats`
- `get_database_size_info`
- `get_table_size_info`
- `get_vacuum_analyze_stats`
- `get_current_database_info`
- `get_table_bloat_analysis`
- `get_database_bloat_overview`
- `get_autovacuum_status`
- `get_autovacuum_activity`
- `get_running_vacuum_operations`
- `get_vacuum_effectiveness_analysis`
- `get_lock_monitoring`
- `get_wal_status`
- `get_database_stats`
- `get_table_io_stats`
- `get_index_io_stats`
- `get_database_conflicts_stats`
- `get_io_stats`
- `get_bgwriter_stats`
- `get_replication_status`
- `get_all_tables_stats`
- `get_user_functions_stats`
- `get_wait_events`
- `get_wal_summarizer_status`
- `get_async_io_status`
- `get_per_backend_io_stats`
- `get_pg_stat_statements_top_queries`
- `get_pg_stat_monitor_recent_queries`

## FAQ

### What can I ask the PostgreSQL MCP server?

You can ask natural-language questions like which tables need VACUUM, which queries use the most time, or which sessions are blocked, and the server runs predefined read-only queries.

### Can this MCP server modify my database?

No, all tools are read-only and it does not run arbitrary SQL or data-changing operations.

### Does it require PostgreSQL extensions?

Core monitoring works without extensions, though pg_stat_statements and pg_stat_monitor add query analytics.

### Which PostgreSQL versions are supported?

It supports PostgreSQL 12 through 18 and adapts to version-specific views automatically.

### How do I connect it to Claude Desktop?

Download the .mcpb extension from GitHub Releases and install it via Settings → Extensions, then enter your PostgreSQL connection details.
