PostgreSQL
io.github.antonorlov/mcp-postgres-server
About PostgreSQL
PostgreSQL is an MCP server published by the GitHub account antonorlov. MCP server for PostgreSQL: local, Docker, RDS, Neon, Supabase, or behind an SSH bastion.
It runs on your own machine: your AI client starts it from the npm package mcp-postgres-server at version 0.3.1.
It asks for 4 secrets: DATABASE_URL, PG_PASSWORD, PG_SSH_PASSPHRASE and PG_SSH_PASSWORD. Give it a key with the least access that still works.
Version 0.3.1 was published on 14 September 2026, and the source code is public, so you can read it before installing.
Written from the registry entry. 9 automated checks on the registry entry and the package code: 6 pass, 2 warn, 0 fail, 1 info. How we check.
What it asks for
| Variable | Required | Secret | Description |
|---|---|---|---|
DATABASE_URL | No | Yes | Full connection string (preferred). Supports sslmode in the URL. |
PG_HOST | No | No | Database host (fallback when DATABASE_URL is not set). |
PG_PORT | No | No | Database port. |
PG_USER | No | No | Database user. |
PG_PASSWORD | No | Yes | Database password. |
PG_DATABASE | No | No | Database name. |
PG_ALLOW_WRITE | No | No | When true, execute performs writes and reads are sent directly. Off (default) is read-only: execute refuses writes and each read runs in a READ ONLY transaction. |
PG_SSLMODE | No | No | TLS mode. require/allow/prefer encrypt without verifying the certificate; verify-ca/verify-full verify it (supply a CA via PG_SSL_CA). Unlike libpq, allow/prefer do not fall back to plaintext, so a server without TLS needs disable. |
PG_SSL_CA | No | No | Path to a CA certificate file. Setting it by itself implies verify-full. |
PG_ENABLE_RUNTIME_CONNECT | No | No | Register the connect_db tool (runtime credential switching). |
PG_MAX_RESULT_BYTES | No | No | Byte budget for a query result sent to the model. Whole rows are kept while they fit; over the budget returnedRows < rowCount and truncated is true. |
PG_STATEMENT_TIMEOUT | No | No | Statement timeout in milliseconds, applied to every session. |
PG_CONNECT_TIMEOUT | No | No | Timeout in milliseconds for a single connect attempt (raise it for slow links or SSH tunnels). |
PG_SSH_HOST | No | No | SSH bastion host. Setting it enables tunneling: the server reaches the database only through an SSH tunnel to this host. Needs the ssh2 optional dependency. |
PG_SSH_PORT | No | No | SSH bastion port. |
PG_SSH_USER | No | No | SSH username. |
PG_SSH_PRIVATE_KEY | No | No | Path to a private key file. If unset, auth falls back like ssh: a running agent (SSH_AUTH_SOCK), then a default key (~/.ssh/id_ed25519, id_rsa, id_ecdsa). |
PG_SSH_PASSPHRASE | No | Yes | Passphrase for the private key, if encrypted. |
PG_SSH_AGENT | No | No | true to use the ambient agent (SSH_AUTH_SOCK), or an explicit socket path / Windows named pipe. |
PG_SSH_PASSWORD | No | Yes | SSH login password. Opt-in; a key or agent takes precedence. Prefer keys, a bastion often disables password auth. |
PG_SSH_FINGERPRINT | No | No | Pinned host-key fingerprint (SHA256:...). Host-key verification is mandatory and set only this way: without it the tunnel refuses to connect. Get it with ssh-keygen -lF host. |
PG_SSH_KEEPALIVE_INTERVAL | No | No | SSH keepalive interval in ms; the tunnel drops after 3 unanswered keepalives, and the next call reconnects. |
Checks
| Check | Result | Detail |
|---|---|---|
| Source repository linked | Pass | https://github.com/antonorlov/mcp-postgres-server |
| Version pinned | Pass | Every package has an explicit version |
| Secrets requested | Warn | Asks for 4 secrets: DATABASE_URL, PG_PASSWORD, PG_SSH_PASSPHRASE, PG_SSH_PASSWORD |
| Known package registry | Pass | All packages come from npm, PyPI, OCI, NuGet or MCPB |
| Namespace ownership | Info | Name verified via GitHub account antonorlov |
| Registry text aimed at the AI | Pass | Description and settings contain no hidden characters or instructions to the AI |
| Install scripts | Pass | mcp-postgres-server@0.3.1 runs nothing at install |
| Code red flags | Warn | Reads SSH or cloud credentials (build/ssh-connector.js:85: "id_ed25519") |
| Text aimed at the AI | Pass | No hidden characters or instructions to the AI in 5 files, including comments and the README |
Popularity & health: 57 / 100
Worked out from public numbers and our own checks, not from user reviews or ratings. It says how used and how looked-after a server is, not whether it is safe.
10 forks, 1 merged pull requests. Sources: GitHub, npm, PyPI (pypistats.org) and Hacker News (Algolia), fetched 2026-10-31.
What people say
No Hacker News threads link to its source code.
Look further: search Reddit, search Hacker News, read its GitHub issues. These are not reviews we checked.
Facts
| Registry name | io.github.antonorlov/mcp-postgres-server |
|---|---|
| Publisher | GitHub account antonorlov |
| How the name is verified | Name verified via GitHub account antonorlov. The registry ties the name prefix to that account or domain; it does not check the code. |
| Type | Local: runs on your machine from a package |
| Packages | npm mcp-postgres-server 0.3.1 (stdio) |
| Version | 0.3.1 |
| Published | |
| Last updated | |
| Source repository | https://github.com/antonorlov/mcp-postgres-server |
| Website | https://github.com/antonorlov/mcp-postgres-server#readme |
| Category | Databases & data (assigned by keyword rule, not by hand) |
Related servers in Databases & data
- Neon Zero-Trust Gateway3/3Zero-Trust MCP gateway securing internal database tools behind an…
Neon3/3Official Neon MCP server for managing Neon projects and Lakebase…- interactive-terminal5/7MCP server for real interactive terminal sessions — REPLs, SSH,…
- dbmole7/7PostgreSQL and MySQL with connections managed at runtime by the…
- DB MCP Server7/8Database MCP server for MySQL, PostgreSQL, MongoDB, and SQLite with…
- Ekwo OS — open source accounting: ledger, invoices and VAT on your own Supabase or Postgres8/9Double-entry books an agent keeps as the user: invoices, VAT…