Skip to main content
AllMCPs
BrowseBestCategoriesStackCompareToolsGuidesBlog
Log in Submit MCP

Stay in the loop

Get new MCP servers and top picks in your inbox.

AllMCPs

The open directory for discovering and installing Model Context Protocol servers.

AllMCPs on GitHub (opens in a new tab)
Launched onTiny Startupstinystartups.com
Explore
  • Browse servers
  • Best MCP servers
  • Categories
  • MCP clients
  • Agent prompts
  • Stack Builder
  • Compare servers
  • Random discovery New
  • Submit a server
  • Pricing & Boost Boost
Learn
  • Guides hub
  • What is MCP?
  • Install guide
  • Build an MCP server
  • Deploy an MCP server
  • Security guide
  • Troubleshooting
  • MCP for SEO & AEO
  • Protocol versioning
  • Blog & updates
Tools
  • All developer tools
  • Config generator
  • Config validator
  • Config auditor
  • MCP playground
  • Token calculator
  • OpenAPI β†’ MCP
  • Badge generator
For agents
  • REST API docs
  • Trust & traffic Live
  • Remote MCP server SSE β†— (opens in a new tab)
  • llms.txt β†— (opens in a new tab)
  • Catalog JSON β†— (opens in a new tab)
Company
  • About
  • Advertise Sponsor
  • Contact
  • GitHub β†— (opens in a new tab)
  • Terms
  • Privacy
AllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZoneAllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZone
Β© 2026 Jackalope Digital LLC. All rights reserved.
  1. Home
  2. πŸ—„οΈ Databases
  3. Postgres MCP
Postgres MCP logo
Health: ActiveRecent health check succeeded.Last checked 9/9/2026, 3:02:23 PM

Postgres MCP

User RatingsBe the first to rate and review this MCP server!
View Repository3.3k GitHub StarsTotal stargazers on GitHub for the source repository (3,282 stars).Visit Website
postgresdatabaseindex-tuningquery-planshealth-checks

MCP server for Postgres with tools for index tuning, query plans, health checks, and safe SQL execution.

Quick Install

Automated & IDE Setup

Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β€” or use 1-click editor setup below.

Add to CursorAdd to VS Code
Not yet automatically verified

We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β€” we're steadily working through the catalog.

Manual Client & Custom JSON ConfigExpand JSON β–Ύ

Client Config & Setup

Choose your client or environment
Target File:~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "crystaldba-postgres-mcp": {
      "command": "uvx",
      "args": [
        "postgres-mcp"
      ]
    }
  }
}

πŸ’‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.

Install Directory Badge Claim listing AlternativesπŸ—„οΈ More in Databases

Overview

This MCP server supports Postgres development and operations by providing database health analysis, index tuning, query plan inspection, and schema-aware SQL generation. It enables safe SQL execution with configurable access controls, suitable for development and production environments. It supports stdio and SSE transports for flexible integration with AI agents.

Use cases

β€’Analyze Postgres database health and performance metrics
β€’Tune and explore optimal indexes for workloads
β€’Review and optimize query execution plans
β€’Generate context-aware SQL based on schema
β€’Safely execute SQL with access control in production

Key features

β€’Database health checks including index, vacuum, replication, and cache analysis
β€’Industrial-strength index tuning algorithms
β€’EXPLAIN plan validation and hypothetical index simulation
β€’Schema intelligence for context-aware SQL generation
β€’Configurable safe SQL execution with read-only mode
β€’Supports stdio and SSE MCP transports

Capabilities & Tool Schemas

Inspect callable tools, capabilities, and parameters exposed to AI agents by Postgres MCP.

Extracted Tool Capabilities
Database health checks including index, vacuum, replication, and cache analysis
Industrial-strength index tuning algorithms
EXPLAIN plan validation and hypothetical index simulation
Schema intelligence for context-aware SQL generation
Configurable safe SQL execution with read-only mode
Supports stdio and SSE MCP transports

Documentation Overview

Postgres MCP Pro Logo

License: MIT PyPI - Version Discord Twitter Follow Contributors

A Postgres MCP server with index tuning, explain plans, health checks, and safe sql execution.

Overview β€’ Demo β€’ Quick Start β€’ Technical Notes β€’ MCP API β€’ Related Projects β€’ FAQ

Overview

Postgres MCP 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.

Postgres MCP Pro does much more than wrap a database connection.

Features include:

  • πŸ” Database Health - analyze index health, connection utilization, buffer cache, vacuum health, sequence limits, replication lag, and more.
  • ⚑ Index Tuning - explore thousands of possible indexes to find the best solution for your workload, using industrial-strength algorithms.
  • πŸ“ˆ Query Plans - validate and optimize performance by reviewing EXPLAIN plans and simulating the impact of hypothetical indexes.
  • 🧠 Schema Intelligence - context-aware SQL generation based on detailed understanding of the database schema.
  • πŸ›‘οΈ Safe SQL Execution - configurable access control, including support for read-only mode and safe SQL parsing, making it usable for both development and production.

Postgres MCP Pro supports both the Standard Input/Output (stdio) and Server-Sent Events (SSE) transports, for flexibility in different environments.

