Skip to main content
Glama

ecfr-mcp

MCP サーバ ī. eCFR API... MCPサーバー? Let's provide actual final in Chinese as crafted.# ecfr-mcp

用于 eCFR(Electronic Code of Federal Regulations,美国联邦法规电子版)API 的 MCP 服务器。无需身份验证即可读取 FAR、DFARS 以及所有机构的 FAR 补充法规文本。

直接使用 MCP 服务器是高级用户自行维护的路径;打包智能体是受维护的新手入门路径。

已通过六轮对真实 eCFR API 的集成测试并进行了加固。295 个回归测试(182 个离线,113 个在线门控)覆盖了 2 个 P0 灾难性 bug、26 个 P1 静默错误数据 bug、32 个 P2 校验缺陷,以及第六轮审计修复(第48篇章节白名单、表格提取、附录访问)。完整测试记录见 testing.md

它做什么

将 eCFR API 公开为 13 个 MCP 工具,涵盖法规文本、结构、搜索、版本历史和常见采购工作流:

核心端点

  • get_latest_date - 获取某个 CFR 篇章最新可用日期(在调用其他工具前调用)

  • get_cfr_content - 获取某个节、子部分或部分的已解析法规文本

  • get_cfr_structure - 章节层级目录

  • get_version_history - 某个节或部分的修订历史

  • get_ancestry - 面包屑层级路径

  • search_cfr - 支持层级过滤的全文搜索

  • list_agencies - 所有机构及其 CFR 引用

  • get_corrections - 某一篇章的编辑性更正

工作流便捷功能

  • lookup_far_clause - 一键查询 FAR/DFARS 条款文本(自动解析日期)

  • compare_versions - 两个日期下文本的并排比较

  • list_sections_in_part - 列出 FAR/DFARS 某个部分中的所有节

  • find_far_definition - 在 FAR 2.101 中查找术语定义

  • find_recent_changes - 查找自指定日期以来被修改的节

Related MCP server: regulationsgov-mcp

无需身份验证

eCFR API 完全公开。无需 API 密钥、无需注册、无需认证头。直接安装使用即可。

安装

通过 uvx 安装(推荐)

uvx ecfr-mcp

通过 pip 安装

pip install ecfr-mcp

从源码安装

git clone https://github.com/1102tools-dev/federal-contracting-mcps.git
cd federal-contracting-mcps/servers/ecfr-mcp
pip install -e .

配置

MCP 是一个开放标准,兼容的客户端均可运行此服务器。受维护的 1102tools Agent Setup Guide 涵盖 Codex 和 Claude Code 中打包智能体,这不包括独立服务器配置。请将以下块用作服务器配置定义,并调整其放置位置以适应你的客户端。

{
  "mcpServers": {
    "ecfr": {
      "command": "uvx",
      "args": ["--refresh-package", "ecfr-mcp", "--from", "ecfr-mcp", "ecfr-mcp"]
    }
  }
}

--refresh-package 标志要求 uv 在每次客户端启动服务器时都检查 PyPI 是否有更新版本,从而自动获得修复;如果省略该标志,uv 会一直使用首次缓存的版本。该标志会在启动时增加少许网络时间,因此如果你的平台强制设置了较短 MCP 启动超时,请调大该超时。

重启客户端。ecfr 服务器将出现,并带有 13 个工具。

示例提示

  • “抓取 FAR 15.305 (Proposal Evaluation) 的当前文本并总结其要求。”

  • “列出 FAR Part 19 (Small Business Programs) 中的所有章节。”

  • “在 2.101 中查找 FAR 对 'commercial product' 的定义。”

  • “过去 6 个月哪些 FAR 章节被修订过?”

  • “比较 FAR 52.212-4 在 2024-01-01 和 2025-01-01 之间的文本,并显示变化。”

  • “获取 DFARS 252.227-7014 (Rights in Noncommercial Computer Software) 的当前文本。”

  • “在第 48 篇中搜索 'organizational conflict of interest',并显示相关章节。”

  • “第 48 篇中第 8 章属于哪个机构?获取该机构的 FAR 补充结构。”

