postgres-mcp
PostgreSQL Tuning and Analysis Tool
Decision gist · record as of 2026-08-14
Yes, if you are actively using an MCP-compatible AI assistant (Claude, Cursor, Windsurf) and want to give it safe, structured access to PostgreSQL for tuning and analysis. The low install friction and permissive license are favorable. However, verify current maintenance status before relying on it in production—the package is aging with no recent commit history visible, and support clarity is needed.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.12 or higher; requires a running PostgreSQL database with valid connection credentials; requires an MCP-compatible AI assistant (Claude, Cursor, Windsurf, etc.) to interact with the server.
- Low friction installation via pipx or uv; package is aging (455 days since release) with no recent commits tracked, so maintenance status is unclear—verify active support before production use.
License · maintenance · safety
MIT (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions, suitable for both development and commercial projects.
last release 2025-05-16 (455 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 202,443 downloads/mo, #9,648 on PyPI
Alternatives
Verify before relying
# Install via pipx
pipx install postgres-mcp
# Or via uv
uv pip install postgres-mcp
# Configure in Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
# {
# "mcpServers": {
# "postgres": {
# "command": "postgres-mcp",
# "args": ["--access-mode=unrestricted"],
# "env": {"DATABASE_URI": "postgresql://user:pass@localhost:5432/dbname"}
# }
# }
# }
# Then use in Claude or other MCP client to query and analyze your database.- Whether the package is actively maintained—repo commit history and current maintainer status are not available in the fact sheet.
- Performance characteristics when analyzing large databases or thousands of possible indexes.
- Specific constraints or limitations of restricted mode for production environments.
What it is and what it does
Postgres MCP is a Model Context Protocol server that exposes PostgreSQL database operations to AI agents and assistants. It acts as a bridge between AI tools (like Claude, Cursor, or Windsurf) and your database, enabling agents to analyze schemas, review query performance, explore index tuning opportunities, and execute SQL safely. The package wraps psycopg and pglast to provide schema-aware SQL generation, EXPLAIN plan analysis, and database health diagnostics including index health, connection utilization, buffer cache, and replication lag.
It runs as a standalone server via Docker or Python (3.12+) and supports both stdio and SSE transports for flexible deployment. Access control is configurable: unrestricted mode for development allows full read/write access, while restricted mode limits operations to read-only transactions and resource constraints suitable for production. The package depends on attrs, humanize, instructor, mcp, pglast, psycopg-pool, and psycopg.
Use it for
- Debugging slow ORM queries by asking an AI agent to review EXPLAIN plans and suggest indexes without manual analysis.
- Exploring hypothetical index scenarios to find the best solution for a workload before committing schema changes.
- Running health checks on production databases (in restricted mode) to identify connection leaks, vacuum issues, or replication lag.
- Generating context-aware SQL from natural language prompts based on detailed schema understanding.
- Automating routine database maintenance tasks through AI agents while enforcing read-only constraints in production.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are actively using an MCP-compatible AI assistant (Claude, Cursor, Windsurf) and want to give it safe, structured access to PostgreSQL for tuning and analysis.
The low install friction and permissive license are favorable. However, verify current maintenance status before relying on it in production—the package is aging with no recent commit history visible, and support clarity is needed.
Install
postgres-mcp on PyPI
Before you install
Low friction installation via pipx or uv; package is aging (455 days since release) with no recent commits tracked, so maintenance status is unclear—verify active support before production use.
Requires Python 3.12 or higher; requires a running PostgreSQL database with valid connection credentials; requires an MCP-compatible AI assistant (Claude, Cursor, Windsurf, etc.) to interact with the server.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, suitable for both development and commercial projects.
Quickstart
# Install via pipx
pipx install postgres-mcp
# Or via uv
uv pip install postgres-mcp
# Configure in Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
# {
# "mcpServers": {
# "postgres": {
# "command": "postgres-mcp",
# "args": ["--access-mode=unrestricted"],
# "env": {"DATABASE_URI": "postgresql://user:pass@localhost:5432/dbname"}
# }
# }
# }
# Then use in Claude or other MCP client to query and analyze your database.
Verify before relying
- Whether the package is actively maintained—repo commit history and current maintainer status are not available in the fact sheet.
- Performance characteristics when analyzing large databases or thousands of possible indexes.
- Specific constraints or limitations of restricted mode for production environments.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.12 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 7 packagesattrshumanizeinstructormcppglastpsycopg-poolpsycopg |
| Maintenance | Aging 455 days since the last release |
| First released | |
| Downloads | 202,443 / month, #9,648 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: postgres_mcp-0.3.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “postgres mcp server”
- postgres-mcpA Model Context Protocol server that connects AI agents to PostgreSQL…
- agent-utilitiesA batteries-included harness for building Pydantic-AI agents with an…
- mcp-proxymcp-proxy bridges Model Context Protocol (MCP) servers and clients…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also arcade-mcp-server · debsecan-mcp · excel-mcp-server · mcp-clickhouse · mcp-server-odoo · snowflake-labs-mcp · pagerduty-mcp · microsoft-fabric-rti-mcp · pgcli · blender-mcp