PostgreSQL
MCP server for PostgreSQL: local, Docker, RDS, Neon, Supabase, or behind an SSH bastion.
What can you do with PostgreSQL?
- Read-only by default; writes are an explicit opt-in (PGALLOWWRITE=true)
- Read-only enforced by the engine (BEGIN READ ONLY), never by client-side SQL parsing
- Data access behind a small typed interface; the pg driver never leaks past it
- DATABASEURL support with SSL (sslmode=disable|allow|prefer|require|verify-ca|verify-full`, custom CA)
- Prepared-statement parameters: $1-style placeholders, bound by the driver
- Result size cap (byte budget) with an explicit truncated flag instead of flooding the model's context
- Session statement timeout plus a client deadline; transaction poolers may not preserve session settings
- Errors returned as readable tool results with SQLSTATE-based hints, so the model can self-correct
Features as listed in the project's README, checked 16 Nov 2026.
About PostgreSQL
A Model Context Protocol (MCP) server for PostgreSQL: local, Docker, RDS, Neon, and Supabase databases. The server is small and auditable, with four runtime dependencies: the MCP SDK, pg, pg-connection-string, and zod (plus ssh2, an optional dependency used only for SSH tunneling).
Opening text of the project's README, checked 16 Nov 2026.
Install
{
"mcpServers": {
"mcp-postgres-server": {
"command": "npx",
"args": [
"-y",
"mcp-postgres-server"
]
}
}
}Config as documented in its source, checked 16 Nov 2026. Placeholders such as API keys are the project's own: replace them with your values.
Setup documented for
Tools (6)
| query | |
| list_schemas | |
| list_tables | |
| describe_table | |
| execute | Always (refuses writes unless PGALLOWWRITE=true) |
| connect_db | Only when PGENABLERUNTIMECONNECT=true` |
Tool names from the README, checked 16 Nov 2026.
PostgreSQL compared with other Postgres servers
| Server | Licence | Tools | Last commit | Stars |
|---|---|---|---|---|
| PostgreSQL | MIT | 6 | 16 Sept 2026 | 25 |
| postgres-mcp | MIT | 9 | 17 Aug 2026 | 3,476 |
| MCP-PostgreSQL-Ops | MIT | 37 | 14 Nov 2026 | 164 |
Every value is a checked fact on that server's own page. This is a comparison of facts, not a ranking.
Verified facts
- Maintainer
- antonorlov
Source · checked 16 Nov 2026
- Licence
- MIT
Source · checked 16 Nov 2026
- Transport
- stdio
Source · checked 16 Nov 2026
- Required settings
- Environment variables: DATABASE_URL, PG_PASSWORD, PG_SSH_PASSPHRASE, PG_SSH_PASSWORD
Source · checked 16 Nov 2026
- Setup documented for
- Claude Code
- Cursor
- VS Code
- Windsurf
- Codex
Source · checked 16 Nov 2026
- Repository
- github.com/antonorlov/mcp-postgres-server
Source · checked 16 Nov 2026
- Package
- mcp-postgres-server (npm)
Source · checked 16 Nov 2026
- Latest version
- 0.3.1
Source · checked 16 Nov 2026
- Last commit
- 16 Sept 2026
Source · checked 16 Nov 2026
- GitHub stars
- 25
Source · checked 16 Nov 2026
- Open issues
- 1
Source · checked 16 Nov 2026
Each value links to where it was found and shows the date it was checked. How we verify
Frequently asked questions
What does PostgreSQL do?
MCP server for PostgreSQL: local, Docker, RDS, Neon, Supabase, or behind an SSH bastion.
Which MCP clients does PostgreSQL document setup for?
Its README documents setup for Claude Code, Cursor, VS Code, Windsurf, Codex.
How do I install PostgreSQL?
Add the install config shown on this page to your MCP client's configuration; the package is mcp-postgres-server (npm). Check the README for client-specific steps.
What licence is PostgreSQL under?
MIT, as reported by the repository on 16 Nov 2026.
Is PostgreSQL still maintained?
The last commit was on 16 Sept 2026, and the repository had 1 open issues.
What settings does PostgreSQL need?
Environment variables: DATABASE_URL, PG_PASSWORD, PG_SSH_PASSPHRASE, PG_SSH_PASSWORD.
What tools does PostgreSQL expose?
6 tools: query, list_schemas, list_tables, describe_table, execute, connect_db.
More Postgres MCP servers
postgres-mcp
Postgres MCP Pro provides configurable read/write access and performance analysis for you and your AI agents.
MCP-PostgreSQL-Ops
Give AI assistants full PostgreSQL DBA superpowers — 30+ tools for performance analysis, bloat detection, lock/deadlock monitoring, autovacuum & schema inspection. No extensions required. PG 12-18.
