Postgres MCP
Rank #976glama/crystaldba/postgres-mcp
Postgres Pro is an open source Model Context Protocol (MCP) server built to support you and your AI agents throughout the entire development process—from initial coding, through testing and deployment, and to production tuning and maintenance.
What you can do with Postgres MCP
Postgres MCP Pro gives an agent database health checks, index tuning, EXPLAIN-based query analysis and access-controlled SQL execution against one PostgreSQL database, covering development through production tuning.
- Run SQL in restricted (read-only) or unrestricted mode
- Explore schemas, tables, views and object details
- Explain query plans, including with hypothetical indexes
- Recommend indexes for a workload or specific queries
- Check index, vacuum, replication, buffer and connection health
- Find the slowest queries via pg_stat_statements
What Postgres MCP can and cannot do
Nine tools cover schema exploration, SQL execution, EXPLAIN plans, top queries and workload or per-query index recommendations plus a database health report. Index tuning simulates candidates with hypopg; health checks are adapted from PgHero.
- list_schemas
- list_objects
- get_object_details
- execute_sql
- explain_query
- get_top_queries
- analyze_workload_indexes
- analyze_query_indexes
- analyze_db_health
- Restricted mode enforces only read-only transactions and an execution-time limit; the README says it is not yet fully hardened for production
- Read-only protection parses SQL with pglast and rejects COMMIT/ROLLBACK; unsafe stored-procedure languages could bypass it
- Index tuning and top-query analysis need the pg_stat_statements and hypopg extensions
- Index recommendations depend on hypopg's cost predictions; multi-column candidates use one column ordering per combination
- Credentials are fixed at startup (DATABASE_URI); there are no per-tool-call credentials
What you need before using Postgres MCP
The registry listing declares required configuration before first use — typically an API key, token or connection string set via environment variables.
Declared by Glama, last synced Nov 23, 2026. Not independently verified by MCP Toplist.
- Runtime
- Docker (crystaldba/postgres-mcp, recommended) or Python 3.12+ via pipx, uv or uvx
- Credentials
- PostgreSQL connection URI in DATABASE_URI (or as a positional argument)
- Permissions
- A database role with the access you want the agent to have; extensions pg_stat_statements and hypopg for tuning features
- Also needed
- Tested on Postgres 15–17; OPENAI_API_KEY only for the experimental LLM index tuning
Connect Postgres MCP and confirm it works
- Pull the image: docker pull crystaldba/postgres-mcp (or pipx install postgres-mcp)
- Add it to your MCP client with DATABASE_URI set to your Postgres URI and --access-mode=restricted (or unrestricted)
- Optionally CREATE EXTENSION pg_stat_statements and hypopg to enable index tuning
- For shared or remote use, run with --transport=sse on port 8000
Install configuration unavailable. No registry publishes a machine-readable install config for this server — follow the repository README.
Ask the agent to "check the health of my database" so it calls analyze_db_health.
Expected: A report covering index health, buffer cache hit rate, connections, vacuum, replication, constraints and sequences.
When to choose another server
- DBHub#49
You also need MySQL, SQL Server, Oracle or SQLite behind the same gateway.
- PostgreSQL#7,722
You want a small read-only-by-default Node server without tuning features.
- MCP-PostgreSQL-Ops#1,059
You only need read-only monitoring and operations statistics, with no SQL execution.
Compared side by side in PostgreSQL MCP servers.
What changed, and when this was checked
- First listed
- Mar 25, 2025
- Latest release tag
- May 16, 2025
- Version history
- 4 release tags tracked (below)
- Requirements evidence
- Declared by Glama, last synced Nov 23, 2026. Not independently verified by MCP Toplist.
- Profile checked
- Oct 9, 2026 against README
- Ranking data as of
- Nov 24, 2026
- Glama ↗listed since Apr 26, 2026 · still listed
- PulseMCP ↗listed since Jun 4, 2026 · still listed
- mcp.so ↗listed since Jun 4, 2026 · still listed
Do you maintain Postgres MCP? to show as its verified maintainer and add your own summary, sign-in details and links. The rest of this page is read from the registry listings and from MCP Toplist's own connection check.
GitHub releases (4)
No registry surfaces explicit version metadata for this server. The list below shows release tags from the linked GitHub repository.
| Version | Published |
|---|---|
| v0.3.0 | May 16, 2025 |
| v0.2.1 | Apr 17, 2025 |
| v0.2.0 | Apr 16, 2025 |
| v0.1.1 | Apr 8, 2025 |
Ranks ahead of 187,749 of 188,725 servers on MCP Toplist.
Show your rank
Maintain this server? Add the live rank badge to your README — it updates automatically as the leaderboard changes.
[](https://mcptoplist.com/server/glama%2Fcrystaldba%2Fpostgres-mcp)<a href="https://mcptoplist.com/server/glama%2Fcrystaldba%2Fpostgres-mcp"><img src="https://mcptoplist.com/badge/glama%2Fcrystaldba%2Fpostgres-mcp.svg" alt="MCP Toplist: Top 1% of 188,725" /></a>Variants: append ?metric=score or ?metric=stars to the image URL.
Frequently asked questions
- Who maintains Postgres MCP?
- Postgres MCP is maintained by crystaldba, which publishes 1 MCP server (4 total versions) tracked on MCP Toplist.
- Is Postgres MCP listed on the Official MCP Registry?
- Postgres MCP is not on the Official MCP Registry. It is listed on Glama, PulseMCP and mcp.so.
- How many versions does Postgres MCP have?
- No registry surfaces explicit version metadata for Postgres MCP; MCP Toplist tracks 4 release tags from its GitHub repository, most recently published on May 16, 2025.
- Where can I find the source code for Postgres MCP?
- The source code for Postgres MCP is hosted at github.com/crystaldba/postgres-mcp.
Do you run this server?
Community projects list the MCP servers behind real agents and apps. Publish yours and this page will link to it.