SERVER

MCP PostgreSQL Server

Rank #46,916

glama/antonorlov/mcp-postgres-server

Query PostgreSQL and inspect schemas over MCP. Connects to local, Docker, RDS, Neon, Supabase, or a database behind an SSH bastion.

Versions unknown
23 GitHub stars
by antonorlov (5 servers)View repository ↗
First listed
Mar 24, 2025
Last publish date
—
PURPOSE

What you can do with MCP PostgreSQL Server

A small Node.js MCP server (mcp-postgres-server) for querying PostgreSQL, read-only by default with writes opt-in via an environment flag, and with SSL, SSH tunnelling, timeouts and a result-size cap built in.

Suitable tasks
  • Run read-only SELECT, WITH, EXPLAIN and SHOW statements
  • List schemas and tables, describe a table's columns
  • Run INSERT/UPDATE/DELETE or DDL when writes are enabled
  • Reach local, Docker, RDS, Neon or Supabase databases
  • Switch databases at runtime when explicitly enabled
CAPABILITIES AND LIMITATIONS

What MCP PostgreSQL Server can and cannot do

Capabilities

Six tools: query (one read-only statement), execute (writes, refused unless PG_ALLOW_WRITE=true), list_schemas, list_tables, describe_table and connect_db (registered only with PG_ENABLE_RUNTIME_CONNECT=true). In the default mode each query runs inside BEGIN READ ONLY ... ROLLBACK.

Documented tools
  • query
  • execute
  • list_schemas
  • list_tables
  • describe_table
  • connect_db
Limitations
  • Read-only mode does not stop prompt injection carried in row data; the docs say not to point it at production
  • With PG_ALLOW_WRITE=true the query tool loses its read-only wrapper, so a write sent through query would run
  • One statement per call; multi-statement input is rejected
  • sslmode allow/prefer encrypt without verifying the certificate and do not fall back to plaintext
  • SSH host-key verification is mandatory: PG_SSH_FINGERPRINT must be set or the tunnel refuses to connect
REQUIREMENTS

What you need before using MCP PostgreSQL Server

DeclaredNo credentialsNo credentials declared

The registry listing declares no required environment variables or authentication. This is declared metadata, not a verified install — the repository README is the authority.

Declared by Glama, last synced Oct 16, 2026. Not independently verified by MCP Toplist.

Runtime
Node.js 20+ via npx -y mcp-postgres-server
Credentials
DATABASE_URL, or PG_HOST, PG_PORT, PG_USER, PG_PASSWORD, PG_DATABASE
Permissions
A least-privilege database role (the server warns on stderr when connected as superuser)
Also needed
PG_SSLMODE / PG_SSL_CA for TLS; PG_SSH_* for tunnelling; PG_ALLOW_WRITE=true to enable writes
INSTALLATION AND FIRST TASK

Connect MCP PostgreSQL Server and confirm it works

  1. Add a server entry running npx -y mcp-postgres-server with DATABASE_URL in env
  2. Create a least-privilege role for the agent and use it in the URL
  3. Leave PG_ALLOW_WRITE unset for read-only; set it to true only when writes are needed
  4. Optionally tune PG_STATEMENT_TIMEOUT (default 30000 ms) and PG_MAX_RESULT_BYTES (default 32768)

Install configuration unavailable. No registry publishes a machine-readable install config for this server — follow the repository README.

First successful task

Ask the agent "what tables are in the public schema?" so it calls list_tables.

Expected: A list of tables in public; a follow-up write through query fails because of the READ ONLY transaction.

ALTERNATIVES

When to choose another server

  • Postgres MCP#724

    You want health checks and index tuning on top of restricted SQL.

  • DBHub#63

    You also connect to MySQL, SQL Server, Oracle or SQLite.

  • PostgreSQL Database Management Server#10,284

    You need tiered administration tools (roles, RLS, import/export), not just queries.

Compared side by side in PostgreSQL MCP servers.

Other servers by antonorlov
View all antonorlov servers →
MAINTENANCE AND EVIDENCE

What changed, and when this was checked

First listed
Mar 24, 2025
Version history
Unavailable — no registry exposes versions and no release tags were found
Requirements evidence
Declared by Glama, last synced Oct 16, 2026. Not independently verified by MCP Toplist.
Profile checked
Oct 9, 2026 against README
Ranking data as of
Oct 16, 2026
Registry sightings
  • Glama ↗listed since Apr 26, 2026 · still listed

Do you maintain MCP PostgreSQL Server? to correct or enrich this profile.

VERSIONS

Version information unavailable

The registry that lists this server does not expose version metadata, and no release tags were found on the linked repository. MCP Toplist cannot say how, or whether, this server is versioned.

STANDING
#46,916of 144,396 active serversTop 50%

Ranks ahead of 97,480 of 144,396 servers on MCP Toplist.

Recent momentum
+11GitHub stars since Apr 27 (+92%)
BADGE

Show your rank

Maintain this server? Add the live rank badge to your README — it updates automatically as the leaderboard changes.

MCP Toplist: Top 50% of 144,396
Markdown
[![MCP Toplist](https://mcptoplist.com/badge/glama%2Fantonorlov%2Fmcp-postgres-server.svg)](https://mcptoplist.com/server/glama%2Fantonorlov%2Fmcp-postgres-server)
HTML
<a href="https://mcptoplist.com/server/glama%2Fantonorlov%2Fmcp-postgres-server"><img src="https://mcptoplist.com/badge/glama%2Fantonorlov%2Fmcp-postgres-server.svg" alt="MCP Toplist: Top 50% of 144,396" /></a>

Variants: append ?metric=score or ?metric=stars to the image URL.

FAQ

Frequently asked questions

Who maintains MCP PostgreSQL Server?
MCP PostgreSQL Server is maintained by antonorlov, which publishes 5 MCP servers (5 total versions) tracked on MCP Toplist.
Is MCP PostgreSQL Server listed on the Official MCP Registry?
MCP PostgreSQL Server is not on the Official MCP Registry. It is listed on Glama.
How many versions does MCP PostgreSQL Server have?
Version information is unavailable for MCP PostgreSQL Server: no registry that lists it exposes version metadata, and no release tags were found on its repository.
Where can I find the source code for MCP PostgreSQL Server?
The source code for MCP PostgreSQL Server is hosted at github.com/antonorlov/mcp-postgres-server.
Used in projects

Do you run this server?

Community projects list the MCP servers behind real agents and apps. Publish yours and this page will link to it.

EXPLORE