
Pgmoat
io.github.Kitalon-Labs-LLC由 GitHub 帳號 Kitalon-Labs-LLC 發布v0.1.2更新於 Nov 7, 2026
Governed, read-only Postgres access for AI agents: SQL safety, RLS, budgets, tamper-evident audit.
概覽
讓 AI 助理以受管控的唯讀方式存取 Postgres 資料庫的 MCP 伺服器,提供查詢檢查、隱藏欄位、預算限制與稽核日誌。
- 可以做什麼
- 對 Postgres 資料庫執行唯讀 SQL,並限制回傳列數與查詢逾時
- 隱藏標記為隱藏的資料表與欄位,並標示敏感資料
- 將資料列層級安全性綁定到呼叫者身分,並寫入防竄改稽核日誌
- 產生並驗證設定檔、檢查資料庫角色是否有不安全的權限、驗證稽核雜湊鏈,以及把可見的結構描述匯出為 Markdown
- 適用情境
- 當助理需要依據正式或共用的 Postgres 資料庫回答問題、且不應有任何寫入途徑,並希望有額度限制、隱藏欄位與稽核紀錄,而不是直接取得資料庫憑證時使用。
- 執行需求
- 需要 Node.js 22.12 或更新版本以及 Postgres 15 至 18,透過 stdio 在本機執行(npm 套件或 Docker 映像)。Postgres 連線 URL 透過 PGMOAT_DATABASE_URL 環境變數或命令列參數提供,建議使用專用的唯讀角色。選用的 pgmoat.yaml 可設定 schema、預算、描述與隱藏欄位。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Pgmoat,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
pgmoat
[CI] [npm version] [License: MIT]
Governed Postgres access for AI agents.
pgmoat is an open-source MCP server that gives AI agents read-only access to Postgres. It checks every query with the real Postgres parser, hides the tables and columns you mark hidden, applies row limits and timeouts, binds Row-Level Security to the caller's identity, and writes a tamper-evident audit log.
Requires Node.js 22.12 or newer and Postgres 15 to 18.
Quickstart
Run it against your database with safe defaults, no config file needed:
Add it to Claude Code:
Or to Claude Desktop (claude_desktop_config.json):
Passing the URL through --url-env keeps the password out of process listings.
Use a dedicated read-only role. pgmoat checks the role at startup. With a pgmoat.yaml, it refuses to start if the role is a superuser (PGM-701), has BYPASSRLS while row-level security is configured (PGM-702), or owns a protected table without FORCE ROW LEVEL SECURITY (PGM-703), unless you pass --allow-unsafe-role; every audit entry then records the override. In zero-config mode (a URL and no config file) it warns and continues.
Add descriptions and hide sensitive data
A pgmoat.yaml looks like this:
Commands
Run pgmoat --help for all options.
What pgmoat does not do
- It does not stop prompt injection. It removes the write path, hides what you mark hidden, and labels returned data as untrusted, but an agent with other tools (web access, email) can still be tricked into sending readable data elsewhere.
- It does not replace Postgres permissions. The strongest control is a dedicated role with only the grants it needs.
- It does not make RLS policies correct. It sets the session variables your policies read. A flawed policy stays flawed.
- It does not guarantee audit delivery to a remote destination during an outage. It buffers, alarms, and records drops.
Docker
Contributing
See CONTRIBUTING.md. Report vulnerabilities privately as described in SECURITY.md.
Links
- Docs: https://kitalonlabs.com/pgmoat/docs
- Source and issues: https://github.com/Kitalon-Labs-LLC/pgmoat
- Security reports: [email protected]
License
MIT (c) 2026 Kitalon Labs
來源:README.md,提交 5d4fabd
工具
0版本歷史
2- v0.1.2最新Nov 7, 2026
- v0.1.1Oct 25, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分