原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。使用 Google 登录即可撰写评价。原型 · 每 30 分钟更新
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚 登录

Governed Warehouse

作者:tongliuTL版本 0.2.1i★ 0i在你的电脑上运行官方网站 ↗

安装方法

能做什么

Governed MCP server for warehouse data: semantic layer, scoped access, PII controls and SQL guard.

作者提供的原文

  • 连接方式 在你的电脑上运行
  • 账号或密钥 无需密钥
  • 分类 数据库与数据集

可搭配使用

教 AI 做这类工作的 Skill,可与本项一起使用

last30days-skill

AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary

作者:mvanhorn★ 76,2401 个 skill

Skill · 操作手册

timesfm

TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.

作者:google-research★ 35,7401 个 skill

Skill · 操作手册

Shadowbroker

Open-source intelligence for the global theater. Track everything from the corporate/private jets of the wealthy, and spy satellites, to seismic events in one unified interface. Hook an AI agent up to have it parse through data and find previously unseen correlations. The knowledge is available to…

作者:BigBodyCobain★ 11,6391 个 skill

Skill · 操作手册

为什么排在这里

列表按使用分(满分 100)排序,由以下部分组成

热度0/80GitHub 星标或每周下载量:较大的计 60,较小的计 20
新鲜度12/1230 天内有发布或代码更新得满分
仍在响应0/8上次检查时云端端点有响应
使用分12/100

质量: 基础检查通过 3/3 项(仅展示,不用于排序) · 上升势头: 暂无数据 (只用于“上升中”标签)

安装

选择你使用的 AI 应用,然后复制设置。

用一句话让 AI 帮你安装

请帮我安装 Governed Warehouse。按照 https://mcp.popnx.com/i/tongliutl-governed-warehouse-mcp.md 操作,先把命令给我看,等我同意后再运行。

粘贴到能在你电脑上工作的 AI(如 Claude Code、Cursor)。它会读取我们的步骤,先给你看命令,等你同意。无需密钥,无需注册。 · 查看 AI 会读取的全文

通过 3/3 项检查 · 在你的电脑上运行 · ✓ 命令已检查 2026年11月28日

第一步:你用哪个 AI?

选择你用的应用,步骤会显示在下方。

可连接 Claude,但需要先准备

需要先在电脑上安装 Docker(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用

让 AI 帮你安装

把这段话复制到 Claude 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。

请在这台电脑上为 Claude 安装 MCP server Governed Warehouse,按顺序:1) 用 docker --version 检查是否有 Docker。没有的话,请让我从 https://www.docker.com/products/docker-desktop/ 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):{ "mcpServers": { "governed-warehouse": { "command": "docker", "args": [ "run", "-i", "--rm", "ghcr.io/tongliutl/governed-warehouse-mcp:0.2.1" ] } } } 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) 不需要密钥。5) 按约定执行,然后确认 Governed Warehouse 的工具真的出现了。

这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。

  1. 安装 Docker(如果还没有)

    已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter

    docker --version
    • 显示版本号(例如 Docker version …)= 已安装,可跳过这一步
    • 显示 "command not found"(Windows 显示 "is not recognized")= 还没安装,或刚装好但需要关掉终端再重新打开
    怎么打开终端

    Mac:按 ⌘ + Space,输入 Terminal 后按 Enter

    Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”

    还没安装: 安装 Docker Desktop:Mac 打开 Docker.dmg,把图标拖到“应用程序”(按电脑选择 Apple silicon 或 Intel 版本)· Windows 双击 Docker Desktop Installer.exe · 装好后打开 Docker Desktop 应用并保持运行。不需要 curl 命令

    打开 Docker 下载页 ↗

    装好后关掉终端再打开,重新运行同一条命令,应显示版本号: docker --version

    安装一次,所有需要 Docker 的工具都能用

  2. 打开电脑版 Claude 应用的设置文件

    SettingsDeveloperEdit Config

  3. 粘贴这些设置并保存文件

    {
      "mcpServers": {
        "governed-warehouse": {
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "ghcr.io/tongliutl/governed-warehouse-mcp:0.2.1"
          ]
        }
      }
    }
  4. 退出 Claude 再重新打开

  5. 试一试

    用 Governed Warehouse 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Claude 说正在使用 Governed Warehouse,或回答中出现 Governed Warehouse 的工具名称,就表示连接成功

菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同

ChatGPT 暂时无法连接 Governed Warehouse

Governed Warehouse 需要安装在你的电脑上,而 ChatGPT 只能连接在网上运行的服务器

你可以改用这些方式

A · 使用能连接 Governed Warehouse 的应用

  • 需要先在电脑上安装 Docker(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用
  • 需要先在电脑上安装 Docker(只需一次)
  • 需要先在电脑上安装 Docker(只需一次)
  • 需要先在电脑上安装 Docker(只需一次)

B · 数据库与数据集 类中能连接 ChatGPT 的其他服务器

从同类中使用较多的里挑选,仅限用地址即可连接、无需密钥的

可连接 Claude Code,但需要先准备

需要先在电脑上安装 Docker(只需一次)

让 AI 帮你安装

把这段话复制到 Claude Code 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。

请在这台电脑上为 Claude Code 安装 MCP server Governed Warehouse,按顺序:1) 用 docker --version 检查是否有 Docker。没有的话,请让我从 https://www.docker.com/products/docker-desktop/ 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):claude mcp add --scope user governed-warehouse -- docker run -i --rm ghcr.io/tongliutl/governed-warehouse-mcp:0.2.1 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) 不需要密钥。5) 按约定执行,然后确认 Governed Warehouse 的工具真的出现了。

这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。

  1. 安装 Docker(如果还没有)

    已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter

    docker --version
    • 显示版本号(例如 Docker version …)= 已安装,可跳过这一步
    • 显示 "command not found"(Windows 显示 "is not recognized")= 还没安装,或刚装好但需要关掉终端再重新打开
    怎么打开终端

    Mac:按 ⌘ + Space,输入 Terminal 后按 Enter

    Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”

    还没安装: 安装 Docker Desktop:Mac 打开 Docker.dmg,把图标拖到“应用程序”(按电脑选择 Apple silicon 或 Intel 版本)· Windows 双击 Docker Desktop Installer.exe · 装好后打开 Docker Desktop 应用并保持运行。不需要 curl 命令

    打开 Docker 下载页 ↗

    装好后关掉终端再打开,重新运行同一条命令,应显示版本号: docker --version

    安装一次,所有需要 Docker 的工具都能用

  2. 打开终端

    Mac:按 Command+空格,输入 Terminal · Windows:打开 PowerShell

  3. 粘贴这条命令并按 Enter

    claude mcp add --scope user governed-warehouse -- docker run -i --rm ghcr.io/tongliutl/governed-warehouse-mcp:0.2.1
  4. 在 Claude Code 中输入 /mcp

    应能看到 Governed Warehouse 在列表中并显示已连接

  5. 试一试

    用 Governed Warehouse 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Claude Code 说正在使用 Governed Warehouse,或回答中出现 Governed Warehouse 的工具名称,就表示连接成功

菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同

可连接 Cursor,但需要先准备

需要先在电脑上安装 Docker(只需一次)

让 AI 帮你安装

把这段话复制到 Cursor 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。

请在这台电脑上为 Cursor 安装 MCP server Governed Warehouse,按顺序:1) 用 docker --version 检查是否有 Docker。没有的话,请让我从 https://www.docker.com/products/docker-desktop/ 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):{ "mcpServers": { "governed-warehouse": { "command": "docker", "args": [ "run", "-i", "--rm", "ghcr.io/tongliutl/governed-warehouse-mcp:0.2.1" ] } } } 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) 不需要密钥。5) 按约定执行,然后确认 Governed Warehouse 的工具真的出现了。

这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。

  1. 安装 Docker(如果还没有)

    已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter

    docker --version
    • 显示版本号(例如 Docker version …)= 已安装,可跳过这一步
    • 显示 "command not found"(Windows 显示 "is not recognized")= 还没安装,或刚装好但需要关掉终端再重新打开
    怎么打开终端

    Mac:按 ⌘ + Space,输入 Terminal 后按 Enter

    Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”

    还没安装: 安装 Docker Desktop:Mac 打开 Docker.dmg,把图标拖到“应用程序”(按电脑选择 Apple silicon 或 Intel 版本)· Windows 双击 Docker Desktop Installer.exe · 装好后打开 Docker Desktop 应用并保持运行。不需要 curl 命令

    打开 Docker 下载页 ↗

    装好后关掉终端再打开,重新运行同一条命令,应显示版本号: docker --version

    安装一次,所有需要 Docker 的工具都能用

  2. 点击这个按钮打开 Cursor

    在 Cursor 中打开

    Cursor 会请你确认安装,点击 Install

  3. 在 Cursor 中以 Agent 模式打开 AI 聊天

  4. 试一试

    用 Governed Warehouse 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 Cursor 说正在使用 Governed Warehouse,或回答中出现 Governed Warehouse 的工具名称,就表示连接成功

菜单名称已于 2026年11月11日 对照 Cursor 帮助页面核实 · 你的界面可能因版本略有不同

可连接 VS Code,但需要先准备

需要先在电脑上安装 Docker(只需一次)

让 AI 帮你安装

把这段话复制到 VS Code 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。

请在这台电脑上为 VS Code 安装 MCP server Governed Warehouse,按顺序:1) 用 docker --version 检查是否有 Docker。没有的话,请让我从 https://www.docker.com/products/docker-desktop/ 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):{ "servers": { "governed-warehouse": { "type": "stdio", "command": "docker", "args": [ "run", "-i", "--rm", "ghcr.io/tongliutl/governed-warehouse-mcp:0.2.1" ] } } } 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) 不需要密钥。5) 按约定执行,然后确认 Governed Warehouse 的工具真的出现了。

这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。

  1. 安装 Docker(如果还没有)

    已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter

    docker --version
    • 显示版本号(例如 Docker version …)= 已安装,可跳过这一步
    • 显示 "command not found"(Windows 显示 "is not recognized")= 还没安装,或刚装好但需要关掉终端再重新打开
    怎么打开终端

    Mac:按 ⌘ + Space,输入 Terminal 后按 Enter

    Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”

    还没安装: 安装 Docker Desktop:Mac 打开 Docker.dmg,把图标拖到“应用程序”(按电脑选择 Apple silicon 或 Intel 版本)· Windows 双击 Docker Desktop Installer.exe · 装好后打开 Docker Desktop 应用并保持运行。不需要 curl 命令

    打开 Docker 下载页 ↗

    装好后关掉终端再打开,重新运行同一条命令,应显示版本号: docker --version

    安装一次,所有需要 Docker 的工具都能用

  2. 点击这个按钮打开 VS Code

    在 VS Code 中打开

    VS Code 会请你确认安装,点击 Install

  3. 在 VS Code 中以 Agent 模式打开 AI 聊天

  4. 试一试

    用 Governed Warehouse 告诉我你能帮我做什么,然后做一件给我看

    ✓ 如果 VS Code 说正在使用 Governed Warehouse,或回答中出现 Governed Warehouse 的工具名称,就表示连接成功

菜单名称已于 2026年11月11日 对照 VS Code 帮助页面核实 · 你的界面可能因版本略有不同

其他支持 MCP 的应用(如 Windsurf、Zed、Gemini CLI)添加方式各不相同,请在应用列表中查看

查看所有支持 MCP 的应用 →

JSON 设置在下方“开发者专用”中

卡住了?问问正在用 Governed Warehouse 的人💬 讨论 →
开发者专用:终端命令和 JSON 设置

安装在电脑上

Claude Code

claude mcp add --scope user governed-warehouse -- docker run -i --rm ghcr.io/tongliutl/governed-warehouse-mcp:0.2.1

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "governed-warehouse": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/tongliutl/governed-warehouse-mcp:0.2.1"
      ]
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "governed-warehouse": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/tongliutl/governed-warehouse-mcp:0.2.1"
      ]
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "governed-warehouse": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/tongliutl/governed-warehouse-mcp:0.2.1"
      ]
    }
  }
}

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

一览

注册名称
io.github.tongliuTL/governed-warehouse-mcp
每周下载量i
不在 npm/PyPI 上
连接方式
在你的电脑上运行
传输方式
streamable-http
最新版本i
0.2.1
发布到注册中心i
2026年11月27日
代码最后更新i
2026年11月27日
作者
tongliuTL
软件包
oci: ghcr.io/tongliutl/governed-warehouse-mcp:0.2.1
注册状态
活跃

哪些应用可以使用它

依据这个服务器的连接方式和各应用自己的文档,检查于 2026年11月10日。

在你的电脑上运行,适用于

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