For additional background on why we built Postgres MCP Pro, see our launch blog post.

Demo

From Unusable to Lightning Fast

  • Challenge: We generated a movie app using an AI assistant, but the SQLAlchemy ORM code ran painfully slow.
  • Solution: Using Postgres MCP Pro with Cursor, we fixed the performance issues in minutes.

What we did:

  • πŸš€ Fixed performance - including ORM queries, indexing, and caching
  • πŸ› οΈ Fixed a broken page - by prompting the agent to explore the data, fix queries, and add related content.
  • 🧠 Improved the top movies - by exploring the data and fixing the ORM query to surface more relevant results.

See the video below or read the play-by-play.

https://github.com/user-attachments/assets/24e05745-65e9-4998-b877-a368f1eadc13

Quick Start

Prerequisites

Before getting started, ensure you have:

  1. Access credentials for your database.
  2. Docker or Python 3.12 or higher.

Access Credentials

You can confirm your access credentials are valid by using psql or a GUI tool such as pgAdmin.

Docker or Python

The choice to use Docker or Python is yours. We generally recommend Docker because Python users can encounter more environment-specific issues. However, it often makes sense to use whichever method you are most familiar with.

Installation

Choose one of the following methods to install Postgres MCP Pro:

Option 1: Using Docker

Pull the Postgres MCP Pro MCP server Docker image. This image contains all necessary dependencies, providing a reliable way to run Postgres MCP Pro in a variety of environments.

Terminal
docker pull crystaldba/postgres-mcp

Option 2: Using Python

If you have pipx installed you can install Postgres MCP Pro with:

bash
pipx install postgres-mcp

Otherwise, install Postgres MCP Pro with uv:

bash
uv pip install postgres-mcp

If you need to install uv, see the uv installation instructions.

Configure Your AI Assistant

We provide full instructions for configuring Postgres MCP Pro with Claude Desktop. Many MCP clients have similar configuration files, you can adapt these steps to work with the client of your choice.

Claude Desktop Configuration

You will need to edit the Claude Desktop configuration file to add Postgres MCP Pro. The location of this file depends on your operating system:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json

You can also use Settings menu item in Claude Desktop to locate the configuration file.

You will now edit the mcpServers section of the configuration file.

If you are using Docker
config.json
{
  "mcpServers": {
    "postgres": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URI",
        "crystaldba/postgres-mcp",
        "--access-mode=unrestricted"
      ],
      "env": {
        "DATABASE_URI": "postgresql://username:password@localhost:5432/dbname"
      }
    }
  }
}

The Postgres MCP Pro Docker image will automatically remap the hostname localhost to work from inside of the container.

  • MacOS/Windows: Uses host.docker.internal automatically
  • Linux: Uses 172.17.0.1 or the appropriate host address automatically
If you are using uvx
config.json
{
  "mcpServers": {
    "postgres": {
      "command": "uvx",
      "args": [
        "postgres-mcp",
        "--access-mode=unrestricted"
      ],
      "env": {
        "DATABASE_URI": "postgresql://username:password@localhost:5432/dbname"
      }
    }
  }
}
If you are using pipx
config.json
{
  "mcpServers": {
    "postgres": {
      "command": "postgres-mcp",
      "args": [
        "--access-mode=unrestricted"
      ],
      "env": {
        "DATABASE_URI": "postgresql://username:password@localhost:5432/dbname"
      }
    }
  }
}
If you are using uv
config.json
{
  "mcpServers": {
    "postgres": {
      "command": "uv",
      "args": [
        "run",
        "postgres-mcp",
        "--access-mode=unrestricted"
      ],
      "env": {
        "DATABASE_URI": "postgresql://username:password@localhost:5432/dbname"
      }
    }
  }
}
Connection URI

Replace postgresql://... with your Postgres database connection URI.

Access Mode

Postgres MCP Pro supports multiple access modes to give you control over the operations that the AI agent can perform on the database:

  • Unrestricted Mode: Allows full read/write access to modify data and schema. It is suitable for development environments.
  • Restricted Mode: Limits operations to read-only transactions and imposes constraints on resource utilization (presently only execution time). It is suitable for production environments.

To use restricted mode, replace --access-mode=unrestricted with --access-mode=restricted in the configuration examples above.

Other MCP Clients

Many MCP clients have similar configuration files to Claude Desktop, and you can adapt the examples above to work with the client of your choice.

  • If you are using Cursor, you can use navigate from the Command Palette to Cursor Settings, then open the MCP tab to access the configuration file.
  • If you are using Windsurf, you can navigate to from the Command Palette to Open Windsurf Settings Page to access the configuration file.
  • If you are using Goose run goose configure, then select Add Extension.
  • If you are using Qodo Gen, open the Chat panel, click Connect more tools, click + Add new MCP, then add the new configuration.

SSE Transport

Postgres MCP Pro supports the SSE transport, which allows multiple MCP clients to share one server, possibly a remote server. To use the SSE transport, you need to start the server with the --transport=sse option.

For example, with Docker run:

Terminal
docker run -p 8000:8000 \
  -e DATABASE_URI=postgresql://username:password@localhost:5432/dbname \
  crystaldba/postgres-mcp --access-mode=unrestricted --transport=sse

