Postgres Pro logo

Postgres Pro

by crystaldba

Postgres Pro is an open source Model Context Protocol (MCP) server built to support you and your AI agents throughout the entire development process. It provides features like index tuning, explain plans, health checks, and safe SQL execution.

View on GitHub

Last updated: N/A

What is Postgres Pro?

Postgres Pro is an open source Model Context Protocol (MCP) server designed to enhance the interaction between AI agents and PostgreSQL databases. It offers advanced features for database health monitoring, index tuning, schema intelligence, and protected SQL execution, making it a valuable tool for developers and database administrators.

How to use Postgres Pro?

To use Postgres Pro, you can install it via Docker or Python's pipx/uv. After installation, configure your AI assistant (like Claude Desktop, Cursor, or Windsurf) by modifying the MCP server configuration file with the appropriate command and database connection URI. You can then interact with Postgres Pro through your AI assistant using natural language queries to analyze database health, optimize queries, generate index recommendations, and more.

Key features of Postgres Pro

  • Database Health Checks (detect unused/duplicate indexes, monitor cache hit rates, check connection utilization, identify vacuum needs)

  • Index Tuning (generate optimal indexes, validate AI-suggested indexes, simulate performance impacts with hypothetical indexes, balance performance gain vs storage costs)

  • Schema Intelligence (detailed schema information for tables, views & more, context-aware SQL generation, optimal column selection recommendations)

  • Protected Execution (Unrestricted Mode for development, Restricted Mode for production with read-only access and resource limits)

Use cases of Postgres Pro

  • Fixing performance issues in ORM queries, indexing, and caching.

  • Debugging code by connecting data to code.

  • Adding new features from single prompts.

  • Analyzing database workload and suggesting indexes to improve performance.

FAQ from Postgres Pro

How is Postgres Pro different from other Postgres MCP servers?

Postgres Pro adds tools for understanding and improving the performance of your Postgres database, implementing deterministic database health checks and principled indexing search strategies, unlike other servers that rely on LLM-generated health queries or Gen-AI guesses.

Why are MCP tools needed when the LLM can reason, generate SQL, etc?

LLMs are slow, expensive, non-deterministic, and sometimes produce unreliable results. Postgres Pro lets you combine the best of both worlds by pairing LLMs with classical optimization algorithms and other procedural tools.

How do you test Postgres Pro?

We are building out a suite of AI-generated adversarial workloads designed to challenge Postgres Pro and ensure it performs under a broad variety of scenarios.

What Postgres versions are supported?

Our testing presently focuses on Postgres 15, 16, and 17. We plan to support Postgres versions 13 through 17.

Who created this project?

This project is created and maintained by Crystal DBA.