Postgres MCP Pro

A PostgreSQL MCP server with index tuning, EXPLAIN plans, database health checks and a read-only mode

  • 3,437 ★ on the repository
  • Last commit
  • MIT
MCP server

Broad access

Why this level

  • Works with a database and can change data in unrestricted mode
  • Keeps database credentials in the config
All reasons and checks

crystaldba/postgres-mcp

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add mcp/postgres-mcp-pro

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • Works with a database and can change data in unrestricted mode
  • Keeps database credentials in the config

This is third-party code. Review the repository files before installing.

What it does

The server gives the agent DBA tools rather than bare SQL execution. It checks index health, connection usage, buffer cache, vacuum, sequence limits and replication lag. Index tuning searches candidate indexes for your workload, and EXPLAIN plans can be compared with hypothetical indexes. Unrestricted mode suits development, while restricted mode limits work to read-only transactions with an execution time cap.

Who it is for. For backend developers and PostgreSQL admins hunting slow queries and database problems.

Good fit when

  • The app is slow and you need to find slow queries and missing indexes
  • You need to check a production database without risk of changes
  • You want the agent to write SQL that matches the real schema

Not a fit when

  • Your database is not PostgreSQL
  • The agent must not see database data

Example request

Check database health and suggest indexes for the slowest queries

MCP

Transport
stdio, sse
Authentication
API key

Environment variables

DATABASE_URI required, secret
PostgreSQL connection URI

Limitations

Requires Docker or Python 3.12 and a database connection string. Some analysis needs the pg_stat_statements and hypopg extensions. In unrestricted mode the agent can change data and schema; use restricted for production.

How to disable. Remove the postgres block from the MCP client config.

FAQ

Is it safe for a production database?

Use restricted mode: it allows only read-only transactions and caps execution time.

Docker or Python?

The authors recommend Docker because Python installs hit more environment issues.

How is Postgres MCP Pro different from a plain SQL server?

Besides running SQL the server gives the agent DBA tools: index health, connection usage, buffer cache, vacuum, sequence limits, replica lag, index tuning and EXPLAIN plans. A read-only mode is available.

Is it safe to connect Postgres MCP Pro to a production database?

Turn on read-only mode and give a separate role with minimal rights. In Claude Desktop, Claude Code, Cursor and Windsurf the server connects with the uvx command, as in the install block. Risk is high.

Discussion

No questions or reviews yet.

Official

Instant REST and MCP over PostgreSQL: the agent reads an existing database through an MCP endpoint with no backend to write

MCP serverExtended access4.6KRepository stars
Official

Two official Prisma MCP servers: a local one for migrations and Prisma Studio, and a remote one for managing Prisma Postgres databases

MCP serverBroad access49Repository stars
Official

Supabase's official MCP server: the agent manages tables, reads project config and queries data after an OAuth login

MCP serverBroad access3KRepository stars

Two GraphQL tools for MCP clients: the agent fetches your API schema and runs queries against a single endpoint

MCP serverExtended access407Repository stars

The pscale CLI for PlanetScale MySQL and PostgreSQL databases: branches, deploy requests, SQL and diagnostics, with an agent guide

CLIBroad access671Repository stars
Official

Apollo's MCP server: turns chosen GraphQL operations into tools the agent uses to work with your API

MCP serverBroad access317Repository stars

Comparison with similar tools

Entries that share the main search query, and how they differ.

EntryOfficialAuthenticationRepository starsMain difference
Postgres MCP Pro (this entry)noAPI key3,437
PG-MCP Servernonot required540an MCP server for PostgreSQL with several databases at once
pgEdge Postgres MCPnonot required241postgres MCP in Go with read-mode queries
Postgres MCP (Microsoft)nokey is optional68postgres MCP from Microsoft

README in short

The README covers five areas: database health, index tuning, query plans, schema understanding and safe SQL execution. A demo walkthrough shows the server speeding up a slow SQLAlchemy app. Installation uses the Docker image or pipx and uv, with Claude Desktop configs and pointers for Cursor and Windsurf. Stdio and SSE transports are supported. MIT licensed.

README badge

Report a problem

Foxx AIPostgres MCP Pro
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.