ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

pgops

โดย arzharchรุ่น 0.1.9i★ –iรันบนเครื่อง
ชื่อใน registryio.github.arzharch/pgops-mcp

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

Safe, audited PostgreSQL operations for AI agents: queries, migrations, EXPLAIN, containers

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: ฐานข้อมูลและชุดข้อมูล
  • ต้องใส่ค่าเหล่านี้: PGOPS_DSN, PGOPS_READONLY_DSN

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

  • ผลตรวจเบื้องต้น: ผ่าน 1 จาก 1 ข้อ
  • รันในเครื่องคุณด้วยสิทธิ์ของผู้ใช้คุณ (ไฟล์ อินเทอร์เน็ต แอปต่าง ๆ)
  • ค่าที่คุณต้องใส่เอง: PGOPS_DSN, PGOPS_READONLY_DSN, PGOPS_READ_ONLY, PGOPS_APPROVAL_MODE, PGOPS_AUDIT_LOG, PGOPS_DEFAULT_TIMEOUT_MS, PGOPS_MAX_TIMEOUT_MS, PGOPS_DEFAULT_ROW_LIMIT

ค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต

ต้องเตรียมก่อน

  • PyPIติดตั้ง uv ของ Python (มีคำสั่ง uvx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "pgops": {
      "command": "uvx",
      "args": [
        "pgops-mcp"
      ],
      "env": {
        "PGOPS_DSN": "ใส่ค่าของคุณ",
        "PGOPS_READONLY_DSN": "ใส่ค่าของคุณ",
        "PGOPS_READ_ONLY": "ใส่ค่าของคุณ",
        "PGOPS_APPROVAL_MODE": "ใส่ค่าของคุณ",
        "PGOPS_AUDIT_LOG": "ใส่ค่าของคุณ",
        "PGOPS_DEFAULT_TIMEOUT_MS": "ใส่ค่าของคุณ",
        "PGOPS_MAX_TIMEOUT_MS": "ใส่ค่าของคุณ",
        "PGOPS_DEFAULT_ROW_LIMIT": "ใส่ค่าของคุณ"
      }
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add pgops --env PGOPS_DSN='ใส่ค่าของคุณ' --env PGOPS_READONLY_DSN='ใส่ค่าของคุณ' --env PGOPS_READ_ONLY='ใส่ค่าของคุณ' --env PGOPS_APPROVAL_MODE='ใส่ค่าของคุณ' --env PGOPS_AUDIT_LOG='ใส่ค่าของคุณ' --env PGOPS_DEFAULT_TIMEOUT_MS='ใส่ค่าของคุณ' --env PGOPS_MAX_TIMEOUT_MS='ใส่ค่าของคุณ' --env PGOPS_DEFAULT_ROW_LIMIT='ใส่ค่าของคุณ' -- uvx pgops-mcp

เติมค่าที่เว้นว่างไว้ก่อนรัน

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "pgops": {
      "command": "uvx",
      "args": [
        "pgops-mcp"
      ],
      "env": {
        "PGOPS_DSN": "ใส่ค่าของคุณ",
        "PGOPS_READONLY_DSN": "ใส่ค่าของคุณ",
        "PGOPS_READ_ONLY": "ใส่ค่าของคุณ",
        "PGOPS_APPROVAL_MODE": "ใส่ค่าของคุณ",
        "PGOPS_AUDIT_LOG": "ใส่ค่าของคุณ",
        "PGOPS_DEFAULT_TIMEOUT_MS": "ใส่ค่าของคุณ",
        "PGOPS_MAX_TIMEOUT_MS": "ใส่ค่าของคุณ",
        "PGOPS_DEFAULT_ROW_LIMIT": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "pgops": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "pgops-mcp"
      ],
      "env": {
        "PGOPS_DSN": "ใส่ค่าของคุณ",
        "PGOPS_READONLY_DSN": "ใส่ค่าของคุณ",
        "PGOPS_READ_ONLY": "ใส่ค่าของคุณ",
        "PGOPS_APPROVAL_MODE": "ใส่ค่าของคุณ",
        "PGOPS_AUDIT_LOG": "ใส่ค่าของคุณ",
        "PGOPS_DEFAULT_TIMEOUT_MS": "ใส่ค่าของคุณ",
        "PGOPS_MAX_TIMEOUT_MS": "ใส่ค่าของคุณ",
        "PGOPS_DEFAULT_ROW_LIMIT": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าที่ต้องใส่เอง

  • PGOPS_DSN ความลับ จำเป็น env
    PostgreSQL connection string for the database to operate on.
  • PGOPS_READONLY_DSN ความลับ env
    Optional separate DSN for the read-only pool. Use a role with no write grants to enforce read-only at the database rather than only in the server.
  • PGOPS_READ_ONLY env
    Set to 1 to withhold every mutating tool. Write tools are not registered at all, so an agent cannot call them.
  • PGOPS_APPROVAL_MODE env
    Set to 1 to register container.restart and container.exec. Off by default: Docker socket access is root-equivalent on the host.
  • PGOPS_AUDIT_LOG env
    Path to the append-only JSONL audit log.
  • PGOPS_DEFAULT_TIMEOUT_MS env
    Statement timeout applied to every query unless a tool call overrides it.
  • PGOPS_MAX_TIMEOUT_MS env
    Ceiling a caller-supplied timeout is clamped to.
  • PGOPS_DEFAULT_ROW_LIMIT env
    Rows returned by query.read when the caller does not specify a limit.

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub arzharch ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด ฐานข้อมูลและชุดข้อมูลi

  • ดาวมากกว่า 0% ของอีก 953 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 27% ของอีก 953 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 953 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

pgops ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

ต้องใส่ค่าเหล่านี้: PGOPS_DSN, PGOPS_READONLY_DSN

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.1.9) เข้า registry 2 เดือนที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv), Docker ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี Supabase, MongoDB MCP Server, Elasticsearch MCP Server

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

Supabase

โดย supabase

server ทางการของ Supabase ให้ AI สร้างตาราง ถามข้อมูล และดูการตั้งค่าโปรเจกต์ในฐานข้อมูล Supabase ของคุณ

บนเครื่องหรือคลาวด์★ 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.0อัปเดต 14 เดือนที่ผ่านมา
ติดตั้ง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

pgops-mcp

**Let an AI assistant operate your PostgreSQL database — without letting it wreck

anything.**

Point Claude, Cursor, or VS Code at a database and ask questions in plain English. Your assistant gets 18 tools for inspecting schemas, running queries, diagnosing slow ones, and planning migrations. What it does *not* get is a way to quietly destroy your data.

What it actually looks like

Every number below is real output from the demo database in this repo — 1.2M rows, 114 MB.

You: I want to index orders.status

Assistant: *(calls migration.plan)*

CREATE INDEX "idx_orders_status" ON "orders" (status)

risk=medium estimate=4000ms confidence=medium blocks: writes yes, reads no SAFER: CREATE INDEX CONCURRENTLY "idx_orders_status" ON "orders" (status)

Assistant: A plain index build blocks writes for roughly 4 seconds. CONCURRENTLY

is slower overall but keeps writes working. Which do you want?

The tool didn't return a raw plan for the model to interpret — it returned a verdict, a duration estimate with an honest confidence level, and the safer alternative.

query.explain works the same way. Instead of handing back JSON, it says things like:

planner overestimated rows by 5833x (estimated 239,160, actual 40)

-> run ANALYZE; if it persists the columns may be correlated, consider CREATE STATISTICS

And when something is genuinely dangerous

You: clear out the orders table

Assistant: *(calls query.write with DELETE FROM orders)*

CONFIRMATION_REQUIRED

DELETE has no WHERE clause and would affect every row in the table

Where your client supports it, the approval prompt goes to you — not to the assistant. Nothing runs until a human answers, and the refusal is written to the audit log whether or not you approve.

That last part is the point. The assistant cannot approve its own dangerous action, because it is not the one being asked. Where a client can't show a prompt, it degrades to a single-use token bound to that exact statement — never to "allowed".

Why this exists

Most Postgres MCP servers are thin query wrappers: introspect and SELECT. None handle migrations with lock-impact analysis, none diagnose performance from EXPLAIN and pg_stat_statements, and none understand the container the database runs in. Agents operating databases today are doing it blind, and without guardrails.

pgops-mcp is the operations brain: schema intelligence → guarded queries → migration engine → performance diagnosis → environment awareness, with a safety architecture that makes every action classifiable, confirmable, and auditable.

Native AI/ML Extension Support: Because pgops builds on core Postgres catalogs rather than brittle regex parsing, it inherits native support for custom types and extensions like pgvector. Tools like migration.plan and query.explain understand vector types (vector(384)) and hnsw indexes out of the box, with zero configuration.

New here? docs/GETTING_STARTED.md is a 15-minute guided tour that assumes no MCP knowledge.

Tool surface

GroupTools
Schemaschema.inspect
Queriesquery.read, query.write (guarded), query.explain (parsed plan + verdict)
Performanceindex.advise, db.health
Migrationsmigration.plan (dry-run + lock analysis), migration.describe (plain English), migration.apply, migration.rollback, migration.history
Environmentenv.topology, env.correlate, container.logs, container.stats
Gatedcontainer.restart*, container.exec*

\* Not registered at all unless the server runs with --approval-mode, and even then each call needs a confirmation token. container.exec additionally enforces a read-only diagnostic command allowlist — it does not offer a shell. The Docker socket is root-equivalent on the host, so the default is read-only access.

Safety model (the core differentiator)

  • Separate read-only / read-write connection roles; tools bind to the right role
  • Statement classification before execution — unbounded DELETE/UPDATE blocked
  • Destructive actions require explicit confirmation tokens
  • Every executed statement lands in an append-only audit log with timing and verdict
  • Runaway-query cancellation with timeout tiers

MCP surface

PrimitiveWhat's here
Tools17 — schema, query, explain, advise, migrate, environment
Resourcespgops://schema, schema/summary, schema/{table}, health, migrations, audit/recent, config
Promptsdiagnose-slow-query, plan-safe-migration, incident-triage, review-index-health, explain-safety-model
ElicitationDangerous actions ask the user directly, not via the agent; confirmation tokens are the fallback
Samplingmigration.describe turns English into a plan using *your* model — this server ships no API key
CompletionsTable-name autocomplete for pgops://schema/{table}
Progress / loggingBest-effort notifications during long operations

Remote access & agent tokens

stdio needs no auth — the server is a subprocess your client spawns, with no open port. HTTP does, so it refuses to start without a key:

pgops-mcp keygen                                    # RS256 keypair

pgops-mcp issue-token --subject my-agent # read-only by default pgops-mcp issue-token --subject deploy-bot --scope pgops:read --scope pgops:write pgops-mcp scopes # which scope each tool needs

pgops-mcp --transport http --public-key ~/.pgops/keys/pgops_public.pem

The server holds only the public key, so it can verify tokens but never mint them. Scopes (pgops:read / pgops:write / pgops:admin) map to the same danger tiers as the guardrails, and a tool with no scope entry requires admin — deny by default. Binds loopback unless you say otherwise.

Install

pgops-mcp is an MCP server, not a Python library — nothing in it is meant to be imported, and pgops.* carries no API-stability promise. You install it the way you install any MCP server: point your client at it.

Claude Desktop / Cursor / VS Code:

{

"mcpServers": { "pgops": { "command": "uvx", "args": ["pgops-mcp"], "env": { "PGOPS_DSN": "postgresql://user:pass@localhost:5432/mydb" } } } }

uvx fetches and runs it in a throwaway environment — nothing to install first, and nothing added to your own project's dependencies.

Or run the container, if you would rather not put a Python toolchain on the machine that talks to your database:

{

"mcpServers": { "pgops": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "PGOPS_DSN", "-v", "pgops-audit:/var/lib/pgops", "ghcr.io/arzharch/pgops-mcp:latest" ], "env": { "PGOPS_DSN": "postgresql://user:pass@host.docker.internal:5432/mydb" } } } }

