US Code of Federal Regulations

io.github.mccallar由 GitHub 帳號 mccallar 發布v0.2.2更新於 Oct 24, 2026

Look up, search, and track changes to the US Code of Federal Regulations (eCFR).

發布方自己的服務:Regulations.ai — Global AI Law Tracker

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理查詢、檢索並追蹤美國聯邦法規(eCFR),並附上引註。

可以做什麼
  • 查詢某條法規引註的原文,包含部分與分部層級
  • 全文檢索法規,並查看哪些篇目含有某個詞彙及命中次數
  • 瀏覽篇目或部分的階層結構,並將機關對應到其主管的篇目
  • 追蹤修訂歷程,以及造成每次變更的聯邦公報規則
  • 比對某條引註在兩個日期之間的文本差異,並依指定日期讀取當時的法規
適用情境
當你需要真正的法規原文與引註,而不是聽起來合理的猜測時使用,例如確認某條款要求什麼,或某部分自某年以來是否修改過。適合美國聯邦法規的法遵研究、政策問答與文書起草。
執行需求
以 Python 套件(cfr-mcp)透過 uvx 在本機以 stdio 執行,需要 Python 3.11 以上版本。不需 API 金鑰,eCFR 與聯邦公報 API 為開放使用。需要連線至這些 API 的網路,並會在 ~/.cache/cfr-mcp 寫入磁碟快取,可用 CFR_MCP_CACHE_DIR 變更位置。
安裝前請注意
非官方社群專案,與聯邦公報辦公室、NARA 或 GPO 無關,由個人以現狀維護。eCFR 文本具權威性但非官方,用於法律研究時應與官方 CFR、每日聯邦公報及 LSA 核對。它只回傳法規文本,不構成法律意見,也不包含以引用方式納入的私人標準。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 US Code of Federal Regulations,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

cfr-mcp

[CI] [PyPI]

An MCP server that gives AI assistants access to the US Code of Federal Regulations.

Ask "what does 21 CFR 101.9 require?" or "has 40 CFR 261 changed since 2023?" and get the actual regulation text, with citations, instead of a plausible-sounding guess.

Unofficial community project. Not affiliated with or endorsed by the Office of the Federal Register, NARA, or GPO, and uses no government seals or logos.

Maintained by one person as a personal project and provided as-is (MIT). Issues and pull requests are welcome but may not get a quick response. To report a security issue, see SECURITY.md.

Install

Requires Python 3.11+. No API key — the eCFR and Federal Register APIs are open.

Claude Code:

bash
claude mcp add cfr -- uvx cfr-mcp

Any other MCP client:

json
{  "mcpServers": {    "cfr": {      "command": "uvx",      "args": ["cfr-mcp"]    }  }}

Tools

ToolWhat it does
lookup_citationText of a citation — 21 CFR 101.9, 40 CFR 261.4(b)(1), 40 CFR Part 261 Subpart C
search_regulationsFull-text search; returns citations and snippets, never bodies
where_does_term_appearWhich titles contain a term, with hit counts. Fetches no text
browse_structureThe hierarchy of a title or part, no text
what_changedAmendment history for a citation, linking each change to the Federal Register rule that caused it, plus published corrections
compare_versionsDiff of a citation's text between two dates — see exactly what an amendment changed
list_agenciesMaps agency names to the CFR titles they administer

Point-in-time works throughout: pass date as YYYY-MM-DD to read the CFR as it stood.

Design notes

Context budget is the whole game. The eCFR full endpoint returns an entire downloadable XML document for a title-level request. Every tool here caps output and degrades to an outline rather than dumping text into the model's context. Title-level XML requests are refused outright.

Dates must be resolved, not assumed. Versioner routes 404 on dates that aren't valid issue dates for a title, so the client resolves through titles.json first rather than passing today's date blindly.

Caching is courtesy. The eCFR publishes no rate limit and has no key to identify callers politely, so the client caches to disk (historical dates forever, since point-in-time content is immutable) and self-limits concurrency. The cache lives in ~/.cache/cfr-mcp (respects XDG_CACHE_HOME); set CFR_MCP_CACHE_DIR to relocate it.

Legal

Regulation text is free to reproduce. 1 CFR 2.6 states that any person may reproduce or republish material appearing in the Federal Register, with no restrictions on what is reproduced, who reproduces it, or where. Federal government works are also outside copyright under 17 U.S.C. §105.

Incorporation by reference. Some CFR sections incorporate private standards (ASTM, NFPA, ASHRAE) whose copyright status after incorporation remains unsettled. The eCFR does not contain the text of those standards and neither does this server — it returns the citation only. Obtain standards from the issuing organization or the Office of the Federal Register reading room.

Status of the text. The eCFR is authoritative but unofficial. Anyone relying on it for legal research should verify against the current official CFR, the daily Federal Register, and the List of CFR Sections Affected (LSA).

Not legal advice. This is a retrieval tool. It returns the text of regulations; it does not tell you whether you are compliant with them.

Development

bash
uv sync --extra devuv run pytest

MIT licensed.

來源:README.md,提交 6a03cc8

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.2.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Regulations 整合