What is Postgres MCP Pro?
Postgres MCP Pro gives an MCP client nine tools for a PostgreSQL database: three for schema inspection, execute_sql for queries, explain_query for plans, and four for performance work. Those four report the slowest statements from pg_stat_statements, recommend indexes for the whole workload or for up to 10 named queries, and run health checks adapted from PgHero. It installs from PyPI as postgres-mcp (Python 3.12 or later) or as the crystaldba/postgres-mcp Docker image, and speaks stdio, SSE and Streamable HTTP.
Crystal DBA built it and released it in March 2025. Temporal announced on 3 September 2025 that it had acquired Crystal DBA, and the project's specification now says Johann Schleier-Smith, Crystal DBA's founder, maintains it with community support. The repository has about 3,508 stars and is MIT-licensed. Development is active, with 15 commits since 1 November 2026, but the last release is still v0.3.0 from 16 May 2025, so the PyPI package and the Docker image lack the security fixes made on main since.
How to install Postgres MCP Pro
uvx postgres-mcp --access-mode=restrictedIs Postgres MCP Pro worth it?
The index advisor is what separates this server from the many other Postgres MCP servers. It reads pg_stat_statements to find costly queries, generates candidate indexes from the columns they filter, join and sort on, and asks the hypopg extension how the planner would cost each one without building it. A greedy search adds one index at a time and stops when its 30-second budget runs out or the next index improves cost by less than 10%. By default an index must buy a 100-fold speed-up for at most a tenfold increase in space. The tool returns the before-and-after plans, so the agent can explain the recommendation instead of guessing. Microsoft's postgres-mcp, which we also review, has no equivalent.
Restricted mode answers a specific failure. Anthropic's reference Postgres server ran each query in a read-only transaction and nothing else. Datadog Security Labs showed on 21 August 2025 that a query starting with COMMIT; ended that transaction and let anything after it write, including DROP SCHEMA public CASCADE. Datadog had reported the flaw on 1 April 2025. Anthropic fixed the code and archived the server on 29 May 2025, in the same move that archived 13 other reference servers, but npm v0.6.2 never received the fix. That package still drew 112,546 downloads in the week to 29 November 2026. Postgres MCP Pro parses every statement with pglast, rejects COMMIT and ROLLBACK, checks each statement and function against an allowlist, and then runs it in a read-only transaction with a 30-second limit.
Those layers have had holes. Issue 178, filed on 6 June 2026, showed that restricted mode could read files on the database server through a function in the FROM clause; the fix reached main on 25 November 2026. Two more allowlist fixes followed by 30 November. None of this is in v0.3.0, and the project's own SPEC.md says the release "predates Streamable HTTP and several security fixes", that the function allowlist "has not been fully audited", and that there is no private channel for reporting vulnerabilities. That frankness is welcome. It also means the safe install is a pinned commit from GitHub, not pipx or docker pull.
The defaults lean towards convenience. Access mode is unrestricted unless you pass --access-mode=restricted, and every config example in the README uses unrestricted. The SSE and Streamable HTTP transports have no authentication, and the Docker entrypoint binds SSE to all interfaces inside the container. Restricted mode also refuses EXPLAIN ANALYZE and caps nothing but time, so an agent can still read every row the role can see. Microsoft's server is the opposite trade: weaker tuning, with passwords in the OS keyring and a release cadence.
Where it earns its place
A backend engineer on a Django app whose ORM queries slowed as a table passed a few million rows
Find which queries need an index and which index
get_top_queries lists the worst statements, analyze_query_indexes tests candidates with hypopg, and explain_query shows the plan before and after. Free; it needs pg_stat_statements and hypopg installed, and someone still reviews the CREATE INDEX before it runs.
A solo DBA covering 12 Postgres databases at a logistics firm
Run a weekly check for vacuum, bloat and sequence problems
analyze_db_health runs the PgHero-derived checks for index health, buffer cache hit rate, connections, vacuum and transaction ID wraparound, replication lag, invalid constraints and sequence limits. The spec notes that the first failing check stops the rest, so read the output for gaps.
A platform team giving coding agents access to a staging copy of production
Let agents explore the schema and run read-only SQL without risking writes
Start the server with --access-mode=restricted from a commit after 25 November 2026, connect as a role with SELECT-only grants, and keep it on stdio. Restricted mode guards integrity, not confidentiality, so the role decides what the model provider sees.
Before you commit
- Setup
- pipx install postgres-mcp, uvx postgres-mcp, or docker pull crystaldba/postgres-mcp, then set DATABASE_URI and add --access-mode=restricted in the client config. The README documents Claude Desktop, Cursor, Windsurf, Goose and Qodo Gen. Index tuning needs CREATE EXTENSION for pg_stat_statements and hypopg.
- Integrations
- Nine tools: list_schemas, list_objects, get_object_details, execute_sql, explain_query, get_top_queries, analyze_workload_indexes, analyze_query_indexes and analyze_db_health. Only execute_sql can write, and only in unrestricted mode.
- Data and privacy
- Runs locally with the credentials in DATABASE_URI. Every result goes to your model provider; the experimental LLM tuning method also sends schema and query text to OpenAI's gpt-4o. A restricted-mode file-read bypass (issue 178) was fixed on main on 25 November 2026 but not released. HTTP transports have no authentication.
- Cost at scale
- Free; cost is your Postgres instance plus the tokens query results consume. Workload index analysis has a 30-second search budget, though the spec warns candidate generation can run for hours on queries with long select lists.
- Limits
- The restricted-mode time limit is fixed at 30 seconds and not configurable; EXPLAIN ANALYZE is refused in restricted mode; some ordinary read-only SQL is rejected; get_top_queries does not filter by database. 91 issues and pull requests are open.
What’s good
- Index advisor that simulates indexes with hypopg before recommending them
- explain_query accepts hypothetical indexes
- Health checks for vacuum, sequences, bloat, replication and connections
- Restricted mode parses SQL and allowlists functions as well as using a read-only transaction
What’s not
- No release since v0.3.0 in May 2025; packages lack recent security fixes
- Unrestricted by default, and the README examples all use it
- No authentication on SSE or Streamable HTTP
- No private vulnerability reporting channel
Best for
Developers and DBAs who want an agent to find slow queries and propose indexes on Postgres 15 or later, and who will run it from a pinned commit with a read-only role.
Postgres MCP Pro alternatives
Where it fits in the AI stack
Postgres MCP Pro: common questions
- Is Postgres MCP Pro worth it?
- Postgres MCP Pro's index advisor is worth having, but its last release is 18 months old, so production use means running main behind a read-only role. We rate it 3.8 out of 5.
- How much does Postgres MCP Pro cost?
- Free and open source (MIT). You pay for your Postgres hosting, and for OpenAI API calls only if you use the experimental LLM index-tuning method.
- What are the downsides of Postgres MCP Pro?
- No release since v0.3.0 in May 2025; packages lack recent security fixes; unrestricted by default, and the README examples all use it; no authentication on SSE or Streamable HTTP; no private vulnerability reporting channel.
- Who is Postgres MCP Pro best for?
- Developers and DBAs who want an agent to find slow queries and propose indexes on Postgres 15 or later, and who will run it from a pinned commit with a read-only role.
- How much does Postgres MCP Pro cost for a team or in production?
- Free; cost is your Postgres instance plus the tokens query results consume. Workload index analysis has a 30-second search budget, though the spec warns candidate generation can run for hours on queries with long select lists.
- Is Postgres MCP Pro safe for company data?
- Runs locally with the credentials in DATABASE_URI. Every result goes to your model provider; the experimental LLM tuning method also sends schema and query text to OpenAI's gpt-4o. A restricted-mode file-read bypass (issue 178) was fixed on main on 25 November 2026 but not released. HTTP transports have no authentication.
- What are the best Postgres MCP Pro alternatives?
- The closest alternatives we have reviewed are Postgres MCP Server (Microsoft), DBHub, MCP Toolbox for Databases, Supabase MCP Server and Neon MCP Server.
Answers checked Nov 30, 2026.