프로토타입 · 미리 보기: 공식 레지스트리의 모든 서버를 담고 있으며 30분마다 동기화해요. 리뷰와 계정 기능은 다음 단계에서 열려요.
PopNx MCPAI를 쓰는 사람을 위한 MCP 서버 · 쉬운 말로 설명해요

PostgreSQL (hardened, read-only)

제작자: Eszetael버전 0.1.10i★ –i내 컴퓨터에서 실행
레지스트리 이름io.github.Eszetael/postgres-mcp-hardened

설치

개요

제작자가 쓴 설명(영어 원문)

Read-only PostgreSQL over MCP. Writes refused at the parsed SQL, plus a READ ONLY transaction.

PopNx MCP의 세 기둥

이 세 가지는 절대 하나의 점수로 합치지 않아요. 의견, 측정, 인기는 서로 다른 것이니까요.

할 수 있는 일

이 서버는 아직 쉬운 말로 된 요약을 쓰지 못했어요. 아래는 레지스트리에서 읽어 온 사실이에요.

  • 연결 방식: 내 컴퓨터에서 실행
  • 전송 방식: stdio, Streamable HTTP
  • 카테고리: 데이터베이스 및 데이터셋
  • 입력해야 할 값: DATABASE_URL

설치

쓰고 있는 AI 앱을 고른 다음 설정을 복사하세요.

설치하기 전에

  • 기본 점검: 1개 중 1개 통과
  • 내 컴퓨터에서 내 사용자 계정의 권한(파일, 네트워크, 앱)으로 실행돼요.
  • 직접 입력할 값: DATABASE_URL, MCP_STATEMENT_TIMEOUT, MCP_ALLOW_TABLES, MCP_AUDIT_LOG

비밀로 표시된 값은 내 계정의 열쇠예요. 절대 다른 사람과 공유하거나 채팅에 붙여 넣지 마세요.

필요한 것

  • npmNode.js 설치(npx 명령어용)

어떤 앱을 쓰세요?

위에서 앱을 고르세요. 기억해 두었다가 다음부터는 버튼에 “…에 설치”라고 표시해요.

Claude Desktop → Settings → Developer → Edit Config를 열고 claude_desktop_config.json에 이 내용을 붙여 넣으세요

{
  "mcpServers": {
    "postgres-hardened": {
      "command": "npx",
      "args": [
        "-y",
        "postgres-mcp-hardened"
      ],
      "env": {
        "DATABASE_URL": "your-value",
        "MCP_STATEMENT_TIMEOUT": "your-value",
        "MCP_ALLOW_TABLES": "your-value",
        "MCP_AUDIT_LOG": "your-value"
      }
    }
  }
}

터미널에서 이 명령어를 실행하세요

claude mcp add postgres-hardened --env DATABASE_URL=your-value --env MCP_STATEMENT_TIMEOUT=your-value --env MCP_ALLOW_TABLES=your-value --env MCP_AUDIT_LOG=your-value -- npx -y postgres-mcp-hardened

실행하기 전에 빈 값을 채워 주세요.

Cursor에서 열기

또는 설정을 직접 복사하기

프로젝트의 .cursor/mcp.json 또는 ~/.cursor/mcp.json에 붙여 넣으세요

{
  "mcpServers": {
    "postgres-hardened": {
      "command": "npx",
      "args": [
        "-y",
        "postgres-mcp-hardened"
      ],
      "env": {
        "DATABASE_URL": "your-value",
        "MCP_STATEMENT_TIMEOUT": "your-value",
        "MCP_ALLOW_TABLES": "your-value",
        "MCP_AUDIT_LOG": "your-value"
      }
    }
  }
}

브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.

VS Code에서 열기

또는 설정을 직접 복사하기

프로젝트의 .vscode/mcp.json에 붙여 넣으세요