Two things the container changes: mount a volume at /var/lib/pgops or the audit log dies with the container, and localhost inside a container is the container itself — use host.docker.internal or a compose service name.

Check the connection before wiring a client to it:

uvx pgops-mcp --selfcheck --dsn "postgresql://user:pass@localhost:5432/mydb"

Both paths install the same server and are listed together in the MCP Registry entry — they fail for different people. uvx needs nothing preinstalled but assumes the host may run Python; the container assumes only Docker.

See [SETUP.md](https://github.com/arzharch/pgops-mcp/blob/main/SETUP.md) for configuration, HTTP transport, agent tokens and troubleshooting, and CONTRIBUTING.md to run it from a source checkout.

Docs

Links are absolute so they resolve from the PyPI project page as well as from GitHub.

Using it

DocWhat's in it
Getting startedFirst 15 minutes, no MCP knowledge assumed
Tool referenceAll 18 tools: parameters, returns, error codes, scopes
Setup & configurationClients, HTTP auth, observability, troubleshooting
Environment variablesEvery knob, documented
Security modelWhat it can do, what it refuses, known limits
ChangelogWhat changed per release

How it works

DocWhat's in it
ArchitectureSystem design and trade-offs
System designThe safety pipeline, with diagrams
Decision recordsWhy each choice was made, and what it cost
BenchmarksWhat is measured, and against what

Contributing

DocWhat's in it
ContributingSource checkout, gates, release process
Module layoutWhat each module is for

How it's verified

471 tests, and the ones that matter run against a real PostgreSQL 16 in a container — not mocks. That is a deliberate decision (ADR-005): a guardrail proven only against a fake has been proven against the wrong thing. The interesting failures — default_transaction_read_only, lock escalation, transactional DDL, relfilenode changes on rewrite — are behaviours of the real database.

SuiteWhat it proves
Guardrails & classifierEvery refusal rule, against live Postgres
Property-based (Hypothesis)The invariant itself, over inputs nobody thought to write
Red-team15 named attacks a hostile agent would try — each refused and audited
Live serverReal HTTP server, real JWTs, end to end
BenchmarksLatency budgets as regression tripwires, published as CI artifacts

The red-team suite has found real bugs, which is the argument for having it: it caught a confirmation token issued for a refused statement being redeemable against a different one, and a pgops:read token that could call query.write because the scope table was documentation rather than enforcement.

Known limits

Stated here rather than left to be discovered:

  • No per-session database isolation. Auth identifies the caller and scopes limit what they may do, but every caller shares one connection manager and one audit log. Built for one engineer and a few databases, not multi-tenant SaaS.
  • `index.advise` names the table taking sequential scans, not the column to index — that needs per-statement plan inspection. It says so instead of inventing a CREATE INDEX.
  • `DROP INDEX` / `DROP CONSTRAINT` cannot be rolled back, because the object's definition is not captured before the drop. The rollback refuses and explains why rather than reconstructing a guess.

Sample of what migration.plan returns for a type change on the 1.2M-row orders:

ALTER TABLE "orders" ALTER COLUMN "total_cents" TYPE bigint

op=table_rewrite risk=high estimate=4800ms confidence=medium why: rewrites every row and rebuilds every

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx