<h3>A Postgres MCP server with index tuning, explain plans, health checks, and safe sql execution.</h3>
Postgres MCP Pro does much more than wrap a database connection.
Everything the assistant can do here goes through one of these:
list_schemas — Lists all database schemas available in the PostgreSQL instancelist_objects — Lists database objects (tables, views, sequences, extensions) within a specified schemaget_object_details — Provides information about a specific database object, for example, a table's columns, constraints, and indexesexecute_sql — Executes SQL statements on the database, with read-only limitations when connected in restricted modeexplain_query — Gets the execution plan for a SQL query describing how PostgreSQL will process it and exposing the query planner's cost model. Can be invoked withget_top_queries — Reports the slowest SQL queries based on total execution time using pg_stat_statements dataanalyze_workload_indexes — Analyzes the database workload to identify resource-intensive queries, then recommends optimal indexes for themanalyze_query_indexes — Analyzes a list of specific SQL queries (up to 10) and recommends optimal indexes for themanalyze_db_health — Performs comprehensive health checks including: buffer cache hit rates, connection health, constraint validation, index healthPrerequisites — Before getting started, ensure you have: 1. Access credentials for your database. 2. Docker or Python 3.12 or higherInstallation — Choose one of the following methods to install Postgres MCP Pro:Installation goes through your MCP client rather than a global install: point it at postgres-mcp 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.
You will need one environment variable: DATABASE_URI. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.
Before getting started, ensure you have: 1. Access credentials for your database. 2. Docker or Python 3.12 or higher.
Among the database access options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Postgres MCP's toolset — list_schemas, list_objects, get_object_details and 8 more — is a fair guide to whether it matches your workflow. It is maintained by crystaldba; worth a glance at recent repository activity before you build anything load-bearing on it.
This entry was verified against Postgres MCP's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.
| Tool | What it does |
|---|---|
| list_schemas | Lists all database schemas available in the PostgreSQL instance. |
| list_objects | Lists database objects (tables, views, sequences, extensions) within a specified schema. |
| get_object_details | Provides information about a specific database object, for example, a table's columns, constraints, and indexes. |
| execute_sql | Executes SQL statements on the database, with read-only limitations when connected in restricted mode. |
| explain_query | Gets the execution plan for a SQL query describing how PostgreSQL will process it and exposing the query planner's cost model. Can be invoked with hypothetical indexes to simulate the behavior after adding indexes. |
| get_top_queries | Reports the slowest SQL queries based on total execution time using pg_stat_statements data. |
| analyze_workload_indexes | Analyzes the database workload to identify resource-intensive queries, then recommends optimal indexes for them. |
| analyze_query_indexes | Analyzes a list of specific SQL queries (up to 10) and recommends optimal indexes for them. |
| analyze_db_health | Performs comprehensive health checks including: buffer cache hit rates, connection health, constraint validation, index health (duplicate/unused/invalid), sequence limits, and vacuum health. |
| Prerequisites | Before getting started, ensure you have: 1. Access credentials for your database. 2. Docker *or* Python 3.12 or higher. |
| Installation | Choose one of the following methods to install Postgres MCP Pro: |
##### If you are using `pipx`
```json
{
"mcpServers": {
"postgres": {
"command": "postgres-mcp",
"args": [
"--access-mode=unrestricted"
],
"env": {
"DATABASE_URI": "postgresql://username:password@localhost:5432/dbname"
}
}
}
}Configuration as documented by the project. Restart the client after saving.
Before getting started, ensure you have: 1. Access credentials for your database. 2. Docker or Python 3.12 or higher.
| Variable | Description | Required |
|---|---|---|
| DATABASE_URI | Configuration value read at startup. | Optional |
Read-only SQL access to Postgres — let your assistant inspect schemas and answer questions from real data.
Manage your whole Supabase project in conversation — database, auth, storage, Edge Functions and branches.
Query, modify and analyse local SQLite databases in conversation — the fastest way to chat with a data file.
Metabase ships its own MCP endpoint — search your BI content, build and run queries, and save questions and dashboards without leaving the chat.
Official MongoDB server covering data, schemas and Atlas management — from find queries to spinning up clusters.
Serverless Postgres with database branching — point your assistant at Neon and let it work on disposable copies.