Price Per TokenPrice Per Token

Postgres MCP Pro

by crystaldba

0

About

Postgres MCP Pro is a PostgreSQL database management and optimization MCP server that provides AI agents with comprehensive tools for performance tuning, health monitoring, and safe query execution. Key features of Postgres MCP Pro: - Database health analysis including index health, connection utilization, buffer cache efficiency, vacuum status, sequence limits, and replication lag monitoring - Advanced index tuning using industrial-strength algorithms to explore thousands of potential indexes and identify optimal solutions for specific workloads - Query plan analysis with EXPLAIN plan review and hypothetical index simulation to validate and optimize query performance before making changes - Schema intelligence that enables context-aware SQL generation based on detailed database structure understanding - Safe SQL execution with configurable access controls including read-only mode and safe SQL parsing for secure use in production environments

README

[](https://opensource.org/licenses/MIT) [](https://pypi.org/project/postgres-mcp/) [](https://discord.gg/4BEHC7ZM) [](https://x.com/auto_dba) [](https://github.com/crystaldba/postgres-mcp/graphs/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.

    docker pull crystaldba/postgres-mcp
    

    #### Option 2: Using Python

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

    pipx install postgres-mcp
    

    Otherwise, install Postgres MCP Pro with uv:

    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 locatio

    Related MCP Servers

    AI Research Assistant

    AI Research Assistant

    hamid-vakilzadeh

    AI Research Assistant provides comprehensive access to millions of academic papers through the Semantic Scholar and arXiv databases. This MCP server enables AI coding assistants to perform intelligent literature searches, citation network analysis, and paper content extraction without requiring an API key. Key features include: - Advanced paper search with multi-filter support by year ranges, citation thresholds, field of study, and publication type - Title matching with confidence scoring for finding specific papers - Batch operations supporting up to 500 papers per request - Citation analysis and network exploration for understanding research relationships - Full-text PDF extraction from arXiv and Wiley open-access content (Wiley TDM token required for institutional access) - Rate limits of 100 requests per 5 minutes with options to request higher limits through Semantic Scholar

    Web & Search
    12 8
    Linkup

    Linkup

    LinkupPlatform

    Linkup is a real-time web search and content extraction service that enables AI assistants to search the web and retrieve information from trusted sources. It provides source-backed answers with citations, making it ideal for fact-checking, news gathering, and research tasks. Key features of Linkup: - Real-time web search using natural language queries to find current information, news, and data - Page fetching to extract and read content from any webpage URL - Search depth modes: Standard for direct-answer queries and Deep for complex research across multiple sources - Source-backed results with citations and context from relevant, trustworthy websites - JavaScript rendering support for accessing dynamic content on JavaScript-heavy pages

    Web & Search
    2 24
    Math-MCP

    Math-MCP

    EthanHenrickson

    Math-MCP is a computation server that enables Large Language Models (LLMs) to perform accurate numerical calculations through the Model Context Protocol. It provides precise mathematical operations via a simple API to overcome LLM limitations in arithmetic and statistical reasoning. Key features of Math-MCP: - Basic arithmetic operations: addition, subtraction, multiplication, division, modulo, and bulk summation - Statistical analysis functions: mean, median, mode, minimum, and maximum calculations - Rounding utilities: floor, ceiling, and nearest integer rounding - Trigonometric functions: sine, cosine, tangent, and their inverses with degrees and radians conversion support

    Developer Tools
    22 81