★ 2831 Python MIT sse 更新 19分钟前

Postgres

Postgres MCP Pro provides configurable read/write access and performance analysis for you and your AI agents.

安装配置

{
    "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"
            }
        }
    }
}

README 摘要

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![PyPI - Version](https://img.shields.io/pypi/v/postgres-mcp)](https://pypi.org/project/postgres-mcp/) [![Discord](https://img.shields.io/discord/1336769798603931789?label=Discord)](https://discord.gg/4BEHC7ZM) [![Twitter Follow](https://img.shields.io/twitter/follow/auto_dba?style=flat)](https://x.com/auto_dba) [![Contributors](https://img.shields.io/github/contributors/crystaldba/postgres-mcp)](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)](https://modelcontextprotocol.io/docs/concepts/transports#standard-input%2Foutput-stdio) and [Server-Sent Events (SSE)](https://modelcontextprotocol.io/docs/concepts/transports#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](https://www.crystaldba.ai/blog/post/announcing-postgres-mcp-server-pro). ## 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](examples/movie-app.md). 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](https://www.pgadmin.org/). #### Docker or Python The choice to use Docker or Python is yours. We generally recommend Docker because Python users can encounter more environment-...

相关 MCP

Trend Radar

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的...

★ 58684 Python http 有配置
mcp Python http

Libre Chat

Enhanced ChatGPT Clone: Features Agents, MCP, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, M...

★ 37798 TypeScript sse 待补充
mcp sse TypeScript

Github

GitHub's official MCP Server

★ 30339 Go sse 待补充
mcp sse Go