SERVER

Postgres MCP

Rank #976

glama/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.

4 release tags
3,492 GitHub stars
by crystaldba (1 servers)View repository ↗
First listed
Mar 25, 2025
Last publish date
May 16, 2025
PURPOSE

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.

Suitable tasks
  • 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
CAPABILITIES AND LIMITATIONS

What Postgres MCP can and cannot do

Capabilities

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.

Documented tools
  • list_schemas
  • list_objects
  • get_object_details
  • execute_sql
  • explain_query
  • get_top_queries
  • analyze_workload_indexes
  • analyze_query_indexes
  • analyze_db_health
Limitations
  • 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
REQUIREMENTS

What you need before using Postgres MCP

DeclaredAPI keyCredentials declared

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
INSTALLATION AND FIRST TASK

Connect Postgres MCP and confirm it works

  1. Pull the image: docker pull crystaldba/postgres-mcp (or pipx install postgres-mcp)
  2. Add it to your MCP client with DATABASE_URI set to your Postgres URI and --access-mode=restricted (or unrestricted)
  3. Optionally CREATE EXTENSION pg_stat_statements and hypopg to enable index tuning
  4. 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.

First successful task

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.

ALTERNATIVES

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.

MAINTENANCE AND EVIDENCE

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
Registry sightings

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.

VERSIONS

GitHub releases (4)

No registry surfaces explicit version metadata for this server. The list below shows release tags from the linked GitHub repository.

v0.1.1 · Apr 8, 2025v0.2.0 · Apr 16, 2025v0.2.1 · Apr 17, 2025v0.3.0 · May 16, 2025Apr 8, 2025May 16, 2025
VersionPublished
v0.3.0May 16, 2025
v0.2.1Apr 17, 2025
v0.2.0Apr 16, 2025
v0.1.1Apr 8, 2025
STANDING
#976of 188,725 active serversTop 1%

Ranks ahead of 187,749 of 188,725 servers on MCP Toplist.

Recent momentum
+818GitHub stars since Apr 27 (+31%)
BADGE

Show your rank

Maintain this server? Add the live rank badge to your README — it updates automatically as the leaderboard changes.

MCP Toplist: Top 1% of 188,725
Markdown
[![MCP Toplist](https://mcptoplist.com/badge/glama%2Fcrystaldba%2Fpostgres-mcp.svg)](https://mcptoplist.com/server/glama%2Fcrystaldba%2Fpostgres-mcp)
HTML
<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.

FAQ

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.
Used in projects

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.

EXPLORE