debary-mcp-compliance
Officialdebary-mcp-compliance
一个为美国房地产列表文本提供公平住房与广告规则引擎的 MCP 服务器——但不提供裁决结果。
该引擎是确定性的:81 条短语规则、35 个必备要素、六个州,决策路径中没有任何模型。该服务器接收问题并输出裁决结果。模型在另一端接收每一条发现、背后的法规条文、以及规则库建议的措辞。它不会收到的是——提出异议的权利。
这正是它作为 MCP 服务器而非 REST 端点存在的原因。模型需要一个它无法争辩的工具,而 MCP 协议正是将这样的工具置于其可及范围之内,同时不赋予其评判的权力。
由 DE BARY LLC 构建。其引擎运行于 gate.debary.us。
试用
无需配置、无需规则库、无需网络:
pip install -e .
python demo.py演示以子进程方式启动服务器,通过 MCP 与之通信,并逐步展示:一条未通过的列表、每条发现背后的法规条文、一次修复,以及复查后仍然遗漏的问题。
⚠️ 在未配置任何内容的情况下,服务器运行在示例规则库上——六条规则和四个必备要素,专为本仓库可运行、可测试而编写。它会在每个结果上标注 backend: "sample" 和 rules_version: "sample-1"。它仅作演示,并非合规工具。将 GATE_APP_DIR 或 GATE_URL 指向真实规则库,才能获得真实答案。
Related MCP server: genpark-automated-compliance-policy-evaluator-skill
它提供了什么
MCP 有三种原语。本服务器全部使用,且每一种都因其形态恰好适合所承载的内容而存在。
工具——模型请求引擎执行的操作
工具 | 用途 |
| 对列表文本运行引擎。返回发现的问题、缺失的必备要素,以及用于分支判断的 |
| 返回每条发现背后的完整规则,包括法规条文。让模型引用权威依据,而非凭记忆复述。 |
| 返回每个问题片段的字符偏移量及经批准的替换措辞。刻意不直接改写——组织语言是模型的工作,验证合规是引擎的工作。 |
| 返回一次已存储的检查记录:检查了哪些内容、依据哪个规则版本、以及所提交原文的 SHA-256 摘要。 |
资源——模型可直接读取的材料
URI | 内容 |
| 规则库索引:每条规则和必备要素的 ID、严重级别和类别。 |
| 单条规则的完整内容,含权威依据和来源文件。 |
| 该州广告中必须包含的必备要素。 |
| 一次已存储的检查记录及其锚定片段。 |
提示词——预定义的工作流,客户端无需自行设计
提示词 | 内容 |
| 检查 → 引用 → 改写 → 复查改写结果。最后一步正是模型即兴发挥时最容易跳过的一步。 |
| 将一份检查记录转化为持证房产经纪人可以依据的内容,包括引擎无法机械验证的部分。 |
设计说明
裁决结果不可协商。 当任何高严重级别规则触发或任何必备要素缺失时,blocking 即为 true。工具描述如此说明,服务器指令如此规定,review_listing 提示词也要求模型如实报告失败,而非将其粉饰为已修复。
blocking: false 并非免责声明。 它仅表示没有规则触发。elements_manual 列出引擎无法机械检查的内容——这些仍需人工判断。一个对未检查内容静默报告成功的工具,比没有工具更糟。
每条发现都带有权威依据。 没有法规引用的发现只是观点;而一个只会发表观点的规则引擎,不过是一个多走几步的语言模型。这一点由测试套件强制保证,而非仅靠意图。
三种后端,同一接口。 LocalBackend 导入引擎并在进程内运行——无需网络,列表文本永不离开本机。RemoteBackend 通过 HTTP 调用运行中的 gate 服务。SampleBackend 自带一个小型规则库,使服务器可在全新环境中运行。三者返回完全相同的结构,因此 MCP 层无需关心底层是哪一个。
回退方案会自我标识。 静默冒充真实服务的示例实现才是陷阱。本服务器会在每个结果中标注 sample、在每个版本字段中标注 sample-1,并且有测试确保这些标识不会被遗漏。
两种传输方式。 stdio 适用于桌面客户端,streamable-http 适用于容器环境。sse 仍被接受以兼容旧客户端,但已弃用,不应再用于新项目。
要求 2.x 版 SDK。 Python SDK 在 2.0 中将 FastMCP 更名为 MCPServer,并将 mcp.server.fastmcp 移至 mcp.server.mcpserver;结果字段也从 structuredContent 改为 structured_content。本服务器仅面向 2.x。通过兼容层同时支持两个大版本的做法曾被考虑但被否决——那会引入一层兼容代码,而本项目的全部意义恰恰在于决策路径保持简洁。
运行方式
使用本地规则库
pip install -e .
GATE_APP_DIR=/path/to/compliance-gate/app debary-mcp-compliance使用远程 gate 服务
GATE_URL=https://gate.debary.us GATE_TOKEN=… debary-mcp-compliance若同时设置了 GATE_APP_DIR,则本地规则库优先:进程内求值更快,且列表文本不会离开本机。
使用 Docker
docker compose up -d容器监听 :8765/mcp(streamable HTTP),并发布到宿主机 8766 端口,仅绑定回环地址。规则库以只读方式挂载——容器可以执行规则,但不能修改规则。
Claude Desktop
{
"mcpServers": {
"debary-compliance": {
"command": "debary-mcp-compliance",
"env": { "GATE_APP_DIR": "/path/to/compliance-gate/app" }
}
}
}Claude Code
claude mcp add debary-compliance \
--env GATE_APP_DIR=/path/to/compliance-gate/app \
-- debary-mcp-compliance配置
变量 | 含义 |
| 存放 |
| 运行中的 gate 服务的基础 URL。选择远程后端。 |
(两者均未设置) | 回退到内置示例规则库。 |
| 访问受保护的 gate 服务所需的 Bearer 令牌。 |
|
|
| HTTP 传输的绑定地址。默认 |
测试
pip install -e ".[dev]"
pytest -q # 21 protocol tests, no setup
GATE_APP_DIR=/path/to/compliance-gate/app pytest -q # + 3 production tests测试不会导入工具函数并直接调用。它们以子进程方式启动服务器,通过 stdio 完成握手,再以客户端身份驱动它——因为一个在进程内正常、通过网络就失效的工具,本质上就是不能用的工具。
除正常路径外,测试还验证:
每个工具都声明了输出模式,调用方依据字段而非描述文字进行分支判断
每条发现都带有权威依据以及替换措辞
发现之间从不重叠,因此不会重复计数,也不会破坏改写结果
改写偏移量确实指向其所声称匹配的文本
摘要基于所提交的原文计算,而非规范化后的副本
未知的规则 ID 返回错误,而非空答案
引擎无法验证的要素返回
manual,绝不会标记为通过示例后端会明确标注自己的身份
三项生产环境测试在未设置 GATE_APP_DIR 时自动跳过。它们断言规则版本、本项目公开声明中的计数,以及不同州的裁决结果确实不同——这些是任何示例都无法替代的声明。
范围与限制
⚠️ 非法律意见。 规则汇编自公开法规、机构指引和行业政策;每条规则均附有来源及阅读日期。合规与否由监管机构和法院决定,而非本服务器。
⚠️ 仅覆盖六个州: TX、CA、NY、FL、IL、WA。针对错误州执行的检查会静默应用错误的必备要素——state 参数绝非装饰。
⚠️ 示例规则库并非产品。 六条针对公开法规的规则,仅为让本仓库任何人都能运行而编写。gate.debary.us 背后的规则库规模更大,汇编自带有阅读日期的来源文件,并独立维护。
⚠️ 咨询性发现具有州级范围。 在某州具有约束力的表述,在另一州可能返回 advisory。这正是引擎的精确性所在,而非不确定性。
Apache-2.0 · DE BARY LLC,德克萨斯州奥斯汀
Available Tools
4 toolscheck_listingCheck listing textARead-only
Run listing text through the compliance rule engine.
Returns every rule that fired, the statute behind it, and the required elements the text is missing for that state and channel. Supplying brokerage, licensee and license_id lets the engine verify disclosure elements instead of deferring them to manual review.
Inputs: text (required), state, channel, licensee, +2 more. Returns: Flat where a caller needs to branch, nested where it needs detail.
explain_ruleExplain a ruleARead-only
Return the full rule behind a finding, including the statute it rests on.
Use this before telling anyone why their text was flagged. The authority field
is the citation; do not substitute a remembered one.
Inputs: rule_id (required). Returns: why, match, source, pattern, +8 more
get_receiptFetch a stored receiptARead-only
Retrieve a stored check receipt, including its anchoring block if one exists.
A receipt records what was checked, against which rule version, and the SHA-256 of the exact text. Where an anchor is present, that digest was written to a public ledger by a signer that does not run on the gate -- so the record can be shown to a third party without asking them to trust the server that produced it.
Inputs: receipt_id (required). Returns: object
suggest_rewritePrepare a rewrite briefARead-only
Collect what must change in a text, with character offsets and the engine's own replacement wording.
This tool deliberately does not rewrite anything. It hands back the spans and the
approved substitutions; composing the new text is the calling model's job, and
the result must be checked again with check_listing before it is published.
Inputs: text (required), state, channel. Returns: hints, blocking, guidance, text_sha256, +1 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool occupies a distinct role: running a compliance check, explaining a rule, suggesting rewrite spans, and retrieving an audit receipt. There is no meaningful overlap or ambiguity between them.
All four tools follow the same snake_case verb_noun pattern: check_listing, explain_rule, suggest_rewrite, get_receipt. The naming is predictable and makes the action and target of each tool immediately clear.
Four tools is a well-scoped size for a compliance-assistance server. Each tool supports a necessary step in the workflow without adding redundant or decorative surface area.
The tool set covers the full workflow: check a listing, understand why it was flagged, obtain safe replacement wording, and retrieve verifiable proof of a prior check. The deliberate absence of auto-rewriting is handled cleanly through the check-again instruction.
Maintenance
Related MCP Connectors
MLS-ready, Fair-Housing-safe property listing descriptions (en/ko/es) and wording checks.
Evidence-backed pre-purchase checks for offer terms, seller trust and policy compliance.
Checks health marketing copy against FTC, FDA, HIPAA and ad rules before an AI agent publishes it.
Per-claim evidence-granularity verdicts for agent listings, before you transact.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI-powered real estate analysis with built-in EU AI Act compliance, providing a production-ready MCP server for property insights and governance.1MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables scanning e-commerce advertising content to detect prohibited claims and trademark violations, returning deterministic compliance evaluations for autonomous agents.-
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to retrieve verbatim U.S. mortgage regulations with citations and effective dates, verify quotes, and run guided compliance playbooks without sending user documents to the server.MIT
- AlicenseAqualityBmaintenanceDeterministic compliance audit for cross-border e-commerce listings (Amazon, Temu, TikTok Shop): banned words, promo words, absolute claims, certification and trademark risks, and 2026 AI content disclosure. Versioned YAML rule packs, three-level obfuscation-resistant matching, exit-code CI gate and SARIF output. No LLM involved in judging.41MIT