Postgres
Query Postgres databases with natural language. Read-only access by default - the agent sees your schema and runs SELECT queries safely.
Delv Safety Grade: A+
Score 92/100 · assessed 2026-04-22
Official Anthropic MCP server for Postgres database queries, maintained in the primary modelcontextprotocol/servers monorepo. Read-only by default is the key safety feature here: Claude can inspect schema and run SELECT queries but cannot modify data without explicit configuration. Distributed via npm with standard versioning, fully open source with clear documentation. The connection string in the install command necessarily contains credentials, which is standard for database tooling but means secrets live in your MCP config file. Permissions are scoped to database reads plus network access to reach the Postgres instance. No filesystem or shell access. The maintainer pedigree is excellent and supply chain is clean. Main risk is credential exposure in config files and the potential for information disclosure if pointed at sensitive databases.
Lethal Trifecta (prompt-injection exposure)
ONE OF THREEDirect DB access. Attackers need another axis to exfiltrate. Still high-stakes.
Green flags
- Read-only by default prevents accidental data modification or deletion
- Official Anthropic server with active maintenance in primary monorepo
- Standard npm package distribution with semantic versioning
- Open source with clear documentation and issue tracking
- Scoped to database operations only, no filesystem or shell access
Red flags
- Database credentials stored in plaintext MCP configuration file
- Can read entire database schema and all table contents by default
- No built-in query cost limits or row count restrictions mentioned
Permissions requested
Install
npx -y @modelcontextprotocol/server-postgres postgresql://user:pass@host/db
{
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"]
}
}Review
Install this if you work with Postgres and want to ask questions about your data in plain English. It's fast, safe, and requires zero setup beyond a connection string. Skip it if you're already comfortable in psql or need write access regularly.
Good at
- Read-only by default means you can explore production databases without risk of accidental writes.
- Schema introspection is automatic - Claude sees your tables, columns, and types without manual configuration.
- One-line install with no environment variables or dependencies beyond Node.
- Official Anthropic maintenance means it's stable and well-documented.
- Works across Claude Desktop, Cursor, and Windsurf without host-specific quirks.
Watch out
- Connection strings live in your config file in plain text unless you use environment variables.
- Read-only mode requires a flag flip if you want Claude to draft INSERT or UPDATE statements you can run yourself.
- Multiple databases mean multiple config entries - no dynamic switching without editing the config.
- Advanced Postgres features like full-text search or JSON operators aren't exposed as dedicated tools.
Use cases
- Ad-hoc data exploration
- Debugging production queries
- Drafting migrations with schema context
- Pulling metrics for reports
Getting started
Works with
Similar MCPs
- MySQLRead-only MySQL access for Claude. Schema-aware, runs SELECTs safely, perfect for ad-hoc analytics on a production replica.
- MongoDBMongoDB's official MCP for natural-language queries against your collections. Read-only by default, with explicit write toggles.
- dbtdbt Labs' official MCP. Run models, explore the semantic layer, query the discovery API, and search project docs from your agent.
- NeonNeon's official MCP for serverless Postgres. Manage projects, branches, and run SQL against any of your databases.