DATABASE DIAGNOSTICS / Crystal DBA
Postgres MCP Pro
Combines PostgreSQL schema and SQL access with health checks, query plans and index-analysis tools.
“Postgres MCP Pro does much more than wrap a database connection.”
01 / THE REASONING
Why this made the selection.
- Provides database-health and query-plan tools in addition to generic SQL access.
- The restricted access mode is implemented separately from unrestricted execution.
- The pinned README adds index tuning, explain plans, and health checks on top of a Postgres connection, with an explicit restricted mode for production.
- Restricted mode is not a database role: it parses SQL and rejects commit or rollback so a read-only transaction cannot be left.
02 / THE REVIEW RECORD
What we actually inspected.
Source review has boundaries.
A clear record is more useful than a “safe” badge.
Material inspected
- README.md setup, configuration and operating-limit sections at 15c8e33353546148acc2d8bd784551cf3905d1e2
- LICENSE at the same revision
- pyproject.toml
- src/postgres_mcp/server.py
- README.md
- LICENSE
- Round 2 reread of acquired publisher setup and permission evidence; see immutable wave review.
Our findings
- The entrypoint defaults to unrestricted mode, so the example explicitly selects restricted.
- The README distinguishes pg_stat_statements workload statistics from hypopg hypothetical indexes and requires Python >=3.12 for the Python path.
- Restricted mode limits the agent to read-only transactions and, at present, an execution-time cap, while unrestricted mode allows data and schema changes.
- The adapter README describes combining read-only transactions with pglast parsing that rejects commit or rollback statements; this is a statement about the adapter protections, not a claim that PostgreSQL lacks session defaults for read-only transactions.
- Those protections can be circumvented if unsafe stored-procedure languages are enabled, and the experimental LLM index tuner does not run without OPENAI_API_KEY.
- The README explicitly identifies unsafe stored procedure languages as a possible route around restricted-mode protections.
Not established by this review
- Server startup, authentication and live tool calls were not tested.
- Published package/container parity with the inspected source commit and security isolation were not tested.
- The server was not started and its tools were not called.
- A pin does not verify transitive dependencies.
The review applies to the material and revision named here. A newer upstream release can change its behavior.
03 / PUT IT TO WORK
Connect a server deliberately.
DOCUMENTED COMMAND
pipx install postgres-mcp Copying does not execute this command. It may retrieve a newer version than the reviewed source.
- Install with the README's pipx line (the README also gives docker pull crystaldba/postgres-mcp and uv pip install postgres-mcp). It was not run.
- Add the README's Claude Desktop block for your install method and set DATABASE_URI through the client's secret mechanism.
- Replace --access-mode=unrestricted with --access-mode=restricted, as the README says, and use a database role limited to the intended schemas; load pg_stat_statements and hypopg only when needed.
Before you start
- Docker, or Python 3.12 or newer with pipx or uv.
- A reachable PostgreSQL database and credentials for it.
Documented configuration example
Use the client and authentication context described in the setup guidance. Configuration formats vary between hosts.
{
"mcpServers": {
"postgres": {
"command": "postgres-mcp",
"args": [
"--access-mode=unrestricted"
],
"env": {
"DATABASE_URI": "postgresql://username:password@localhost:5432/dbname"
}
}
}
} 04 / FOLLOW THE EVIDENCE
The source trail.
Our notes are separate from the original resource.
Check upstream before adopting a new version.
https://github.com/crystaldba/postgres-mcp/blob/15c8e33353546148acc2d8bd784551cf3905d1e2/README.md
Supports: summary, upstreamDescription, install, configExample, access, limitations, bestFor, review
https://github.com/crystaldba/postgres-mcp/blob/15c8e33353546148acc2d8bd784551cf3905d1e2/LICENSE
Supports: license
https://github.com/crystaldba/postgres-mcp/blob/15c8e33353546148acc2d8bd784551cf3905d1e2/pyproject.toml
Supports: review, install, language
https://github.com/crystaldba/postgres-mcp/blob/15c8e33353546148acc2d8bd784551cf3905d1e2/src/postgres_mcp/server.py
Supports: review, install, language