PlugWiki

Postgres MCP Pro Server: Setup for Claude, Cursor and Other Apps

CommunityLocal
GetPyPIpostgres-mcpcrystaldba/postgres-mcp

Not the official PostgreSQL MCP server. This one is built by the community. PostgreSQL makes its own: MCP Toolbox for Databases →

Lets your assistant check the health of your Postgres database, explain slow queries, suggest indexes and run SQL.

Postgres MCP Pro is a community server from Crystal DBA, not from the Postgres project. It runs on your computer and connects to your database with a connection string that you give it.

By default it can change data, because the SQL tool runs whatever it is given. Start it in restricted mode to limit it to read-only queries with a time limit.

Good for

  • Developers tuning slow Postgres queries
  • Database admins who want a health check from chat
  • Teams that want read-only access to production data
  • Anyone who wants index advice without reading query plans

Works in

12 should work

Tap an app to see how to set it up and any known problems.

Install Postgres MCP Pro

Claude Code

  1. 1

    Copy this prompt.

    Add the Postgres MCP Pro server to Claude Code. Run this command:
    
    claude mcp add postgres-pro -e DATABASE_URI=<DATABASE_URI> -- uvx postgres-mcp
    
    Ask me for DATABASE_URI and only put the values in that config, nowhere else.
    
    Then check that it loaded and tell me if I need to sign in or restart.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires uv (Python).

Built from the package data we hold. Not yet tested by us.

Tools

  • Lists the schemas in your database

    Returns every schema in the Postgres instance.

    Try: “What schemas does this database have?”

    Read · list_schemas

  • Lists tables, views, sequences and extensions

    Shows the objects inside one schema.

    Try: “List the tables in the public schema.”

    Read · list_objects

  • Shows a table's columns, constraints and indexes

    Returns the structure of one table, view or other object.

    Try: “Describe the orders table.”

    Read · get_object_details

  • Runs SQL on your database

    Runs any SQL statement you or the assistant write. In the default unrestricted mode it can insert, update and delete data and change the schema. In restricted mode it only runs read-only transactions with a time limit.

    Try: “Show the 10 newest rows in orders.”

    Delete · execute_sql

  • Shows how Postgres would run a query

    Returns the execution plan and cost estimates for a query. It can also test the effect of indexes that do not exist yet.

    Try: “Explain the plan for this slow query.”

    Read · explain_query

  • Finds your slowest queries

    Reports the queries that took the most total time, using the pg_stat_statements data.

    Try: “Which queries are slowest?”

    Read · get_top_queries

  • Suggests indexes for your whole workload

    Looks at the most expensive queries and recommends indexes that would speed them up.

    Try: “Which indexes should I add?”

    Read · analyze_workload_indexes

  • Suggests indexes for specific queries

    Takes up to 10 queries you give and recommends indexes for them.

    Try: “Recommend indexes for these three queries.”

    Read · analyze_query_indexes

  • Runs a database health check

    Checks cache hit rates, connections, constraints, duplicate or unused indexes, sequence limits and vacuum health.

    Try: “Check the health of my database.”

    Read · analyze_db_health

Read from the source code

Permissions

high risk · 3 things to watch

High risk

By default it can read, change and delete data and schema, because it runs any SQL it is given. Use restricted mode, and connect with a database user that has only the rights you want the assistant to have.

What it can do

Watch out for

  • It can change or delete data by default

    The default mode is unrestricted, and the SQL tool runs any statement. Use --access-mode=restricted, and a database user with limited rights. github.com

  • Restricted mode is not a guarantee

    The authors say restricted mode is conservative but may not yet be safe for production databases. Prefer a read-only database user as well. github.com

  • Password sits in the connection string

    The database password is part of the connection string in your client config. Keep that file private. github.com

Security advisories

No published security advisories as of Nov 2, 2026.

Technical details
Turning on read-onlyStart the server with --access-mode=restricted instead of --access-mode=unrestricted. Restricted mode allows only read-only transactions and limits execution time.
Talks toYour Postgres host
Sign-in and keysThe database password is part of the DATABASE_URI connection string in your client config.
Scopes
  • Whatever the database user in your connection string can do

Questions

Is Postgres MCP Pro official?

No. It is made by Crystal DBA, not by the Postgres project, and ships from the crystaldba/postgres-mcp repository.

Can I make it read-only?

Yes. Start it with --access-mode=restricted, which allows only read-only transactions with a time limit. The README says it may still not be safe for production, so also use a read-only database user.

What do I need to run it?

A Postgres connection string in the DATABASE_URI setting, plus uv or Docker. Python 3.12 or newer is required for the PyPI package.

Does it work with managed Postgres like RDS?

Yes, if you can connect with a connection string. Some features need the pg_stat_statements and hypopg extensions, which the README says you can install on RDS, Azure and Cloud SQL.

Does it run locally?

Yes. It runs on your computer and talks straight to your database. An SSE mode for network use also exists and binds to localhost by default.

Is the tool list complete?

It lists the 9 tools in the README and source. The PyPI release (0.3.0) is older than the main branch, so check the version you install.

Information

updated Nov 2, 2026

Publisher
Community
Package
postgres-mcp
Registry
PyPI
Transport
stdio, SSE
Auth
token in env
License
MIT
Last commit
Aug 17, 2026

GitHubPyPIChangelogIssues

Other PostgreSQL MCP servers

Sources

Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.

Show all 3
  1. README.md · github.com
  2. https://pypi.org/project/postgres-mcp/ · pypi.org
  3. server.py · github.com

Facts from the official MCP registry, GitHub, npm, PyPI and the Docker catalog. Updated Nov 2, 2026.