Skip to main content
Glama
debary-mcp-compliance

debary-mcp-compliance

Official
by DE-BARY-LLC

debary-mcp-compliance

tests

米国の不動産リスティング文面向けの公正住宅・広告ルールエンジンに、言語モデルがアクセスできるようにするMCPサーバーです。ただし、判断はモデルに委ねません。

このエンジンは決定的です。81のフレーズルール、35の必須要素、6つの州、判断経路にモデルは一切関与しません。このサーバーは質問を運び込み、判定を持ち帰ります。受け取ったモデルには、すべての指摘事項、その背後にある法令、ルールベースが提案する代替文言が渡ります。しかし、それに異議を唱える許可は渡りません。

これが、RESTエンドポイントに丁寧な説明を添えたものではなく、MCPサーバーである理由です。モデルには、議論できないツールが必要です。そしてMCPは、そのツールをモデルの判断の内側ではなく、手の届く範囲に置くプロトコルです。

DE BARY LLC によって構築されました。ラップしているエンジンは gate.debary.us で稼働しています。


試してみる

設定不要、ルールベース不要、ネットワーク不要:

pip install -e .
python demo.py

デモはサーバーをサブプロセスとして起動し、MCPで通信し、不合格となるリスティング、各指摘の背後にある法令、修正、そして修正がまだ見逃しているものを再チェックで検出する流れを順に実行します。

⚠️ 何も設定しない場合、サーバーはサンプルルールベースで動作します。このリポジトリのために書かれた6つのルールと4つの必須要素で、誰でも実行・テストできるようにしています。これは自己申告します。すべての結果に backend: "sample" と rules_version: "sample-1" が付きます。これは説明用であり、コンプライアンスツールではありません。実際の回答を得るには、GATE_APP_DIR または GATE_URL を実際のベースに向けてください。


Related MCP server: genpark-automated-compliance-policy-evaluator-skill

公開しているもの

MCPには3つのプリミティブがあります。このサーバーはそのすべてを使用し、それぞれが運ぶものに適した形であるために存在します。

ツール — モデルがエンジンに依頼する処理

ツール

目的

check_listing

リスティング文面をエンジンに通します。指摘事項、不足している必須要素、分岐のための blocking 判定を返します。

explain_rule

指摘の背後にある完全なルール(法令を含む)を返します。モデルが権威を思い出すのではなく、引用できるようにします。

suggest_rewrite

問題のある箇所の文字オフセットと、承認された代替文言を返します。意図的に書き換えは行いません — 文面の作成はモデルの仕事、検証はエンジンの仕事です。

get_receipt

保存されたチェック結果: 何が検査されたか、どのルールバージョンに対してか、正確なテキストのSHA-256。

リソース — モデルが直接読める素材

URI

内容

gate://rules

ルールベースの索引: すべてのルールと必須要素をID、重大度、カテゴリ別に表示

gate://rules/{rule_id}

1つのルールを完全に、権威とソース文書付きで表示

gate://elements/{state}

その州で広告が必ず含まなければならない開示要素

gate://receipt/{receipt_id}

過去のチェック結果とそのアンカーブロック

プロンプト — ワークフロー。各クライアントが再発明しなくて済むように

プロンプト

強制する内容

review_listing

チェック → 引用 → 書き換え → 書き換えを再チェック。最後のステップは、モデルが即興でやるときにスキップされるものです。

explain_verdict

レシートを、ライセンスを持つエージェントが行動に移せるものに変換します。エンジンが機械的に検証できなかったものも含みます。


設計ノート

判定は交渉不可です。 高重大度のルールが1つでも発火するか、必須要素が1つでも欠けている場合、blocking は true になります。ツールの説明にも、サーバーの指示にも、review_listing プロンプトにもそう書かれており、モデルは失敗した書き換えを修正済みとして提示するのではなく、率直に報告するように指示されます。

blocking: false はクリアランスではありません。 ルールが発火しなかったという意味です。elements_manual は、エンジンが機械的にチェックできないものを列挙します — それらは依然として人間が必要です。検査しなかったものを静かに成功と報告するツールは、ツールがないより悪いです。

すべての指摘には権威が付随します。 引用のない指摘は意見であり、意見を持つルールエンジンは、余計な手順が増えた言語モデルです。これは意図だけでなく、テストスイートで強制されています。

3つのバックエンド、1つのインターフェース。 LocalBackend はエンジンをインポートし、プロセス内で評価します — ネットワーク不要で、リスティングテキストはマシンから出ません。RemoteBackend は稼働中のゲートにHTTPで呼びかけます。SampleBackend は独自の小さなルールベースを持ち、新規クローンでもサーバーが動作します。3つとも同じ形を返すため、MCPレイヤーはどれが応答したかを知ることはありません。

フォールバックは自己申告します。 本物を静かに装うサンプルは罠です。これはすべての結果に sample を、バージョンフィールドに sample-1 を入れ、どちらかのラベルが欠けた場合に失敗するテストがあります。

2つのトランスポート。 デスクトップクライアント用の 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_URL=https://gate.debary.us GATE_TOKEN=… debary-mcp-compliance

両方が設定されている場合、GATE_APP_DIR が優先されます。プロセス内評価は高速で、リスティングテキストをワイヤーに載せません。

Dockerで

docker compose up -d

コンテナは :8765/mcp(ストリーミング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_APP_DIR

engine.py と rules.json を含むディレクトリ。ローカルバックエンドを選択します。

GATE_URL

稼働中のゲートのベースURL。リモートバックエンドを選択します。

(どちらも未設定)

組み込みのサンプルルールベースにフォールバックします。

GATE_TOKEN

そのゲートのベアラートークン(APIが閉じている場合)。

MCP_TRANSPORT

stdio(デフォルト)、streamable-http、または sse。

MCP_HOST / MCP_PORT

HTTPトランスポートのバインドアドレス。デフォルト 0.0.0.0:8765。


テスト

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 として返され、合格として返されることはない

  • サンプルバックエンドは自分がサンプルであるとラベル付けする

3つの本番テストは、GATE_APP_DIR が設定されていない限りスキップされます。これらは、このプロジェクトが公に述べているルールバージョンと件数、および州によって判定が異なることを検証します — サンプルが代わりを務められない主張です。


範囲と制限

⚠️ 法的助言ではありません。 ルールは公開された法令、機関のガイダンス、業界方針から編集されました。各ルールにはソースと読了日が付いています。コンプライアンスは規制当局と裁判所が決定するものであり、このサーバーが決定するものではありません。

⚠️ 6州: TX、CA、NY、FL、IL、WA。間違った州に対してチェックを実行すると、間違った必須要素が静かに適用されます — state 引数は飾りではありません。

⚠️ サンプルルールベースは製品ではありません。 公開法令に対する6つのルールで、このリポジトリを誰でも実行できるように書かれています。gate.debary.us の背後にあるベースはより大きく、ソース付き文書から読了日付きで編集され、別途保守されています。

⚠️ 助言的指摘は州にスコープされます。 ある州で拘束力のあるフレーズが、別の州では advisory として返されることがあります。それはエンジンが不確かだからではなく、正確だからです。


Apache-2.0 · DE BARY LLC, Austin TX

Available Tools

4 tools
check_listingCheck listing textA
Read-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 ruleA
Read-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 receiptA
Read-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 briefA
Read-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

    A4.4/5.0

    Scored across 4 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness5/5

    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

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI-powered real estate analysis with built-in EU AI Act compliance, providing a production-ready MCP server for property insights and governance.
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables 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
    • A
      license
      A
      quality
      B
      maintenance
      Deterministic 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.
      4
      MIT