Then update your MCP client configuration to call the the MCP server. For example, in Cursor's mcp.json or Cline's cline_mcp_settings.json you can put:

config.json
{
    "mcpServers": {
        "postgres": {
            "type": "sse",
            "url": "http://localhost:8000/sse"
        }
    }
}

For Windsurf, the format in mcp_config.json is slightly different:

config.json
{
    "mcpServers": {
        "postgres": {
            "type": "sse",
            "serverUrl": "http://localhost:8000/sse"
        }
    }
}

Postgres Extension Installation (Optional)

To enable index tuning and comprehensive performance analysis you need to load the pg_stat_statements and hypopg extensions on your database.

  • The pg_stat_statements extension allows Postgres MCP Pro to analyze query execution statistics. For example, this allows it to understand which queries are running slow or consuming significant resources.
  • The hypopg extension allows Postgres MCP Pro to simulate the behavior of the Postgres query planner after adding indexes.

Read the full README β†’View source on GitHub β†’

Related MCP Servers

View all in Databases View all alternatives
  • Pgtuner MCP logoPgtuner MCP

    provides AI-powered PostgreSQL performance tuning capabilities.

    πŸ—„οΈ Databases2 views
    Compare vs Pgtuner MCP β†’
  • Mysql MCP Server Pro logoMysql MCP Server Pro

    Supports SSE, STDIO; not only limited to MySQL's CRUD functionality; also includes database exception analysis capabilities; controls database permissions based on roles; and makes it easy for developers to extend tools with customization

    πŸ—„οΈ Databases2 views
    Compare vs Mysql MCP Server Pro β†’
  • MCP Server Duckdb logoMCP Server Duckdb

    DuckDB database integration with schema inspection and query capabilities

    πŸ—„οΈ Databases2 views
    Compare vs MCP Server Duckdb β†’
  • MCPg logoMCPg
    Verified

    Production-grade PostgreSQL MCP server with 100+ tools for catalog introspection, AST-validated safe query execution, index tuning, natural-language SQL, pgvector/TimescaleDB/AGE integrations, and HTTP/stdio transports.

    πŸ—„οΈ Databases10 views
    Compare vs MCPg β†’

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks β€” not a rating.

GitHub stars
3.3k
Stargazers on the source repository.
npm downloads
624
Package downloads in the last 30 days.
Last commit
25d ago
Most recent push to the default branch.
Directory activity
1 views
Config copies, upvotes, and views on AllMCPs.

Reviews

No reviews yet β€” be the first to share how this listing worked for you.

Frequently Asked Questions about Postgres MCP

You need valid Postgres database credentials and either Docker or Python 3.12+ installed.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewPostgres MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/crystaldba-postgres-mcp?style=directory)](https://allmcps.com/mcp/crystaldba-postgres-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/crystaldba-postgres-mcp"><img src="https://allmcps.com/api/badge/crystaldba-postgres-mcp?style=directory" alt="Postgres MCP on AllMCPs" /></a>

Technical Specs & Signals

CategoryπŸ—„οΈDatabases
PricingFree
More technical detailsExpand β–Ύ
TransportSTDIO
RuntimePython
AuthAPI key
LicenseMIT
ClientsClaude Desktop
Last updatedAug 17, 2026
11/11 checks healthy over the last 32d
Views1
Unique ViewsTotal visits recorded for this listing page on AllMCPs.
Installs0
Installs & Copy ActionsTotal times users copied install commands or configuration snippets for this server.
GitHub stars3,282
GitHub Star CountTotal stargazers on GitHub representing community popularity (3,282 stars).
Last commit25d ago
Last Repository CommitThe most recent commit or push recorded for this server's GitHub repository.Last commit on Aug 17, 2026
npm downloads624/mo
Monthly npm DownloadsAverage monthly package installs recorded from npm registry statistics.
61Quality signal: Good Β· 61/100How this signal is calculated β–Ύ
Server availabilityNot measured

Not scored for repo-hosted servers β€” we can't reach the running server, only its GitHub page. Hosted MCP endpoints are health-checked live.

Verified ownership10/20
Documentation & tools23/30
Adoption & activity13/15
Community engagement0/10

A guidance signal from public completeness & health data β€” not a user rating. New listings start lower and rise as they add docs, get verified, and grow adoption. Signals we can't observe for a listing are skipped, not counted against it.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 26d ago via OSV.dev Β· postgres-mcp (PyPI)

β˜… FeaturedMoxie Docs MCP logo

Moxie Docs MCP

MCP & Agent Skills for Automated Documentation, and codebase conventions + context

Explore Server β†’

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to unlock edit access and the Official badge β€” proof is checked automatically, then reviewed by our team.

Free dofollow backlink: add your website and place the AllMCPs badge on it β€” no claim needed. We detect it automatically and keep it verified as long as the badge stays live.

Claim & get free dofollow

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.

Explore more

More in πŸ—„οΈ Databases β†’Best MCP servers for Databases β†’Alternatives to Postgres MCP β†’Install in Claude DesktopInstall in CursorInstall in VS Code