Postgres MCP server
io.github.edelciomolina/postgres-mcp·v1.7.0·5 starsPostgreSQL MCP wrapper with .env credential mapping, tool selection, and safe read-only defaults.
5 stars110 downloads/wk
Reviews
Write oneNobody has reviewed Postgres MCP yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Postgres MCP tools (16, 3 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
pg_analyze_databaseAnalyze PostgreSQL database performance and configuration.
pg_debug_databaseDiagnose common PostgreSQL issues - connections, locks, performance, replication.
pg_execute_mutationwrite actionExecute data modification operations - INSERT, UPDATE, DELETE, or UPSERT. NOT enabled by default; must be opted-in via tool= arg.
pg_execute_querywrite actionExecute SELECT queries and data retrieval operations - operation="select/count/exists" with query and optional parameters.
pg_execute_sqlwrite actionExecute arbitrary SQL statements with optional transaction support. NOT enabled by default; must be opted-in via tool= arg.
pg_get_setup_instructionsGet platform-specific PostgreSQL setup and connection instructions.
pg_inspect_schemaInspect PostgreSQL schema - list tables and columns, view ENUM types. Read-only.
pg_manage_constraintsManage PostgreSQL constraints - get, create foreign keys, drop constraints.
pg_manage_functionsManage PostgreSQL functions - get, create, or drop functions.
pg_manage_indexesManage PostgreSQL indexes - get, create, drop, reindex, and analyze usage.
pg_manage_queryManage PostgreSQL query analysis and performance - EXPLAIN plans, slow queries, statistics.
pg_manage_rlsManage PostgreSQL Row-Level Security - enable/disable RLS and manage policies.
pg_manage_schemaManage PostgreSQL schema - get schema info, create/alter tables, manage enums.
pg_manage_triggersManage PostgreSQL triggers - get, create, drop, enable/disable.
pg_manage_usersManage PostgreSQL users and permissions - get permissions, create/drop/alter users, grant/revoke.
pg_monitor_databaseGet real-time monitoring information for a PostgreSQL database.
Public scan report
scanner v0.1.9 · 2026-09-27 · same rubric, same numbers if you re-run it
- Code scan3 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancelast push 105 days ago8/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
How Postgres MCP compares
Against every graded Databases MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 82/100
- higher than 55% of 802 Databases servers
- Tools
- 16
- the typical Databases server has 8
- Tools that change things
- 19%
- typical: 10%. Fewer write tools means less an agent can break
- GitHub stars
- 5
- more than 73% of 602 Databases servers
- Downloads a week
- 110
- more than 60% of 328 Databases servers with a package
What its tools let an agent do: 13 read · 3 change
Install Postgres MCP in Claude Code, Cursor or VS Code
Runs npx -y @edelciomolina/postgres-mcp on your machine. Read the scan report first; the gateway never runs local packages.
claude mcp add postgres-mcp -- npx -y @edelciomolina/postgres-mcp
What the publisher says
From the Postgres MCP repository's README, as published. We do not edit it. Read it on GitHub
English | 🌐 Português
Postgres MCP 🔌 Native MCP server for PostgreSQL - reads credentials from .env at runtime with flexible key mapping, configurable tool selection, and read-only mode by default.
✨ What it does
Most LLMs interact with databases by guessing - assuming table names, inventing column names, and writing queries that may fail or expose sensitive data. Postgres MCP solves this by giving the LLM a structured, safe interface to actually understand the database before touching it.
Built with @modelcontextprotocol/sdk and pg, it provides:
- 🧠 Semantic knowledge graph - the LLM gets a complete map of schemas, tables, columns, foreign keys, inferred relations, risk levels, and business domains - built from the real schema, not invented
- 🛡️ Read-only by default - no writes, no DDL, no arbitrary SQL unless you explicitly opt in; pgclassifyquery_risk lets the LLM check a query's safety before running it
- 🔐 Runtime credential resolution - credentials are read from .env at startup; nothing sensitive lives in mcp.json
- 🎯 Explicit tool selection - every tool is opt-in via tool= args, so the LLM only sees what you choose to expose
📋 Requirements
- ⚙️ Node.js >= 18
- 📄 A .env file with database credentials (anywhere in the project tree - see .env Discovery)
🚀 Installation
There are two ways to use this package. Choose the one that best fits your workflow.
Option 1 - No installation (via npx, recommended for quick start)
No installation needed. npx downloads and runs the package on demand. Add -y as the first argument to skip the confirmation prompt.
{
"servers": {
"Postgres Tools": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@edelciomolina/postgres-mcp"
],
"env": {
"MCP_KEY_HOST": "DB_HOST",
"MCP_KEY_PORT": "DB_PORT",
"MCP_KEY_NAME": "DB_NAME",
"MCP_KEY_SSLMODE": "DB_SSLMODE",
"MCP_KEY_USER": "DB_USER",
"MCP_KEY_PASS": "DB_PASS"
}
}
}
}This starts the server with the default read-only tool set - no tool= arguments needed. To enable write-capable tools, see Write-capable tools.
💡 Using Supabase, Neon, Railway or another platform that only provides a connection string? Use MCPKEYURL pointing to DATABASE_URL (or whatever variable name the platform uses). The server will prioritize the URL and ignore the individual variables. See Connection via URL.
Option 2 - Install via VS Code (MCP extension marketplace)
VS Code supports discovering and installing MCP servers directly in the editor, without using the terminal.
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
Postgres MCP: common questions
- Is Postgres MCP server safe?
- Mostly: it is graded B (82/100). Read the Postgres MCP safety report
- How do I install Postgres MCP?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does Postgres MCP need an API key?
- No secret keys are declared. It reads 6 settings from the environment.
- Is Postgres MCP maintained?
- The last commit was 143 days ago (2026-06-13). The latest release is v1.7.0.
- What can I use instead of Postgres MCP?
- Servers from other publishers that do the same job: PostgreSQL MCP server, PostgreSQL MCP Server and Quarry MCP server.
- How does Postgres MCP compare with other Databases MCP servers?
- safety score 82/100 (higher than 55% of 802 Databases servers); tools 16 (the typical Databases server has 8); tools that change things 19% (typical: 10%. Fewer write tools means less an agent can break). Full comparison.
Alternatives to Postgres MCP
Same job from other publishers: the closest match first, then the best rated.
- PostgreSQLMCP server for PostgreSQL: local, Docker, RDS, Neon, Supabase, or behind an SSH bastion.not reviewedEstablishedB
- PostgreSQL MCP ServerPostgreSQL MCP server - query, schema introspection, explain, and health checks for AI assistantsnot reviewedEstablishedB
- QuarrySafety-railed database access: Postgres, MySQL, SQLite, Redis. Read-only by default.not reviewedGrowingA
- PostgreSQL MCP ServerPostgreSQL MCP server with 203 tools, connection pooling, HTTP/SSE, OAuth 2.1, and tool filteringnot reviewedGrowingA
- DB ExplorerRead-only SQL for PostgreSQL, MySQL and SQLite: schema, safe SELECTs, EXPLAIN, index advicenot reviewedGrowingB