Skip to content
mcp/skillhub

PostgreSQL MCP Server

by antonorlovio.github.antonorlov/mcp-postgres-serverv0.3.1

MCP server for PostgreSQL: local, Docker, RDS, Neon, Supabase, or behind an SSH bastion.

24Node.jsstdioofficial registry

context tax

pending

security

100/100

cold start

pending

freshness

Maintained35d ago

Our reading of PostgreSQL, from the data

PostgreSQL is a database MCP server from antonorlov, listed in the official MCP Registry.

We haven't measured its tool list yet, so its token cost is unknown.

Maintenance is maintained: the last public signal was 35 days ago (2026-09-16). For comparison, 63% of database servers are active or maintained.

With 24 GitHub stars it ranks #188 of 1,397 database servers we index.

It runs locally on your machine over stdio and needs 4 secrets (DATABASE_URL, PG_PASSWORD, PG_SSH_PASSPHRASE, …); use a scoped, least-privilege key.

Install PostgreSQL MCP server

Install in Claude Code

claude mcp add postgres-antonorlov -e DATABASE_URL='<database-url>' -e PG_PASSWORD='<pg-password>' -e PG_SSH_PASSPHRASE='<pg-ssh-passphrase>' -e PG_SSH_PASSWORD='<pg-ssh-password>' -- npx -y mcp-postgres-server

Configuration

VariableRequiredSecretDescription
DATABASE_URL—yesFull connection string (preferred). Supports sslmode in the URL.
PG_HOST——Database host (fallback when DATABASE_URL is not set).
PG_PORT——Database port.
PG_USER——Database user.
PG_PASSWORD—yesDatabase password.
PG_DATABASE——Database name.
PG_ALLOW_WRITE——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——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——Path to a CA certificate file. Setting it by itself implies verify-full.
PG_ENABLE_RUNTIME_CONNECT——Register the connect_db tool (runtime credential switching).
PG_MAX_RESULT_BYTES——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——Statement timeout in milliseconds, applied to every session.
PG_CONNECT_TIMEOUT——Timeout in milliseconds for a single connect attempt (raise it for slow links or SSH tunnels).
PG_SSH_HOST——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——SSH bastion port.
PG_SSH_USER——SSH username.
PG_SSH_PRIVATE_KEY——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—yesPassphrase for the private key, if encrypted.
PG_SSH_AGENT——true to use the ambient agent (SSH_AUTH_SOCK), or an explicit socket path / Windows named pipe.
PG_SSH_PASSWORD—yesSSH login password. Opt-in; a key or agent takes precedence. Prefer keys, a bastion often disables password auth.
PG_SSH_FINGERPRINT——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——SSH keepalive interval in ms; the tunnel drops after 3 unanswered keepalives, and the next call reconnects.

Security signals

100/100 — no known issues found as of 2026-10-19, from the checks below. This is not a guarantee of safety; review what a server can do before connecting it.

Deductions

No findings from the checks that ran.

Checks

  • ✓Repository hygiene (archived, activity, license, security policy)
  • ○Package metadata (install scripts, provenance) — pending
  • ○Tool descriptions (prompt-injection and hidden-text heuristics) — pending
  • ○Source scan (secrets, CVEs, risky code) by vectra-guard — pending

Scan it yourself before installing with vectra-guard, the open-source agent security CLI (made by NavyaAI, which also runs MCPSkillHub). Scoring rules

Freshness

Maintained — last maintenance signal 35d ago. The newest of the signals below sets the band.

  1. Last commit (default branch)

    2026-09-16 · 35d ago · GitHub

  2. Latest release

    2026-09-14 · 37d ago · GitHub · v0.3.1

  3. Package published

    no data · npm/PyPI

  4. Registry entry updated

    2026-09-14 · 37d ago · official registry · v0.3.1

How it compares in Database

Against the most-starred database servers we index. Token cost is per model turn, measured from each server's live tool list.

ServerStarsToolsTokens / turnFreshnessRuns
PostgreSQL (this)24—not measuredMaintainedlocal
Screenpipe21,982—not measuredActive—
Genai Toolbox16,679—not measuredActivehosted
Convex Backend12,716—not measuredActive—
Kubeshark12,100—not measuredActivelocal
Baserow6,174—not measuredActive—
All database MCP servers

FAQ

›How do I install the PostgreSQL MCP server in Claude Code?

Run: claude mcp add postgres-antonorlov -e DATABASE_URL='<database-url>' -e PG_PASSWORD='<pg-password>' -e PG_SSH_PASSPHRASE='<pg-ssh-passphrase>' -e PG_SSH_PASSWORD='<pg-ssh-password>' -- npx -y mcp-postgres-server. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.

›Does PostgreSQL require an API key?

Yes. It expects DATABASE_URL, PG_PASSWORD, PG_SSH_PASSPHRASE, PG_SSH_PASSWORD, of which 4 are secrets.

›Can I use PostgreSQL as a remote (hosted) MCP server?

No hosted endpoint is published; it runs locally over stdio.

›Is PostgreSQL in the official MCP registry?

Yes, as io.github.antonorlov/mcp-postgres-server.

Sources and method

Official MCP Registry entry
updated 2026-09-14
GitHub repository
fetched 2026-10-19
Package registry (npm / PyPI)
listed
Last checked against all sources
2026-10-19

The description, packages and links come from the maintainer's own published metadata. Token cost, security signals, freshness and the reading above are MCPSkillHub's own measurements; see the methodology. Editorial standards are owned by Ramachandra Vikas Chamarthi, Founder & AI HPC Architect. Spot an error? Request a correction or claim the listing.

Alternatives to PostgreSQL

Other database MCP servers.

View all