
Warehouse MCP
io.github.tantn89由 GitHub 账号 tantn89 发布v0.1.0更新于 Nov 1, 2026
面向代理的受管控只读仓库访问:SQL 防护、行策略、PII 化名、审计日志。
AI 翻译由 AI 模型根据下方的原文描述翻译,可能有误。
原文描述
Governed read-only warehouse access for agents: SQL guard, row policies, PII pseudonyms, audit log.
概览
Warehouse 的本地 MCP 服务;无需登录;STDIO。
暂无 AI 概览:以下信息来自注册中心条目和服务本身。
安装
在 SourceWeft 中
- 打开 控制台中的 Warehouse MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
warehouse-mcp
Give AI agents your warehouse without giving them your warehouse.
An MCP server that lets Claude, Cursor or any MCP client query DuckDB, Postgres or BigQuery through a governed, read-only layer:
- a semantic model, so agents ask in business terms;
- a SQL guard that an agent cannot talk into writing, reading files or leaving its lane;
- per-role row policies;
- pseudonymized personal data;
- an audit log;
- a cost cap.
Every claim below is backed by a test or a measured run.
[ci] [pypi] [mcp registry] [python] [mcp] [license]
Try it in one line
The bundled demo serves about 100k live Wikipedia edits, captured by realtime-lakehouse, from a local DuckDB file. No keys are needed.
Put that in Claude Desktop's config, or run claude mcp add warehouse -- uvx warehouse-mcp --demo.
Then ask "Which wikis had the most bot activity, and how many distinct editors did each have?"
What the agent sees, taken from real tool calls on the demo:
How it works
Pseudonymize at the source, not in the output. The guard rewrites every dataset reference into a subquery that replaces personal columns with a salted hash, inside the warehouse. As a result:
count(DISTINCT editor)stays exact;- joins on pseudonyms work across datasets;
- a probe like
WHERE editor = 'Alice'matches nothing, because the comparison runs against the hash; - names never cross the wire.
Masking the output after lineage analysis can be bypassed with aliases, expressions or functions. Here the raw column is simply not reachable.
Each layer is designed to hold if the layer before it fails. The guard is the first layer:
- single statements only;
- SELECT only;
- declared datasets only;
- function allowlist;
- CTE references resolved by scope, so
WITH t AS (SELECT * FROM t)cannot reach the real tablet; - capped LIMIT.
Behind it, each engine is locked down on its own, and the tests prove it with the guard bypassed.
The tools:
What the red team found
The adversarial suite found three real gaps outside the SQL guard. All three are fixed and kept as regression tests:
- ReDoS after the timeout. The email-redaction regex backtracked quadratically, and a
1 MB string from
repeat('x', 1000000)would have held the server for about 12 minutes. It ran after the warehouse timeout, so nothing stopped it. The fix bounds the regex repeats and cuts cells before redaction. - A single huge row skipped the result cap. The fix halves the longest text cells until the row fits.
- Pseudonyms could be linked back to names. An edit to one's own
User:page pairs a pseudonym with a title that contains the name. That re-identified 5.7% of editors in the snapshot where it was found. The fix adds conditional PII (pii_when: "namespace IN (2, 3)") for user-page titles and pseudonymizes edit summaries.
An independent review by a second model then found a gap the suite had missed, this time in the guard:
- An alias could disguise a real table as a CTE. In
WITH x AS (...) SELECT * FROM edits_raw x, x, the guard matched CTE references by alias, so the physical table skipped the policy rewrite. CTE references are now resolved by table name within each scope, and aliasing a real table to a visible CTE name is refused. - Engine errors quoted data. A message such as
Could not convert string '<value>'bypassed result redaction and reached both the agent and the audit log. Error messages now lose their quoted values and are redacted and capped.
Running the parity cases on BigQuery found one more problem, a correctness bug rather than a
leak: time literals were cast to DATETIME against TIMESTAMP columns. It is fixed.
Configure your own warehouse
Datasets declare their columns, which ones are pii or pii_when, which are free_text, and
named metrics. Undeclared columns do not exist for the agent. Over HTTP
(warehouse-mcp --config my.yaml --transport http) each bearer key selects a role. Keys come
from environment variables; the config holds no secrets.
Setup for each backend, Claude Desktop snippets and the eval workflow are in docs/deployment-guide.md. For rolling this out at a company (discovery, access model, staged rollout, success metrics, incident runbook), see docs/deployment-playbook.md.
Development
Architecture and threat model · codebase map · roadmap
Limits
- Phone-number redaction applies to columns tagged
free_text. An alias such ascomment AS closes the phone pass; it keeps email redaction, which applies everywhere. - HTTP uses static bearer keys and plain HTTP. Put TLS in front of it. OAuth resource-server mode is on the roadmap.
- Snowflake is on the roadmap.
Data
The demo data comes from Wikimedia's public recent-changes stream, licensed CC BY-SA 4.0. Code is MIT.
来源:README.md,提交 ebefc49
工具
0版本历史
1- v0.1.0最新Nov 1, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分