全部应用及其优缺点 →

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月28日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 tongliuTL 验证,该账户拥有此仓库

  • ✓ 通过

    仍在维护

    代码最后更新于昨天

  • ✓ 通过

    有许可证

    使用 MIT

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

已公开的漏洞(OSV.dev)

未检查:只能检查标明版本的 npm 和 PyPI 包

我们检查什么 → · JSON

作者:申请重新检查或报告信息错误
给作者:在 README 中加徽章

如果你是作者,可把这段代码贴到 README。徽章会链接回本页。

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/tongliutl-governed-warehouse-mcp.svg)](https://mcp.popnx.com/en/servers/tongliutl-governed-warehouse-mcp)

讨论

提问、分享技巧或报告无法使用。按“有帮助”数量排序。

还没有帖子,欢迎第一个提问或分享。

此处内容由用户撰写,不代表 PopNx 团队。

登录后发帖

用户评价

还没有评价

登录后写评价

与“数据库与数据集”中的其他服务器比较i

  • 星标数多于此分类中其他 1335 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 1335 个服务器的 99% 更新
  • 基础检查结果等于或优于此分类中其他 1335 个服务器的 99%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

Governed Warehouse 安全吗?

它在 3 项适用的基础检查中通过了 3 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于昨天,最新版本(0.2.1)于昨天进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Docker。

有什么可以替代它?

同一分类中有:Supabase, Neon, DBCode, Keboola MCP, WaveHouse Cloud

功能相近的其他选择

同一分类、其他作者、命令已通过检查。官方的排在前面,再按星标排序。

如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

Supabase

MCP server for interacting with the Supabase platform

作者:supabase广泛使用↓ 24.6万/周★ 3024 整个仓库的星标昨天更新

可立即连接(有 URL) · 需登录✓ 服务方 · supabase.com

Neon

Official Neon MCP server for managing Neon projects and Lakebase Postgres databases.

作者:neondatabase正在增长★ 66822天前更新

可立即连接(有 URL) · 需登录✓ 服务方 · neon.com

DBCode

Query and explore 100+ databases through your DBCode connections.

作者:dbcodeio起步阶段↓ 118/周★ 369 整个仓库的星标2个月前更新

在你的电脑上运行✓ 服务方 · dbcode.io

Keboola MCP

Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...

作者:keboola正在增长↓ 355/周★ 849天前更新

可立即连接(有 URL) · 需登录✓ 服务方 · keboola.com

WaveHouse Cloud

Browse, query, and administer your managed WaveHouse + ClickHouse projects (schema, pipes, policy).

作者:Wave-RF起步阶段★ 417天前更新

可立即连接(有 URL) · 需登录✓ 服务方 · wavehouse.cloud
与相似项目对比
本项
Governed Warehouse
SupabaseNeonDBCodeKeboola MCPWaveHouse Cloud
运行位置需要安装在电脑上云端或安装在电脑上都可以在云端运行,无需安装需要安装在电脑上云端或安装在电脑上都可以在云端运行,无需安装
需要密钥否是否否否否
可在 Claude 中按 + 添加否是是否否否
基础检查3/35/55/52/35/54/4
许可证MITApache-2.0MITNOASSERTIONMITApache-2.0
价格登记中未列出费用登记中未列出费用登记中未列出费用登记中未列出费用登记中未列出费用登记中未列出费用

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

governed-warehouse-mcp

A governed Model Context Protocol server that lets AI agents answer questions from an analytical warehouse. Agents cannot write to the warehouse, read data their token does not allow, or see personal data they are not cleared for. The repository also has an eval harness for tool-calling agents. It runs the real Anthropic SDK and the real MCP server end to end, and it runs offline, so CI needs no API key. Live runs work with Claude or any Anthropic-compatible API, can be traced to Langfuse, and can be graded by an LLM judge that is calibrated against the deterministic graders first.

The warehouse is a synthetic cross-border freight dataset (shipments, carriers, lanes, border crossings, customs documents, invoices, quotes). It is generated deterministically from a seed, and nothing in it is real.

$ uv run gwm-eval all --gate

wrote reports/report.md and reports/report.json all gates passed

Contents

Why it exists

Letting an LLM agent query a warehouse is easy. Letting it do so safely, and knowing whether it answers correctly, is the hard part. This repository does both:

  • The server puts a semantic layer, an access policy and a SQL guard between the agent and the data. Agents ask for governed metrics by name, or write SQL. Agent SQL is parsed, checked and regenerated before it runs on a read-only, sandboxed connection. Every call is audited.
  • The eval harness measures an agent on that server. It checks whether the agent answers correctly, respects governance, and resists prompt injection planted in the data. The graders are deterministic, and they are themselves tested against planted failures. An LLM judge covers what rules cannot check (is a refusal honest? is the answer clear?), and it is calibrated against those graders and human labels before its verdicts count.

What an agent sees

Five tools and one resource:

toolwhat it does
search_modelsranks the models and metrics the caller may see for a plain-language question
describe_modelreturns grain, tier, columns (with which are PII), joins and metrics for one model
list_metricslists governed metrics with definitions, time column and allowed dimensions
query_metriccomputes a metric by name, grouped, filtered and bucketed by time; returns the SQL that ran
run_sqlruns one read-only SELECT over visible catalog models, after the guard checks it
catalog://versionresource: the published catalog version and its tiers

A metric query returns rows together with how they were produced. These are real responses for the analyst role; the data is synthetic:

// query_metric {"metric": "on_time_rate", "group_by": ["dim_lanes.border_crossing"],

// "start_date": "2025-01-01", "end_date": "2025-12-31"} { "columns": ["border_crossing", "on_time_rate"], "rows": [[null, 0.873348], ["Detroit-Windsor", 0.788462], ["El Paso", 0.765799], ["Laredo", 0.753898], ["Buffalo", 0.752964], ["Nogales", 0.752092]], "truncated": false, "sql": "SELECT \"dim_lanes\".\"border_crossing\" AS \"border_crossing\", AVG(CASE WHEN ...) ...", "models": ["dim_lanes", "fct_shipments"], "catalog_version": "v1-42c3e5f7aec9" }

Refusals start with a stable code, so an agent can recover and an eval can grade without parsing prose:

run_sql "select contact_email from dim_customers limit 3"

PII_DENIED: column 'contact_email' is PII and needs the pii:read scope

run_sql "select sum(amount_usd) from fct_invoices" (restricted model) UNKNOWN_MODEL: 'fct_invoices' is not a model you can query; use search_models to find one

run_sql "drop table fct_invoices" READ_ONLY: only SELECT queries are allowed, got DROP

A restricted model gets the same answer as a model that does not exist, so a refusal never confirms what is there.

Architecture

flowchart LR

subgraph Agent["Agent (warehouse_evals.agent)"] LLM["Anthropic SDK: Claude or an Anthropic-compatible API streaming, adaptive thinking"] Loop["Tool loop strict JSON re-parse JSON Schema validation"] LLM <--> Loop end

subgraph Server["MCP server (warehouse_mcp.server)"] Auth["Auth Ed25519 JWT, scopes"] RL["Rate limit"] Tools["Tools search_models · describe_model list_metrics · query_metric · run_sql"] Sem["Semantic compiler metric to AST"] Guard["SQL guard sqlglot AST, fail closed"] Audit[("Audit log JSONL")] Auth --> RL --> Tools Tools -- query_metric --> Sem --> Guard Tools -- run_sql --> Guard Tools -.-> Audit end

Catalog[["Catalog (YAML) models, tiers, PII columns, joins, metrics"]] DB[("DuckDB, read-only no external access, config locked, timeout")]

Loop -- "MCP: stdio, Streamable HTTP or in-process" --> Auth Loop -.->|"live runs only, PII redacted"| LF[("Langfuse traces")] Catalog --> Tools Catalog --> Sem Catalog --> Guard Guard --> DB

Every tool call takes the same path:

  1. resolve the principal from the token;
  2. apply the rate limit;
  3. run the tool against the catalog;
  4. check the SQL;
  5. execute it;
  6. write the audit record.

The architecture notes cover each component and the reasoning behind the main design choices.

Governance model
partneranalystfinancesupport
public models (lanes, carriers, lane and carrier marts)✓✓✓✓
internal models (shipments, customers, tracking, documents, quotes)✓✓✓
restricted models (invoices, revenue marts)✓
PII columns (customer contact name, email, phone)✓

Roles are only presets for dev tokens. The server reads scopes: warehouse:public, warehouse:internal, warehouse:restricted and pii:read. Tiers are contiguous, so a token with restricted but not internal gets public access only.

Defence in depth, from the outside in:

  1. Authentication. Tokens are Ed25519-signed JWTs. The algorithm is pinned, and exp, iat, sub, iss and aud are required. Over HTTP the MCP SDK's auth middleware verifies every request; over stdio the token is verified once at start-up. The token's client_id names the agent, and its scopes are cut to what that agent is permitted in the agent registry. A missing, unknown or disabled agent is rejected, and onboarding another agent is one registry entry.
  2. Semantic layer. query_metric compiles a metric request into a sqlglot AST from the catalog. User values only ever become quoted literals, and identifiers are always quoted.
  3. SQL guard. run_sql SQL, and compiled metric SQL again, must pass these checks:
  • exactly one read-only statement, over visible catalog models only;
  • no file, network, settings or introspection functions;
  • no positional references;
  • no PII columns without pii:read, wherever they appear (select list, filters, joins, *, whole-row references).

The SQL that runs is regenerated from the checked AST, so comments never reach the engine.

  1. Engine. DuckDB is opened read-only, with external access disabled, extension autoload off, a memory limit and a query timeout. Its configuration is locked, so a query cannot undo any of this.
  2. Result budget. Rows are capped, and responses are truncated to a character budget with a flag the agent can see. Results from free-text columns carry a warning that their content is data, not instructions.

The threat model maps each threat to its mitigation and to the test that proves it.

Quickstart

Requires uv.

uv sync

uv run gwm generate # build data/warehouse.duckdb (deterministic) uv run gwm keys # dev Ed25519 keypair in .keys/ uv run gwm token --role analyst # print a signed dev token

Use it from Claude Code
claude mcp add warehouse \

--env GWM_TOKEN="$(uv run gwm token --role analyst --ttl 86400)" \ -- uv --directory "$PWD" run gwm serve

Use it from Claude Desktop
{

"mcpServers": { "warehouse": { "command": "uv", "args": ["--directory", "/absolute/path/to/governed-warehouse-mcp", "run", "gwm", "serve"], "env": { "GWM_TOKEN": " " } } } }

Run it over Streamable HTTP
uv run gwm serve --transport http --port 8000 --audit-log audit.jsonl

clients send: Authorization: Bearer

Without a valid bearer token the server answers 401. With one, each request is served with that token's scopes. /healthz and /readyz answer without a token and return no data.

Deployment

The Dockerfile builds a small image that serves Streamable HTTP as a non-root user. The synthetic warehouse is baked in at /data, and the server needs only a public key at /keys:

A prebuilt image is published for each release as ghcr.io/tongliutl/governed-warehouse-mcp (linux/amd64 and linux/arm64), and the server is listed in the MCP Registry as io.github.tongliuTL/governed-warehouse-mcp. To build it yourself:

docker build -t governed-warehouse-mcp .

uv run gwm keys --dir .keys # dev keys; in production, your identity provider's key docker run --rm -p 8000:8000 --read-only --tmpfs /tmp \ -v "$PWD/.keys/public.pem:/keys/public.pem:ro" governed-warehouse-mcp curl localhost:8000/readyz # {"status": "ready", "catalog_version": "..."}

  • Read-only. The root filesystem can be read-only: the warehouse opens read_only, spilling to disk is off, and nothing is written outside /tmp. Mount your own warehouse with -v /path/to/data:/data:ro.
  • Host names. DNS-rebinding protection only accepts listed Host headers. The image accepts localhost:8000 and 127.0.0.1:8000; behind a proxy, pass your own, for example docker run ... governed-warehouse-mcp --allowed-host mcp.example.com --public-url https://mcp.example.com.
  • Probes. /healthz (the process is up) and /readyz (a trivial query succeeds; 503 otherwise). The image's HEALTHCHECK uses /readyz.
  • CI. Every change builds the image, runs it with a read-only root filesystem, and runs scripts/smoke_http.py: probes, a 401 without a token, an allowed query, a denied one and a refused write.

This makes the server deployable, not operated: there is no identity provider, TLS termination, log shipping or horizontal scaling here. Those belong to the platform it runs on.

Evals

uv run gwm-eval all --gate             # offline: what CI runs

uv run gwm-eval live --trials 3 -

只显示了开头部分;其余内容请在仓库中阅读