Best Postgres MCP Server for Production Teams

🔧 AI Tools 2026-11-23 5 min read

An agent is pointed at production Postgres through an MCP server and nobody checked whether the example configuration allows writes, whether a statement is capped, or how much of the context window the tool list consumes.

📜 Table of Contents

Four Postgres MCP servers, checked on 23 November 2026, and the one number that separates them at the start of every session is not speed. It is 261 tool-definition tokens against 6,982. The second number is paid before the agent reads a single table.

Below: what each server actually does about writes, what its own README instructs you to configure, and the trade you make by picking the smaller one.

What production changes about the choice

A development MCP server needs to do everything. A production one needs three guarantees and nothing else: the agent cannot write unless a human turned writes on, no single query can scan a hundred million rows, and the tool list does not eat the context window before the first question. Everything after that is preference.

How these four were checked

Stars, licences and last push from the GitHub API on 23 November 2026. Weekly downloads from the npm registry for the week of 15 to 21 November 2026. Behaviour from each project's own README, quoted rather than paraphrased. The tool-definition token counts come from a benchmark DBHub publishes itself, which is a bias worth naming before you read the table.

The two that can be locked to read-only, and both instruct you otherwise

DBHub (bytebase/dbhub, 3,924 stars, MIT, pushed 21 November 2026, 225,789 npm downloads that week) ships two default tools, execute_sql and search_objects, with explain_sql and health_check as opt-ins. Its README lists guardrails — read-only mode, row limiting, query timeout — and then says the thing most comparison posts leave out: with --dsn alone, execute_sql can also write, and staying read-only means pointing --config at a TOML file with readonly = true. The same README warns that read-only mode is a guardrail, not a permission boundary.

Postgres MCP Pro (crystaldba/postgres-mcp, 3,494 stars, MIT, last push 17 August 2026, 98 open issues) goes further on analysis: index tuning across candidate index sets, EXPLAIN plans with hypothetical index simulation, and health checks for vacuum, buffer cache and replication lag. Access control is a flag: --access-mode=restricted restricts to read-only transactions and adds an execution-time limit, --access-mode=unrestricted allows writes. Every configuration example in the README uses unrestricted. Copy the example and your production database is writable.

That pattern repeats across the ecosystem and it is the single most useful thing to check before deploying anything: read the example configuration, not the feature list. The examples are optimised for the tool working on the first try.

The archived one is still the most downloaded

@modelcontextprotocol/server-postgres, latest 0.6.2, carries a deprecation notice on npm: archived and unmaintained, no security guarantees. It still took 137,933 downloads in the week of 15 November 2026, and DBHub's README has a dedicated page on replacing it. Installed base outlives maintenance status by years, which is exactly how an unpatched connector ends up pointed at a production replica. If you are auditing a team's MCP setup, this package is the first thing to grep for.

What the tool list costs before the first question

MCP clients load tool definitions into the prompt. DBHub publishes a benchmark of definition size, measured with the cl100k_base tokenizer, and it is worth reading for the shape of the numbers even with the obvious bias of the author measuring his own product:

servertool definitions, tokenstools
DBHub 2.0.12612
MCP Toolbox 1.18.03,90129
Supabase MCP 0.19.06,98236

A 6,982-token tool list against a 32k window is 21% of the context gone before the user types. With 36 tools the model also has more chances to pick the wrong one, and that failure mode is invisible in the transcript — it looks like a confident answer about the wrong table. The measured side of this, on a different server, is in the 37-tool token count.

Which one to pick

situationpickthe setting that matters
agent reads production data, no writes everDBHub with a TOML configreadonly = true, plus a least-privilege database role
agent helps tune slow queries and indexesPostgres MCP Pro--access-mode=restricted, not the README example
several engines in one stack (MySQL, SQL Server, SQLite)DBHubone process, one TOML, per-connection read-only flags
agent needs Postgres documentation more than queriespg-aiguide (1,886 stars, Apache-2.0)different category: skills and schema docs, not a query gateway
you found the archived server in your configanything aboveit is unmaintained; the deprecation notice is on npm

The five-minute check before you trust any of them

Do this in that order and skip nothing. Connect the server with a database role that only has CONNECT and SELECT, and confirm the connection itself is refused on a write-locking statement. Ask the agent to insert a row; the correct outcome is an error from Postgres, not a refusal from the server, because the server's own read-only mode is a guardrail you can misconfigure. Then ask for a count over your largest table and check the server enforces a row or time cap rather than returning everything. Finally, read the query log: every statement the agent ran should be there, visible, unedited.

Things that break when the agent has write access and you have not thought about it are in the 60-attack guardrail test. A plain integration walkthrough, if you have never wired one of these up, is in the Postgres integration guide, and what the protocol itself requires of a server is in the specification notes.

What this comparison does not do

None of these servers was installed and queried for this article, so there are no latency, throughput or recall numbers here — only published facts about behaviour and size, dated 23 November 2026. Version numbers move; a flag name can change in a minor release. The token benchmark was published by one of the vendors compared, and the other two rows are unverified by me. Reproduce the counts with your own tokenizer before you make a purchasing decision on that table alone.

Related Articles
2026-08-15
AI Mind Map Generator From Text 2026: 5 Free Tools for Visual Thinkers
2026-07-27
Best Suno V4 Alternatives in 2026: 6 Free and Open Source AI Music Generators
2026-08-19
Best AI Video Generator in 2026: Runway vs Pika vs Kling Compared for Short-Form Creators
2026-08-13
LLM Guardrails Framework Comparison 2026: Guardrails AI, NeMo-Guardrails and PurpleLlama
2026-07-19
LLMOps Tools: AI Application Operations Toolchain
2026-08-03
AI Homework Helper 2026: Ollama (178k Stars) + Free Tools - Actually Learning vs Just Answering

Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only — no paid placements.

💬 Comments (0)

No comments yet. Be the first!

Login to comment