设计说明

  • 服务端解析 XML。 eCFR 内容端点返回原始 XML。此服务器会先将 XML 解析为清晰的文本(标题、段落、引文)再返回给模型,从而节省大量上下文 token。

  • 自动解析日期。 eCFR 比 Federal Register 晚 1-2 个工作日。在版本端点使用当天日期会导致 404 错误。所有内容工具都会自动解析到最新可用日期,除非你指定具体日期。

  • 搜索默认获取当前文本。 如果不使用 date=current,eCFR 搜索会返回所有历史版本(包括已被取代的版本)。默认的 current_only=True 可避免重复结果。

  • 结构端点限制。 eCFR 结构端点不支持按节过滤(返回 400)。list_sections_in_part 通过获取该部分的树状结构并遍历来解决此问题。

  • FAR 2.101 优化。 定义节约有 109KB XML。find_far_definition 在服务端解析整个节,仅返回与上下文匹配的段落。

CFR 第48篇快速参考

法规

部分

1

FAR

1-99

2

DFARS

200-299

3

HHSAR

300-399

4

AGAR

400-499

5

GSAR

500-599

6

DOSAR

600-699

7

AIDAR

700-799

8

VAAR

800-899

9

DEAR

900-999

18

NFS

1800-1899

数据来源

所有数据来自 ecfr.gov——由 Office of the Federal Register 维护、持续更新的在线版《美国联邦法规》(CFR)。每日更新,通常比 Federal Register 发布晚 1–2 个工作日。不是正式官方法律版本;如需官方引用,请参考 GPO 发布的年度 CFR。

所属项目

属于 federal-contracting-mcps,后者是面向联邦承包数据的 9 个 MCP 服务器组成的 monorepo。与 federal-contracting-skills 配套使用。

请求节奏控制

每个上游请求默认使用临时的 3 秒跨进程防突发间隔。eCFR 没有公布具体数值限制,因此这是 1102tools 为网络保护所设的安全防护措施,而不是提供方要求。可通过 FEDERAL_API_MIN_INTERVAL_SECONDS 覆盖,设为 0 可以显式关闭,使用 FEDERAL_API_PACING_DIR 可重新定位本地节奏控制状态。

许可

MIT

Install Server
A
license - permissive license
A
quality
A
maintenance

Maintenance

Maintainers
6dResponse time
3dRelease cycle
35Releases (12mo)
Commit activity
Issues opened vs closed

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Federal procurement intelligence toolkit that searches SAM.gov contract opportunities, analyzes agency spending patterns, tracks competitor wins, and monitors small business set-aside programs (8a, HUBZone, SDVOSB, WOSB). 4 tools using SAM.gov and USASpending.gov data.
    2
  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables interaction with the Regulations.gov API to search federal rulemaking dockets, proposed and final rules, public comments, and comment periods. Supports tracking FAR/DFARS case histories and monitoring open comment periods across federal agencies with optional API key authentication for higher rate limits.
  • A
    license
    A
    quality
    A
    maintenance
    The most comprehensive keyless federal-data MCP server. 36 tools for SAM.gov + USAspending + Federal Register + eCFR + Grants.gov. No API key, no registration, no signup. Works in Claude Desktop, Claude Code, Codex CLI, Cursor, Continue, Gemini CLI, and any MCP-aware host.
    30
    100
    142
    5
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    GovToolsPro MCP Server — an MCP server that gives Claude and other AI clients workflow tools for US federal contractors: go/no-go scoring, incumbent intelligence (USAspending + FPDS), teaming-partner search, recompete prediction, Navy NECO lookup, and SAM.gov solicitation retrieval. It returns synthesized decisions rather than raw data, so contractors and capture teams can triage opportunities d
    10
    51
    2
    MIT

View all related MCP servers

Related MCP Connectors

  • SAM.gov contracts and USAspending awards. 4 procurement tools.

  • Search and trace US federal rules across the Federal Register, eCFR, and Regulations.gov.

  • 55 tools for federal/state/local RFPs, awards, vendors, contact graph, contract vehicles, pursuits.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/1102tools-dev/federal-contracting-mcps'

If you have feedback or need assistance with the MCP directory API, please join our Discord server