Guide · checked
The official Postgres MCP server is archived: what to use instead
If you still run @modelcontextprotocol/server-postgres, move off it. The repository is archived, the package on npm is marked unmaintained, and the published version does not carry the fix for a known way to write through it. Pick a maintained server below, and whichever you choose, connect with a login that can only read.
Portward wrote this page and makes one of the tools it mentions. Each claim about another company links to the page it came from. Found an error? Write to admin@portward.ai and we'll correct it and update the date.
01What happened
Archived in May 2025, and still unpatched on npm
The reference Postgres server ran each query inside a read-only transaction. Datadog Security Labs found that a query carrying more than one statement could end that transaction and then run any SQL, and reported it.[6] According to Datadog's timeline:
- 9 April 2025: Zed Industries patched its fork and released it as
@zeddotdev/postgres-context-server0.1.4. - 29 May 2025: Anthropic fixed the code in its repository, and on the same day archived the server with others “deemed not ready for production use”.
- The npm package, version 0.6.2, “remains unpatched”.[6]
Today the code lives in a repository GitHub marks as archived, whose README says it is “no longer maintained”,[7] and npm shows this notice on version 0.6.2, still the latest: “Archived and unmaintained; no security guarantees.”[8] Datadog's advice is to avoid it “when connecting to any database where write operations should be prevented”.[6]
The maintained options, by who runs them
| Option | Where it runs, and where the password goes | How read-only is enforced | Status |
|---|---|---|---|
| Postgres MCP ProYou run it | On your computer (Docker, pipx or uvx), or shared over SSE. The connection string is the DATABASE_URI environment variable[13] | --access-mode=restricted: "Limits operations to read-only transactions and imposes constraints on resource utilization (presently only execution time)". The README's examples use unrestricted mode, which reads and writes[13] | Repository active in 2026; latest tagged release v0.3.0 (2025-05-16)[13] |
| DBHubYou run it | On your computer or a server (npx, Docker). Its README calls it "a maintained replacement" for the reference server: an existing postgresql:// URL is passed with --dsn[14] | readonly = true on its execute_sql tool: a keyword check, which its docs call "a guardrail against accidental and agent-initiated writes, not a permission boundary"[15] | Maintained. Also reads MySQL, MariaDB, SQL Server, Oracle, ClickHouse and SQLite[14] |
| Supabase MCPYour database host runs it (Supabase projects only) | Hosted by Supabase. You sign in to Supabase; no database password is typed[11] | read_only=true: "Execute all queries as a read-only Postgres user". project_ref scopes it to one project[11] | Maintained. Its docs say to scope the server, turn on read-only mode and review the risks before connecting a production project[11] |
| Neon MCPYour database host runs it (Neon projects only) | Hosted by Neon. OAuth in a browser, or an API key[12] | A read-only setting that limits its tools "to read-safe actions"[12] | Maintained. Neon's docs: "We recommend MCP for development and testing only, not production environments"[12] |
| PortwardPortward runs it (ours) | Hosted by Portward, one engine per account. The password is typed in Portward, never in the chat or a config file | SQL parsed to exactly one SELECT, run in a read-only transaction with a 30-second limit; administrator logins refused. Columns you keep back never reach the AI | Live; Free has limits |
Not a complete list. These are the ones we read in full on 2026-11-21; more are compared in ways to give Claude access to your database. Datadog also notes that Zed's patched fork can be used where moving away is not an option.[6] Scroll sideways on a small screen.
02Before any of them
A login that can only read
The lesson of the archived server is that a check inside a server can fail. The database login is the lock that holds when it does: OWASP's guidance is to give an AI extension only the permissions it needs.[5] DBHub's own docs say the same about its read-only mode, which is “not a permission boundary”.[15] Create this role and use it with whichever server you pick:
-- Run as an administrator. Replace the names in angle brackets. CREATE ROLE claude_ro WITH LOGIN PASSWORD '<a new password>'; GRANT CONNECT ON DATABASE <your_db> TO claude_ro; GRANT USAGE ON SCHEMA <your_schema> TO claude_ro; -- Every table and view in the schema, or list only the ones the AI needs: GRANT SELECT ON ALL TABLES IN SCHEMA <your_schema> TO claude_ro; -- Or columns only: GRANT SELECT (id, region, total) ON <table> TO claude_ro; -- Tables the owner creates later: ALTER DEFAULT PRIVILEGES FOR ROLE <table_owner> IN SCHEMA <your_schema> GRANT SELECT ON TABLES TO claude_ro;
03Choosing
When a local server is the better choice, and where Portward fits
Run one yourself when
- the database is on a private network or your own computer, where a hosted service cannot reach it;
- you do not want a third party between your AI and your database;
- you work in a coding tool against a development database and are comfortable editing a config file.
Portward also publishes a local, open-source version that runs on your computer under the Apache 2.0 licence: portward-mcp on GitHub.
Use your database host's own server when
your database is on Supabase or Neon and you are doing development work. Both sign you in without a database password, and both tell you to be careful with production data.[11][12]
Portward fits when
you use Claude in the browser, your PostgreSQL or MySQL database is reachable from the internet, and the point is to decide what the AI sees. Each query is parsed to exactly one SELECT, so a second statement is refused before anything runs, and it runs in a read-only transaction. Columns you keep back never reach your AI, and every answer has a receipt. The trade-off is the one in the table: Portward runs the engine, so it can technically see what passes through it (security page). Portward holds your account email, your database login (sealed to your engine's key), your rules and notes, the questions and SQL your AI ran, receipts and usage counts, and the AI log of what the AI was sent. Rows pass through your engine to the AI and are not stored by Portward, except in that AI log, which deletes them after 30 days, and in the results panel, which deletes them after 24 hours. Your engine is separate from every other account's.
Sources
Each read on . First published .
- [5]OWASP LLM06:2025 Excessive Agency
- [6]Datadog Security Labs: SQL injection in the PostgreSQL MCP server
- [7]modelcontextprotocol/servers-archived (the archived reference servers, Postgres among them)
- [8]npm registry: @modelcontextprotocol/server-postgres, latest version (its deprecated notice)
- [11]Supabase docs: Model context protocol (MCP)
- [12]Neon docs: Neon MCP Server
- [13]crystaldba/postgres-mcp (Postgres MCP Pro)
- [14]bytebase/dbhub
- [15]DBHub docs: Read-only mode