ecfr-mcp
ecfr-mcp
eCFR(전자 연방 규정집, Electronic Code of Federal Regulations) API용 MCP 서버입니다. 인증 없이 FAR, DFARS 그리고 모든 기관의 FAR 보충 규정 텍스트를 읽을 수 있습니다.
독립 실행형 MCP 사용은 스스로 유지 관리해야 하는 고급 방식입니다. 패키징된 에이전트는 유지 관리되는 초보자용 경로입니다.
실제 eCFR API를 대상으로 한 6차례의 통합 테스트를 거쳐 테스트 및 보강되었습니다. 295개의 회귀 테스트(오프라인 182개, 라이브 연동 게이트 113개)는 2개의 P0 치명적 버그, 26개의 P1 잘못된 데이터를 조용히 반환하는 버그, 32개의 P2 검증 공백, 그리고 6차 감사 수정 사항(타이틀 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: mcp-ecfr
인증 불필요
eCFR API는 완전히 공개되어 있습니다. API 키, 등록, 인증 헤더가 필요 없습니다. 그냥 설치하고 사용하면 됩니다.
설치
uvx로 설치(권장)
uvx ecfr-mcppip로 설치
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(제안 평가)의 현재 텍스트를 가져와 요구 사항을 요약해 주세요."
"FAR Part 19(중소기업 프로그램)의 모든 섹션을 나열해 주세요."
"2.101에서 '상업 제품(commercial product)'의 FAR 정의를 찾아 보세요."
"지난 6개월 동안 개정된 FAR 섹션은 무엇인가요?"
"FAR 52.212-4를 2024-01-01과 2025-01-01 사이의 버전과 비교하고 변경된 사항을 보여주세요."
"DFARS 252.227-7014(비상업용 컴퓨터 소프트웨어에 대한 권한)의 현재 텍스트를 가져와 주세요."
"타이틀 48에서 '조직적 이해관계 충돌(organizational conflict of interest)'을 검색하고 관련 섹션을 보여주세요."
"타이틀 48에서 챕터 8은 어느 기관 소유인가요? 해당 기관의 FAR 보충 규정 구조를 가져와 주세요."
설계 참고 사항
XML은 서버에서 구문 분석됩니다. eCFR 콘텐츠 엔드포인트는 원시 XML을 반환합니다. 이 서버는 모델에 반환하기 전에 이를 깨끗한 텍스트(제목, 단락, 인용)로 구문 분석하여 컨텍스트 토큰을 크게 절약합니다.
날짜 자동 해석. 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 |
데이터 소스
모든 데이터는 미국연방규정청(Office of the Federal Register)이 운영하는 지속적으로 업데이트되는 온라인 연방 규정집인 ecfr.gov에서 가져옵니다. 매일 업데이트되며 일반적으로 Federal Register 게재 후 영업일 기준 1~2일 후에 반영됩니다. 공식 법적 판본은 아닙니다. 공식 인용은 GPO의 연례 CFR을 참조하세요.
소속
federal-contracting-mcps: 연방 조달 데이터용 MCP 서버 9개의 모노레포. federal-contracting-skills와 함께 사용합니다.
요청 페이싱
모든 업스트림 요청은 기본적으로 임시적인 3초 크로스프로세스 안티버스트 간격을 사용합니다. eCFR은 수치 한도를 밝히지 않기 때문에 이는 제공업체 요구 사항이 아닌 1102tools차원의 안전 장치입니다. FEDERAL_API_MIN_INTERVAL_SECONDS로 설정을 변경할 수 있으며, 0으로 두면 의도적으로 비활성화되고, FEDERAL_API_PACING_DIR을 사용해 로컬 페이싱 상태를 다른 위치로 옮길 수 있습니다.
라이선스
MIT
Available Tools
13 toolscompare_versionsARead-onlyInspect
Compare the text of a CFR section at two different dates.
Useful for understanding what changed in a regulatory amendment. Returns 'changes' (each paragraph that was added, removed or changed, with its before and after text; also heading, table and pending-amendment-link changes), 'identical' when nothing differs, and the parsed text at both dates side by side. When both texts together are too long to send, the full texts are left out (texts_omitted) and 'changes' is kept. changes_only=True leaves the full texts out every time: the short answer to "what changed".
Dates must be in YYYY-MM-DD format. Historical snapshot availability varies by title and section, including some dates before 2017. Use get_version_history to discover dates. Both dates must not exceed the title's up_to_date_as_of value.
This tool always returns the section-level XML parsed -- pass a small section_id like '15.305', not a whole part. Whole-part comparisons can exceed 100 KB per side.
Inputs: date_after (required), section_id (required), date_before (required), chapter, +2 more. Returns: object
find_far_definitionARead-onlyInspect
Find a term's definition in FAR 2.101, the FAR's main definitions section.
Returns each matching definition whole (the defining paragraph and every sub-paragraph under it), first, marked kind='definition'. Matching ignores case, hyphens, spacing, plurals, a trailing "means", and the acronym 2.101 puts in a name, so 'service-disabled veteran-owned small business concern', 'SDVOSB concern', 'COTS', 'commercial services' and 'contract means' all find their definitions. Other 2.101 paragraphs that use the term (whole words only) follow as kind='mention', each naming the definition it sits in.
When 2.101 doesn't define the term, the tool searches the rest of the FAR (chapter 1), then the DFARS (chapter 2), for "" means and returns where it is defined, with the definition text, under defined_elsewhere (for example 19.001 and 52.219-14 for 'similarly situated entity'; 204.7301 for 'covered defense information'), plus did_you_mean suggestions from 2.101.
term must be at least 3 characters. max_matches caps the number of matches returned (default 20, max 100); definitions are never cut, and truncated says whether mentions were left out.
Inputs: term (required), date, max_matches. Returns: object
find_recent_changesARead-onlyInspect
Find CFR sections changed since a given date, removals included.
Built on eCFR's version history: every version issued on or after since_date, newest first. Each change says whether the section was amended, removed (change='removed'), or re-issued with no text change (substantive=false). 'summary' counts each kind. A section changed twice appears twice.
since_date must be in YYYY-MM-DD format. Filter with title (default 48), chapter (Title 48: 1 = FAR, 2 = DFARS, 99 = CAS) or part. per_page (default 100, max 5000) and page step through long lists; total_pages says how many pages there are.
Common pattern: find FAR changes since a specific date to check for regulatory updates that might affect ongoing acquisitions.
Inputs: since_date (required), page, part, title, +2 more. Returns: object
get_ancestryBRead-onlyInspect
Get the breadcrumb hierarchy path for a section, part, or appendix.
Returns ancestors from title down to the target node: title > chapter > subchapter > part > subpart > section. Useful for understanding where a section sits in the CFR hierarchy and what regulation it belongs to.
part/subpart/section/appendix accept int or string. The answer says which date it describes.
Inputs: date, part, section, subpart, +2 more. Returns: object
get_cfr_contentARead-onlyInspect
Get the full text of a CFR section, subpart, part, or appendix.
Returns parsed clean text by default: heading, paragraphs and citations, plus tables, notes, examples, images, pending_amendments and editorial_notes when present. Tables, notes and examples are numbered, and a marker like "[See table 1: ...]" sits in the paragraphs where each appears. [fn N] marks a footnote reference. pending_amendments means eCFR links a published amendment that may not be in effect yet. A subpart, part or appendix request returns one object per section under 'sections', each with its own section number and heading. Set raw_xml=True to get the original XML instead.
Answers longer than about 60,000 characters come in pages: the reply says page and total_pages, and page=2 (and so on) returns the rest.
Specify the narrowest scope possible to keep responses manageable:
section='15.305' for a single FAR section
subpart='15.3' for a subpart
part='15' for an entire part (can be large)
chapter='1' for an entire chapter (often >1 MB, avoid)
appendix='Appendix A to Chapter 2' (with chapter='2') for a DFARS appendix
Date auto-resolves to the latest available if not provided. Do NOT use today's date directly -- eCFR lags 1-2 business days and today often 404s.
Title 48 = FAR/DFARS. Chapter 1 = FAR (Parts 1-99), Chapter 2 = DFARS (Parts 200-299). Other chapters = agency FAR supplements (GSAR, VAAR, HSAR, etc.).
For DFARS clauses, use chapter='2' (e.g., section='252.227-7014').
part/subpart/section accept int or string. Common prefix mistakes like section='FAR 15.305' or '48 CFR 15.305' are stripped automatically, and trailing paragraph cites like section='15.305(a)(2)' resolve to the base section '15.305'.
Inputs: date, page, part, chapter, +5 more. Returns: object
get_cfr_structureARead-onlyInspect
Get the hierarchical table of contents for a CFR title or subset.
Returns a nested tree of titles, chapters, parts, subparts, and sections with identifiers, descriptions, and byte sizes, plus the date it describes.
IMPORTANT: Does NOT support section-level filtering (returns 400). Use part or subpart, then walk the children to find sections.
Common patterns:
part='15' for FAR Part 15 structure
subpart='15.3' for just that subpart's sections
chapter='1', depth=2 for the FAR's subchapters and parts only
appendix='Appendix A to Part 200' with part='200' (title 2) for one appendix
depth keeps that many levels below the node asked for (part='19', depth=1 gives Part 19's subparts); deeper levels are replaced by 'children_omitted' (how many there were). For the sections of one part, list_sections_in_part is shorter. A tree too large to send at once (a whole chapter is about 1 MB) is cut to the deepest depth that fits, and 'note' says so.
subchapter needs chapter in Title 48 (each chapter has its own subchapter A, B, ...). part/subpart/chapter/appendix accept int or string.
Inputs: date, part, depth, chapter, +4 more. Returns: object
get_correctionsARead-onlyInspect
Get editorial corrections for a CFR title, newest first.
Returns corrections with CFR references, corrective actions, error dates, and FR citations, sorted by the date the error was corrected, newest first. Useful for checking whether a section's current text has been corrected since its last amendment.
section (e.g. '52.204-21'), part (e.g. '52') or chapter (e.g. '2' for the DFARS) keeps only corrections that touch it. since_year keeps corrections with year >= since_year. limit caps how many are returned (default 50, max 1000); truncated says whether older ones were left out. Title 48 has ~280 corrections since 2005.
Inputs: part, limit, chapter, section, +2 more. Returns: object
get_latest_dateARead-onlyInspect
Get the most recent available date for a CFR title.
CRITICAL: eCFR lags 1-2 business days behind the Federal Register. Using today's date on versioner endpoints causes 404 errors. Call this first to get the safe date, then pass it to other tools.
Default title 48 = Federal Acquisition Regulations System (FAR, DFARS, and all agency supplements). Other common titles: 2 (Grants/Agreements), 5 (Administrative Personnel), 29 (Labor), 41 (Public Contracts).
Raises ValueError for titles 1-50 that are reserved (no content).
Inputs: title_number. Returns: object
get_version_historyARead-onlyInspect
Get the version history of a CFR section, subpart, or part.
Returns content_versions (each with date, amendment_date, issue_date, identifier, name, substantive and removed), every version eCFR lists: all of eCFR's pages are read, so Part 52's 2,264 versions are all there. Versions are grouped by section, oldest first.
since_date/until_date (YYYY-MM-DD) keep versions dated in that range. per_page (default 200, max 1000) and page step through long histories; total_count and total_pages say how many there are.
'substantive' is eCFR's flag: true when the version's text differs from the one before, including editorial edits such as citation fixes and the "Link to an amendment published at ..." notice eCFR adds when a rule is published; false when re-issued with no text change. To see what actually changed, use compare_versions on the dates.
'removed' true means the section was removed on that date.
Version metadata and text snapshots may include dates before 2017. Availability varies by title and section. Use the returned history dates for reads or comparisons; a missing old snapshot produces an availability error. A 2017-01-01 baseline often means unchanged since before 2017.
part/subpart/section accept int or string.
Inputs: page, part, section, subpart, +4 more. Returns: object
list_agenciesARead-onlyInspect
List all agencies with their CFR title and chapter references.
Returns agency names, slugs, and which CFR titles/chapters they own. Useful for finding which chapter corresponds to an agency's FAR supplement.
summary_only (default True) strips the children and most of
cfr_references to keep the response compact (~20 KB vs ~100 KB).
References owned by child agencies are merged into the parent row, so
chapter lookups like DFARS (chapter 2, on a DoD child agency) still work
in summary mode. Set False for the full raw payload including children.
Inputs: summary_only. Returns: object
list_sections_in_partARead-onlyInspect
List all sections and appendices in a CFR part with their headings.
Returns 'sections' in order, each {identifier, heading}, with type='appendix' on appendices (2 CFR 200's Appendix I-XII, for example) and reserved=true on reserved sections, plus 'subparts' (each with its heading, section_count and first and last section). Useful for seeing the scope of a part before reading specific sections.
The part number alone is enough: chapter is optional (Title 48 parts are unique: 52 = FAR, 252 = DFARS, 552 = GSAR) and the answer reports the chapter the part is in. subpart (e.g. '52.2') lists one subpart. A list too long to send at once (FAR Part 52 has 680 entries) comes in pages: page and total_pages say where you are; page=2 gets the rest. detail=True adds eCFR's label, size and received_on for each entry (received_on is when eCFR processed the text, not when it was amended; get_version_history has amendment dates).
part_number accepts int or string.
Inputs: part_number (required), date, page, detail, +3 more. Returns: object
lookup_far_clauseARead-onlyInspect
Convenience tool: look up the current text of a FAR, DFARS or FAR supplement section or clause.
Pass a section identifier like '15.305', '52.212-4', '2.101', 'DFARS 252.204-7012' or '552.238-81'. The chapter comes from the number (52.x = FAR, 252.x = DFARS, 552.x = GSAR, 852.x = VAAR, 1852.x = NFS, 3052.x = HSAR), so chapter is optional. Prefixes like 'FAR', 'DFARS', '§' and '48 CFR', en dashes, and trailing paragraph cites such as '(d)(11)(xviii)' are handled.
Auto-resolves the latest available date. Returns parsed clean text with heading, paragraphs and citations, plus tables, notes (such as drafting notes, which are not clause text), examples, images and pending_amendments when present; see get_cfr_content. A clause longer than about 60,000 characters comes in pages: use page=2 and so on.
Common FAR sections: 2.101 (Definitions), 9.104-1 (Responsibility), 15.305 (Proposal Evaluation), 19.502-2 (Small Business Set-Asides), 52.212-4 (Commercial Terms), 52.212-5 (Required Commercial Terms).
Inputs: section_id (required), date, page, chapter. Returns: object
search_cfrARead-onlyInspect
Full-text search across the Code of Federal Regulations.
Returns matching sections with excerpts, headings, scores, and hierarchy.
current_only=True (default) returns only text in effect now. eCFR's own "current" index still lists some superseded and removed versions, so each hit is checked against the section's version history: older copies of a section are dropped, and hits whose text has since been replaced or removed are dropped and listed under current_check ('superseded' with the current version's date, 'removed' with the removal date). Up to 10 parts per page are checked; any hit not checked is marked. current_only=False returns every historical version, so a section amended 5 times appears 5 times.
Search caps at 10,000 total results. Use hierarchy filters (title, chapter, part) to narrow if you hit the cap. chapter/part/subpart/section filters need a title; without one, title 48 is assumed (title_assumed says so). Labels like 'FAR Part 15', 'Subpart 15.3' or '§ 52.212-5' are read as 15, 15.3 and 52.212-5. Most titles other than 48 number chapters in Roman numerals (2 CFR chapter 'II').
order controls result ordering: 'relevance' (default), 'newest_first', 'oldest_first', 'hierarchy', or 'citations'.
agency_slugs filters to one or more agencies (single slug string or a list, e.g. 'defense-acquisition-regulations-system'). Use list_agencies() to find slugs.
last_modified_after/before use YYYY-MM-DD format and filter by the date sections were last amended. Useful for finding recent regulatory changes.
per_page accepts 1 to 5000 (default 20); paginate with page for more.
Inputs: query (required), page, part, order, +9 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Most tools target distinct actions: search, structure, ancestry, version history, recent changes, definitions, corrections, and agency lookup are clearly differentiated. The main overlap is get_cfr_content versus lookup_far_clause, since both retrieve current section/clause text, though lookup_far_clause is framed as a convenience wrapper and the descriptions help distinguish them.
All tool names use snake_case and generally follow an action_scope pattern such as get_cfr_content, get_version_history, list_sections_in_part, find_recent_changes, and compare_versions. The verbs vary by purpose but remain predictable and there is no mixing of naming conventions.
With 13 tools, the server is well-scoped for a read-only CFR/FAR research domain. Each tool covers a meaningful operation such as content retrieval, search, hierarchy, version history, corrections, or agency metadata, without obvious filler.
The surface covers the core needs of CFR research: content retrieval, search, definitions, structure, ancestry, version history, recent changes, corrections, agency mapping, and version comparison. Minor gaps remain, such as no explicit title-listing or broader metadata tool, but the main regulatory workflows are well supported.
Maintenance
Related MCP Connectors
Search, quote and link U.S. federal procurement regulations from official sources.
Source-linked US federal regulations: CFR provision history, obligations, rules, comments.
Federal contracting intel: live SAM.gov solicitations, recompetes, agency spend, FAR/DFARS text.
Live U.S. eCFR search, CFR titles, title structure, recent corrections, and agency CFR chapters.
Related MCP Servers
- FlicenseAqualityCmaintenanceA production-quality MCP server that exposes the official eCFR API as structured tools for AI-driven contract compliance, enabling retrieval of relevant Code of Federal Regulations by clauses extracted from contracts.8-
- AlicenseNot gradedqualityCmaintenanceEnables searching, browsing, and retrieving current US Code of Federal Regulations text—including full-text search across all 50 titles, title structures, and exact section or part wording—via the official eCFR API.74 npmMIT
- AlicenseAqualityBmaintenanceEnables searching and reading the US Code of Federal Regulations through tools that return excerpts, full text, legal citations, and linked source URLs, with read-only, stateless access.3MIT
- AlicenseNot gradedqualityBmaintenanceEnables searching and retrieving U.S. Federal Register documents — final and proposed rules, notices, executive orders, and public inspection filings — plus facet counts, agency listings, open comment deadlines, and FAR/DFARS case histories, through eight tools backed by the keyless public API v1.53 npmMIT