{
  "servers": {
    "postgres-hardened": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "postgres-mcp-hardened"
      ],
      "env": {
        "DATABASE_URL": "your-value",
        "MCP_STATEMENT_TIMEOUT": "your-value",
        "MCP_ALLOW_TABLES": "your-value",
        "MCP_AUDIT_LOG": "your-value"
      }
    }
  }
}

브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.

이 서버는 내 컴퓨터에서 실행되는데, ChatGPT는 인터넷에 있는 서버에만 연결할 수 있어요. 다른 앱을 고르세요.

선택한 앱은 이 기기의 쿠키에만 저장돼요. 계정은 필요 없어요.

직접 입력할 값

  • DATABASE_URL 비밀 필수 env
    Connection string for the role the server connects as. Use a role that cannot write — the server refuses writes twice, but a read-only role is the layer that does not depend on us being correct. `--p…
  • MCP_STATEMENT_TIMEOUT env
    Server-side statement timeout, e.g. `5s`. A question that would pin the database is cancelled by PostgreSQL, not by hope.
  • MCP_ALLOW_TABLES env
    Comma-separated allowlist. A table off the list is refused by name, and hiding it inside a CTE, a view or a join does not help.
  • MCP_AUDIT_LOG env
    Path to the tamper-evident audit log. Entries are chained by hash and survive a restart; `--verify-audit` checks the chain against an off-host anchor.

이 설정은 제작자의 레지스트리 정보로 만들었어요. README와 다르면 README를 따르세요.

할 수 있는 일

내 컴퓨터에서 실행돼요. 설치하면 AI 앱에 도구 목록이 나타나요.

기본 점검i

누구나 볼 수 있는 정보를 점검했고, 코드는 읽지 않았어요. 해당하지 않는 항목은 개수에서 뺐어요. · 2026년 11월 7일 점검

  • ✓ 통과

    제작자와 저장소 일치

    레지스트리 이름이 GitHub 계정 Eszetael 기준으로 확인되었고, 이 계정이 저장소를 소유하고 있어요

  • … 아직 점검 안 함

    계속 관리되고 있음

    아직 GitHub에서 이 저장소를 읽어 오지 않았어요

  • … 아직 점검 안 함

    라이선스 있음

    아직 GitHub에서 이 저장소를 읽어 오지 않았어요

  • – 해당 없음

    엔드포인트 응답

    내 컴퓨터에서 실행되는 서버라 인터넷 엔드포인트가 없어요

  • – 해당 없음

    OAuth로 로그인

    내 컴퓨터에서 실행되며, 대신 로컬 설정을 사용해요

  • … 아직 점검 안 함

    도구 설명에 숨겨진 지시 없음

    내 컴퓨터에서 실행돼요. 도구 목록은 인터넷 엔드포인트가 있는 서버에서만 읽을 수 있어요

데이터베이스 및 데이터셋 카테고리의 다른 서버와 비교i

  • 이 카테고리의 다른 서버 954개 중 0%보다 스타가 많아요
  • 이 카테고리의 다른 서버 954개 중 31%보다 최근에 레지스트리에 공개됐어요
  • 기본 점검 결과가 이 카테고리의 다른 서버 954개 중 100%와 같거나 더 좋아요

레지스트리에서 이 카테고리의 활성 서버 전체와 비교했어요. 스타는 게시자가 저장소를 소유한 경우에만 세요.

자주 묻는 질문

PostgreSQL (hardened, read-only), 안전한가요?

해당하는 기본 점검 1개 중 1개를 통과했어요. 코드는 읽지 않았어요. 키나 토큰을 넣기 전에 서버가 어떤 권한을 요구하는지 확인하고, 꼭 필요한 권한만 있는 키를 쓰세요.

어떤 키나 코드가 필요한가요?

입력해야 할 값: DATABASE_URL

내 컴퓨터에서 실행되나요, 클라우드에서 실행되나요?

내 컴퓨터에서 실행돼요. AI 앱이 필요할 때 실행하고, 데이터는 제작자의 서버를 거치지 않아요(서버 자체가 온라인 서비스를 호출하는 경우는 제외).

아직 관리되고 있나요?

GitHub 저장소는 마지막으로 – 변경됐고, 최신 버전(0.1.10)은 2개월 전 레지스트리에 올라왔어요.

어떤 앱에서 쓸 수 있나요?

Claude Desktop, Claude Code, Cursor, VS Code처럼 MCP를 지원하는 앱에서 쓸 수 있어요. 내 컴퓨터에 Node.js, Docker도 있어야 해요.

대신 쓸 수 있는 건 뭐가 있나요?

같은 카테고리에는: Supabase, MongoDB MCP Server, Elasticsearch MCP Server

대안

같은 카테고리에서 다른 제작자가 만든 서버예요. 스타 순으로 정렬했어요.

카드 보는 법:★ GitHub 스타i세 기둥: 리뷰 · 점검 · 사용 정도i업데이트 = 최신 버전을 레지스트리에 공개한 날i

Supabase

제작자: supabase

MCP server for interacting with the Supabase platform

컴퓨터 또는 클라우드★ 2,993Apache-2.0어제 업데이트
설치

MongoDB MCP Server

제작자: mongodb-js

MongoDB Model Context Protocol Server

내 컴퓨터에서 실행★ 1,157Apache-2.0그저께 업데이트
설치

Elasticsearch MCP Server

제작자: cr7258

MCP server for interacting with Elasticsearch

내 컴퓨터에서 실행★ 315Apache-2.014개월 전 업데이트
설치

제작자의 README

README 열기

제작자의 저장소에서 쓰인 그대로 가져왔어요. PopNx MCP가 검토하거나 보증한 내용이 아니에요. HTML, 이미지, 스크립트는 제거했어요. 링크를 누르면 이 사이트를 벗어나요.

postgres-mcp-hardened

### 🚧 Version 0.1.10 — the rest of an outside review, and a fix that was too blunt

Published: binaries for five platforms with checksums, Sigstore signatures and build provenance;

.mcpb bundles for one-click install; an image on ghcr.io for amd64 and arm64; a package on npm;

and an entry in the official MCP registry.

**0.1.8 and 0.1.9 closed six bypasses that four independent reviewers found in 0.1.7, none of them

found by us.** Two days of our own adversarial work had come back mostly clean the day before.

Passing the tests you thought to write is not the same as looking. The one that mattered most needs

no privileges at all: with a column redacted, a join on it through USING answered whether a given

value was present, which is a complete equality oracle against the least-privilege reader this

project tells you to configure.

0.1.10 closes the three findings that were left open. With MCP_ALLOW_SCHEMAS=public,

SELECT * FROM secret.salaries was refused while describe_table handed over every column, type

and default of that same table. An ordinary connection string carrying no sslmode used the

driver's prefer, which sends everything in the clear whenever the server declines TLS, and anyone

on the wire can make it decline. And MCP_SSLROOTCERT added a private certificate authority to 242

public ones instead of replacing them, so an operator who believed they had pinned trust to their

own issuer had not.

The first version of that TLS fix was wrong in a way worth reading about. It asked "is this

loopback" and demanded TLS from everything else, which took down six PostgreSQL version jobs, the

conformance run, the container check and the adversarial corpus in a single push. All of them reach

the database the way ordinary deployments do: postgres://user:pass@postgres:5432/db, a service

name on a private network. Docker Compose and Kubernetes are not the public internet, and a server

that demands TLS from a container on a bridge network is a server people switch off entirely. The

question is now whether somebody untrusted can sit on the wire, not whether the address is loopback,

and a real socket to a PostgreSQL reachable only by service name is in the test suite, because a

rule about networks should be tested over a network.

A resource limit is documented and not solved, in THREAT_MODEL.md: 49

bytes of SQL make PostgreSQL fold a constant into 5.9 GB of backend memory during planning, and a

five second statement_timeout does not stop it. The obvious shapes are refused; the general

problem is upstream of anything this server can do.

Every change here was reproduced against a running server before being fixed, and each is in

CHANGELOG.md with the query.

Everything here is 0.1.x because nobody outside this project has run it against their own data.

The official Postgres MCP server was deprecated in 2024 and still gets 467k downloads a month. Its entire defence is one database-level read-only transaction — and that alone does not stop every write. This is a maintained Rust replacement with defence in depth.

A drop-in Model Context Protocol server that lets an AI agent query PostgreSQL — read-only, enforced at the database level, with real SQL validation, timeouts, cost limits, OAuth 2.1, and an audit trail. Speaks Streamable HTTP and stdio, and negotiates the MCP revision: 2026-07-28 (current, and the default since upstream released it on 2026-08-03), 2025-11-25, and 2025-06-18 — what most shipping clients still speak today. A client asks for what it knows; it is not negotiated down.

Try to break it — one command, no database

The read-only guard has an offline mode. Hand it a statement and it says what it decided: no database, no configuration, nothing installed permanently.

npx postgres-mcp-hardened --validate "/* comment */ DROP TABLE users"

REJECT: non-read-only statement: Drop

npx postgres-mcp-hardened --validate "SELECT 1; DROP TABLE users"

REJECT: multiple statements are forbidden

npx postgres-mcp-hardened --validate "WITH d AS (DELETE FROM t RETURNING *) SELECT * FROM d"

REJECT: non-read-only statement: non-read-only query (CTE / SELECT INTO / FOR UPDATE)

npx postgres-mcp-hardened --validate "SELECT * FROM orders WHERE id = 1"

ALLOW

If something that writes comes back `ALLOW`, that is the most valuable thing anyone can send us. It needs no working exploit and no write-up — one line of SQL and "this should not be allowed" is a complete report. Anything that gets past the guard goes through SECURITY.md; everything else is an ordinary issue, and the bar for opening one is *this looks wrong to me*, not *I am certain*.

The fuzzer is deterministic and prints its seed, so whatever it finds reproduces on a machine that has never seen yours — a million mutations take about a minute:

npx postgres-mcp-hardened --fuzz 1000000

fuzz: 1000000 iterations, seed 1592594996, slowest validation 8 ms

RESULT: 0 invariant violations

For the whole thing against a real database, docker compose -f examples/docker-compose.yml up -d brings up PostgreSQL with sample data and the server in front of it, connecting as a role that holds SELECT and nothing else.

Every bypass found so far lives in the MUST_REJECT corpus in src/validate.rs and runs on every commit, recorded with what it cost rather than tidied away. Yours would join them.

Why

@modelcontextprotocol/server-postgres is deprecated on npm (last publish December 2024) and still sees 475,790 downloads in the 30 days to 9 August 2026. Credit where it is due: its approach is not naive — it wraps each query in BEGIN TRANSACTION READ ONLY and always ROLLBACKs, which is a real defence and one this server now adopts as well.

The problem is that it is the *only* defence, and it is not complete:

  • A read-only transaction does not block every write, and a rollback does not undo everything it lets through. Two separate facts, and the second is the one that matters.

gin_clean_pending_list() runs inside SET TRANSACTION READ ONLY and its work survives the rollback: an index with 25 pending pages has 0 after the transaction is rolled back. pg_backup_start() puts the session into backup state, survives DISCARD ALL, and with the default fast => false waits for a spread checkpoint while forcing full_page_writes on, which is a real cost on a busy server. pg_import_system_collations() also executes without raising SQLSTATE 25006, but be careful how much weight you put on it: that one IS undone by a rollback, so against a server that always rolls back it is a curiosity rather than a bypass.

Reproduce it, but read the two preconditions first, because without them you will see a zero or an error and conclude we made this up. All three need superuser or ownership of the object. And the import only restores collations that are *missing*, so something has to be removed first:

  -- as superuser, and note these are three separate transactions: a statement that errors

-- inside a block aborts the whole block, so they cannot be run as one. DELETE FROM pg_collation WHERE oid IN (SELECT oid FROM pg_collation ORDER BY oid DESC LIMIT 200);

BEGIN READ ONLY; DELETE FROM pg_collation WHERE collname LIKE 'zu%'; -- ERROR: cannot execute DELETE ... ROLLBACK;

BEGIN READ ONLY; SELECT pg_import_system_collations('pg_catalog'); -- 200, no error COMMIT; -- and now the rows are there

Both are writes, both are inside a read-only transaction, and one is refused while the other is not. That asymmetry is why this server does not treat the transaction as its only defence. It is also why the *role* matters more than any of this: every example above needs privileges a least-privilege reader does not have, and this server refuses to start as a network listener when the role it was given can write. What it cannot control is which connection string somebody pastes into a client config, and the usual answer is whichever one they already had.

  • No statement timeout, no cost guard, no row limit — one query can run until the server gives up.
  • No authentication, no audit trail, no handling of prompt injection through returned row data.
  • One source file of 143 lines, unmaintained since December 2024, no test suite.

This server keeps the rollback, adds AST validation in front of it, and adds the operational layers the original never had.

postgres-mcp-hardened vs the archived original

archived server-postgrespostgres-mcp-hardened
Read-only enforcementBEGIN TRANSACTION READ ONLY + ROLLBACK — one layer, and PostgreSQL lets some writes through itAST validation (sqlparser) *plus* the same read-only transaction and rollback, *plus* a denylist for functions that write despite it
Multi-statement / DROP via CTEreaches the database and is stopped only by the transactionrejected by the parser, before it reaches the database
Statement timeoutnonestatement_timeout + idle_in_transaction_session_timeout enforced
Runaway / expensive queriesrun unbounded`EXPLAIN` cost guard rejects them before execution
Prompt injection via row dataraw outputwrapped trusted="false" + delimiter escaping
Error messagesleak schema (relation X does not exist)structured, non-leaking, actionable
AuthnoneOAuth 2.1 (RS256 JWT, scope + audience + issuer)
Auditnonetamper-evident hash-chained log
Schema as MCP resources✅✅ — plus comments, primary and foreign keys
Tests / CInoneunit + end-to-end suites against live PostgreSQL, a deterministic fuzz harness, conformance driven by the official MCP SDK, clippy + cargo audit + container build on every push
Transportstdio / deprecated SSEStreamable HTTP + stdio
Maintained❌ deprecated since 2024✅

Install

Five ways in, in the order most people want them.

One click, for a client that accepts .mcpb bundles: download postgres-mcp-hardened- .mcpb from the latest release and open it. The bundle asks for the connection string and stores it in the OS keychain rather than in a plain-text config file. Nothing to install, nothing to edit.

Through npm — shortest, and the one your MCP client config can point at directly. There is no Node runtime involved at run time: the package is a launcher that fetches the native binary for your platform and verifies its checksum before running it.

{

"mcpServers": { "postgres": { "command": "npx", "args": ["-y", "postgres-mcp-hardened", "--stdio"], "env": { "DATABASE_URL": "postgres://readonly_user:PASSWORD@localhost:5432/mydb" } } } }

The connection string goes in env, not in args, on purpose: arguments show up in ps output and in shell history on a shared machine, and a database password does not belong there.

A binary from the releases page — one file, nothing to keep up to date, and the option to take if your machine has no Node at all. (Not a *static* binary, as this page claimed until 0.1.7: the -gnu and macOS targets link the system C library like any other native program. There is simply nothing to install alongside it.) Every release carries builds for Linux, macOS and Windows on x86-64 and arm64, each with a checksum and a signature; verifying them is the next section.

As a container, if that is how you run things. The image is distroless and runs as a non-root user, and the same signatures cover it as cover the binaries.

docker run --rm -p 

앞부분만 보여 드려요. 나머지는 저장소에서 읽어 보세요

PopNx에게 묻기