Mirobody
Lab results to LOINC codes and UCUM units, symptoms and diagnoses to ICPC-3. Offline, no API key.
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
Read-only Postgres ops/DBA diagnostics: slow queries, EXPLAIN, locks, index and table health.
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
PGMCP_DATABASE_URLค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
ลิงก์ไปที่ไฟล์ของผู้ทำเอง เราไม่ได้เก็บหรือแพ็กใหม่ เปิดไฟล์แล้ว Claude Desktop จะติดตั้งให้
พิมพ์คำสั่งนี้ใน Terminal
claude mcp add pgmcp --env PGMCP_DATABASE_URL='ใส่ค่าของคุณ' -- docker run -i --rm -e PGMCP_DATABASE_URL ghcr.io/pascalallen/pgmcp:1.1.0เติมค่าที่เว้นว่างไว้ก่อนรัน
วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"pgmcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PGMCP_DATABASE_URL",
"ghcr.io/pascalallen/pgmcp:1.1.0"
],
"env": {
"PGMCP_DATABASE_URL": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"pgmcp": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PGMCP_DATABASE_URL",
"ghcr.io/pascalallen/pgmcp:1.1.0"
],
"env": {
"PGMCP_DATABASE_URL": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub pascalallen ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
ต้องใส่ค่าเหล่านี้: PGMCP_DATABASE_URL
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (1.1.0) เข้า registry 3 เดือนที่ผ่านมา
โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Docker, MCPB ในเครื่องด้วย
ในหมวดเดียวกันมี Mirobody, FHIR MCP Server, Google Health MCP
server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว
อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi
Lab results to LOINC codes and UCUM units, symptoms and diagnoses to ICPC-3. Offline, no API key.
MCP server providing seamless access to FHIR APIs for AI tools and healthcare applications
Privacy-first unofficial Google Health API v4 MCP server for health, sleep, activity, HR agents
ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
pgmcp is a read-only PostgreSQL ops/DBA server for the Model Context Protocol, built on the official modelcontextprotocol/go-sdk. It answers the questions a DBA asks during an incident — which statements are slow, why this plan is slow, which indexes are dead weight, which tables autovacuum has fallen behind on, who is blocking whom, how far the standby is lagging — and it is read-only by construction rather than by convention: a dedicated database role that holds no write privilege, a BEGIN READ ONLY transaction with a statement timeout around every single statement, and a SQL parser guard that rejects anything that is not one SELECT/EXPLAIN/SHOW and every function that could mutate state from inside a read-only transaction. Tested against PostgreSQL 16; requires 13 or later.
Claude Desktop, one click: download pgmcp_ .mcpb from Releases and open it. Claude Desktop asks for a Postgres connection string, keeps it in the OS keychain, and launches the bundled binary itself — nothing on PATH, no config file to edit. One bundle covers macOS (universal) and Windows (x64).
Otherwise download a binary for your platform from Releases — darwin, linux and windows, amd64 and arm64, with checksums.
Or build from source with the Go CLI tool go:
go install github.com/pascalallen/pgmcp/cmd/pgmcp@latest
Or run the released image, which is distroless, non-root and multi-arch:
docker run --rm -i -e PGMCP_DATABASE_URL='postgres://…' ghcr.io/pascalallen/pgmcp
pgmcp is listed in the MCP Registry as io.github.pascalallen/pgmcp.
Before you point it at anything, create the read-only role — see Database role. It is the layer that still holds if the other two have a bug.
One MCP surface, two transports. Which one you run is configuration, not a different build.
Claude Code, stdio — the client launches the binary and talks over stdin/stdout:
claude mcp add pgmcp --transport stdio \
--env PGMCP_DATABASE_URL='postgres://pgmcp:…@db.internal:5432/app?sslmode=require' \ -- pgmcp
Claude Desktop, stdio — install the .mcpb bundle from Releases (see Installation), or write the same thing into claude_desktop_config.json by hand:
{
"mcpServers": { "pgmcp": { "command": "pgmcp", "env": { "PGMCP_DATABASE_URL": "postgres://pgmcp:…@db.internal:5432/app?sslmode=require" } } } }
HTTP — Streamable HTTP behind a static bearer key, for a shared deployment. pgmcp speaks plain HTTP and never terminates TLS itself; run it on loopback behind a reverse proxy.
PGMCP_DATABASE_URL='postgres://pgmcp:…@db.internal:5432/app?sslmode=require' \
PGMCP_AUTH_MODE=static \ PGMCP_API_KEYS="$(openssl rand -hex 32)" \ pgmcp --transport http --listen 127.0.0.1:8080
claude mcp add pgmcp --transport http https://pgmcp.example.com/mcp \
--header "Authorization: Bearer "
TLS termination, the proxy settings the streaming transport needs, JWT auth against an identity provider, and wiring pgmcp up as a claude.ai custom connector are all in docs/DEPLOYING.md.
| Tool | The question it answers |
|---|---|
top_queries | Which statements are slow or expensive server-wide? Ranks pg_stat_statements by total time, mean time, calls, rows or blocks read. |
explain | Why is *this* statement slow? Plan tree, the nodes burning the most self time, plan warnings, and a stable plan_hash to diff against a later run. |
index_health | Which indexes can I drop, and which are missing their job? Never-scanned, duplicate, invalid and bloated indexes. |
table_health | Where is autovacuum falling behind? Dead-tuple ratio, last vacuum/analyze, sequential versus index scans and estimated bloat, per table. |
lock_waits | Why is this query hanging? The current lock wait graph — who is blocked, who blocks them, and any cycle that amounts to a deadlock. |
connections | What is the server doing right now, and how close is it to max_connections? Backends grouped by state, wait event, application, user or database, including idle-in-transaction sessions. |
replication | How far behind is the standby, and which slot is retaining WAL? Primary/standby role, per-standby lag in bytes and milliseconds, slots and the current WAL rate. |
config_check | Is this server tuned sanely? pg_settings against memory, autovacuum, WAL and connection heuristics, with an ok/review/warn verdict and a note per setting. |
query | Everything the other eight do not cover. One read-only SELECT/EXPLAIN/SHOW in a READ ONLY transaction, bounded by a row cap and a statement timeout, with $1..$n bind parameters. |
Every tool is annotated readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, and returns a typed output schema.
query is the only tool that carries free-form SQL, and it is optional. --disable-query drops it from the catalogue entirely — a deployment that only needs the eight diagnostics tools can run without any ad hoc SQL surface at all. --query-schemas=public,app restricts it to named schemas instead — and bounds explain with it, since analyze=true executes the statement; read what that does and does not stop in docs/SECURITY.md.
| Resource | Contents |
|---|---|
pgmcp://overview | The server snapshot to start from: version, uptime, recovery state, installed extensions, per-database sizes, cache hit ratio, and connections against max_connections. Cacheable for 30s. |
pgmcp://settings | The raw pg_settings rows. Cacheable for 5m. |
| Prompt | Arguments | Purpose |
|---|---|---|
diagnose_slow_query | sql (required) | A four-step investigation: explain the statement, check index_health/table_health on every schema in the plan's hot nodes, look for it in top_queries, then summarize root cause, evidence and a recommended index or rewrite — written out as text only, never run. |
Every setting has a --flag and a PGMCP_ environment variable. Flags win over the environment, which wins over the default. Configuration errors exit 2 with every offending key named in one message; runtime failures exit 1.
| Flag | Env | Default | Meaning |
|---|---|---|---|
--database-url | PGMCP_DATABASE_URL | — (required) | Postgres connection string |
--transport | PGMCP_TRANSPORT | stdio | stdio or http |
--listen | PGMCP_LISTEN | 127.0.0.1:8080 | HTTP listen address |
--resource-url | PGMCP_RESOURCE_URL | — | Public origin this server is reachable at, for OAuth resource metadata |
--auth-mode | PGMCP_AUTH_MODE | none | none, static or jwt (HTTP only) |
--api-keys | PGMCP_API_KEYS | — | Comma-separated static API keys, required for static |
--jwks-url | PGMCP_JWKS_URL | — | JWK set URL, required for jwt |
--jwt-issuer | PGMCP_JWT_ISSUER | — | Required iss claim, required for jwt |
--jwt-audience | PGMCP_JWT_AUDIENCE | — | Required aud claim, required for jwt |
--auth-servers | PGMCP_AUTH_SERVERS | — | Comma-separated OAuth authorization servers to advertise via RFC 9728 |
--disable-query | PGMCP_DISABLE_QUERY | false | Drop the ad hoc query tool entirely |
--query-schemas | PGMCP_QUERY_SCHEMAS | — | Comma-separated schemas the query and explain tools may read; unset disables the allowlist |
--max-conns | PGMCP_MAX_CONNS | 4 | Maximum Postgres connections |
--call-timeout | PGMCP_CALL_TIMEOUT | 60s | Per-tool-call timeout |
--rate-limit | PGMCP_RATE_LIMIT | 60 | Tool calls per principal per minute (HTTP only) |
--max-output-bytes | PGMCP_MAX_OUTPUT_BYTES | 1048576 | Cap on a tool call's structured content |
--log-level | PGMCP_LOG_LEVEL | info | debug, info, warn or error |
--log-format | PGMCP_LOG_FORMAT | text | text or json |
--insecure-no-auth | PGMCP_INSECURE_NO_AUTH | false | Allow auth-mode=none on a non-loopback listen address |
--version | — | — | Print the version and exit |
The auth block applies to the HTTP transport only. Over stdio the operating system decides who the caller is: the parent process that launched the binary, and nobody else.
pg_monitor plus SELECT, and deliberately *not* pg_signal_backend); BEGIN READ ONLY with SET LOCAL statement_timeout and lock_timeout = '2s' around every statement the adapter runs, always rolled back; and a parser-level guard, because a read-only transaction alone does not stop pg_terminate_backend, pg_read_file, pg_sleep or setval.SELECT, EXPLAIN or SHOW; no nested write statement anywhere in the tree; no FOR UPDATE/FOR SHARE locking clause; no SELECT INTO; and no call to a denied function — file access, backup and WAL control, replication slots, advisory locks, dblink, sequence mutation, stats resets.--query-schemas matches the schemas qualifying *table references* in the parsed statement, case-insensitively, and it bounds both tools that carry caller-supplied SQL — query and explain, so explain with analyze=true cannot execute against a schema you excluded. A view, a set-returning function, or a SECURITY DEFINER function inside an allowed schema can still read outside it. Database privileges are the boundary; the allowlist just narrows the obvious path.alg=none, no HMAC confusion) and a required iss, aud and exp, and the verifier holds no keys until the JWKS arrives, so it starts closed rather than open. RFC 9728 protected resource metadata advertises where to get a token. The server refuses to start on a non-loopback address with auth off.query tool, a cap on a result's structured content, and a 1 MiB request body limit.The threat model, the full enumeration of the layers, and the limitations each one does *not* cover are in docs/SECURITY.md.
Run the test suite with the race detector and coverage:
go test -race -cover ./...
Integration tests need a Postgr
ตัดมาแค่ช่วงต้น อ่านต่อใน repo