PostgreSQL MCP Server
A Model Context Protocol (MCP) server for PostgreSQL: local, Docker, RDS, Neon, and Supabase databases.
People who work with database, postgres and postgresql and want it reachable from Claude, Cursor, VS Code, or another MCP client. The project is written in TypeScript.
VERIFIED ACTIVE
LAST COMMIT 2026-09-16 · ★ 23 · VERIFIED 2026-09-30
MIT · TypeScript servers · how we verify → /methodology
01 · Install PostgreSQL
before you install - you'll need
Set DATABASE_URL, PG_ALLOW_WRITE, PG_HOST, PG_PORT, PG_USER, PG_PASSWORD, PG_DATABASE, PG_SSH_USER, PG_SSH_PRIVATE_KEY, PG_SSH_FINGERPRINT before connecting. PG_SSH_HOST is optional or environment-specific per the README.
Claude Code
claude mcp add antonorlov-mcp-postgres-server -- npx -y mcp-postgres-server Claude Desktop / Cursor / VS Code - add to config
{
"mcpServers": {
"antonorlov-mcp-postgres-server": {
"command": "npx",
"args": [
"-y",
"mcp-postgres-server"
]
}
}
} Same JSON for Cursor. For VS Code, rename the top-level key from `mcpServers` to `servers`.
Using another client? Same JSON, different key
Claude Desktop · mcpServers
Cursor · mcpServers
VS Code · servers
Windsurf · mcpServers
Zed · context_servers
Cline · mcpServers
Roo Code · mcpServers
Continue · mcpServers
LibreChat · mcpServers
Gemini CLI · mcpServers
Codex CLI · mcp_servers
Full setup guides: every client.
02 · Evidence
Security posture
What to check before giving this server access to your agent - from the registry, GitHub, and our own probes. We don't score safety; we show what's verifiable.
runs as local process (stdio) - runs on your machine with your user's permissions
license MIT - declared in the repository
npm package mcp-postgres-server - unscoped; check the name against the project README before installing
registry namespace io.github.antonorlov is GitHub-verified and matches the repo owner
03 · What PostgreSQL can do
Prose above is summarized from the project's README and registry record - no invented capabilities.
What you can build
An agent gets 2 documented tools across run & execute, connect, including execute, connect_db.
The 2 tools it gives your agent
Extracted from the project's README - what PostgreSQL lets an agent do.
- execute
- - Always (refuses writes unless PG_ALLOW_WRITE=true)
- connect_db
- - Only when PG_ENABLE_RUNTIME_CONNECT=true
Latest releases
v0.3.1 · 2026-09-14
Changed · Every tool now documents the exact shape it returns, so the model knows the response · before the first call: query returns {rows, rowCount, returnedRows, truncated} (plus · hint when truncated), execute…
v0.3.0 · 2026-09-13
Added · SSH failures are classified into stable codes (SSH_CONFIG_INVALID, SSH_KEY_INVALID, · SSH_CONNECT_FAILED, SSH_TIMEOUT, SSH_AUTH_FAILED, SSH_HOST_KEY_MISMATCH, · SSH_FORWARD_FAILED, SSH_CONNECTION_LOST) with…
v0.2.0 · 2026-09-13
> BREAKING (from 0.1.x): · > · > 1. Read-only by default. Set PG_ALLOW_WRITE=true for writes; execute stays visible but refuses them until then. · > 2. connect_db requires PG_ENABLE_RUNTIME_CONNECT=true (otherwise not…
04 · Who maintains PostgreSQL
PostgreSQL is maintained by antonorlov. It's the only MCP server we track from this author; the repo dates to Mar 2025.
05 · Facts
- repository
- github.com/antonorlov/mcp-postgres-server
- category
- database - actively maintained as of 2026-09-30.
- release cadence
- 3 releases in the last 90 days (latest 2026-09-14)
- registry
- io.github.antonorlov/mcp-postgres-server (active, first published 2026-09-14 · 2 versions)
- packages
- npm:mcp-postgres-server
06 · PostgreSQL FAQ
What is PostgreSQL?
A Model Context Protocol (MCP) server for PostgreSQL: local, Docker, RDS, Neon, and Supabase databases.
Is PostgreSQL still maintained?
Yes - as of 2026-09-30, its last commit was 2026-09-16 and it shipped 3 releases in the last 90 days. We re-verify nightly.
How do I install PostgreSQL?
Run `npx -y mcp-postgres-server`. The README documents 11 environment variables (DATABASE_URL, PG_ALLOW_WRITE, PG_HOST…) to set first. Set DATABASE_URL, PG_ALLOW_WRITE, PG_HOST, PG_PORT, PG_USER, PG_PASSWORD, PG_DATABASE, PG_SSH_USER, PG_SSH_PRIVATE_KEY, PG_SSH_FINGERPRINT before connecting. PG_SSH_HOST is optional or environment-specific per the README. You can also paste the ready-made client config above.
Does PostgreSQL run locally?
Yes - it's a stdio server: it runs on your machine (via npx) with your user's permissions. Your data stays local unless the server itself calls external APIs.
07 · Alternatives to PostgreSQL
Alternatives to PostgreSQL
Maintained database servers if PostgreSQL isn't the fit.
- Dbx Query databases from AI agents using connections configured in DBX. ★ 22,689 · 2026-09-30
- Toolbox for Databases MCP Toolbox for Databases enables your agent to connect to your database. ★ 16,541 · 2026-09-30
- Butterbase Ai MCP Server Butterbase MCP server - manage your backend: schemas, auth, functions, storage, RAG, deploys. ★ 3,683 · 2026-09-29
- Dbhub Token-efficient database MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite ★ 3,587 · 2026-09-28
- LINQ to DB Inspect database schemas and execute SQL queries across multiple database providers with LINQ to DB. ★ 3,331 · 2026-09-30
- Supabase MCP server for interacting with the Supabase platform ★ 2,926 · 2026-09-28
Pairs well with
Servers that cover what PostgreSQL doesn't - only shown when the pairing reason fits the companion.
- Server Chart → data & analytics companion data & analytics · ★ 4,388
- Keboola MCP Server → data & analytics companion data & analytics · ★ 86
- Server Filesystem → filesystem companion filesystem · ★ 39,168
- Pdf MCP → filesystem companion filesystem · ★ 145
- Telnyx → API integration companion API integration · ★ 197
- Microsoft 365 MCP Server → API integration companion API integration · ★ 1,002
More database MCP servers · Garmin Local MCP · Fastbcp MCP · Schema Brain · Schemagate · openLCA MCP Server
More TypeScript MCP servers · Rftools · Sitecore Server · Sipcode · Style Kit · see all