MCP server for the eCFR (Electronic Code of Federal Regulations) API. Read FAR, DFARS, and all agency FAR supplements.
Project description
ecfr-mcp
MCP server for the eCFR (Electronic Code of Federal Regulations) API. Read FAR, DFARS, and all agency FAR supplement text with no authentication required.
Works with any MCP-compatible client (Claude Desktop, Claude Code, Cursor, Cline, Continue, Zed, etc.).
Tested and hardened through five rounds of integration testing against the live eCFR API. 101 regression tests covering 2 P0 catastrophic bugs, 26 P1 silent-wrong-data bugs, and 32 P2 validation gaps fixed. See TESTING.md for the full testing record.
What it does
Exposes the eCFR API as 13 MCP tools covering regulatory text, structure, search, version history, and common acquisition workflows:
Core endpoints
get_latest_date- Get the most recent available date for a CFR title (call before other tools)get_cfr_content- Get parsed regulatory text for a section, subpart, or partget_cfr_structure- Hierarchical table of contentsget_version_history- Amendment history for a section or partget_ancestry- Breadcrumb hierarchy pathsearch_cfr- Full-text search with hierarchy filterslist_agencies- All agencies with their CFR referencesget_corrections- Editorial corrections for a title
Workflow convenience
lookup_far_clause- One-call FAR/DFARS clause text lookup (auto-resolves date)compare_versions- Side-by-side text comparison at two dateslist_sections_in_part- All sections in a FAR/DFARS partfind_far_definition- Search FAR 2.101 for a term definitionfind_recent_changes- Sections modified since a given date
No authentication required
The eCFR API is fully public. No API key, no registration, no auth headers. Just install and use.
Installation
Via uvx (recommended)
uvx ecfr-mcp
Via pip
pip install ecfr-mcp
From source
git clone https://github.com/1102tools/federal-contracting-mcps.git
cd federal-contracting-mcps/servers/ecfr-mcp
pip install -e .
Claude Desktop configuration
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"ecfr": {
"command": "uvx",
"args": ["ecfr-mcp"]
}
}
}
Restart Claude Desktop. The ecfr server appears in your MCP tools panel with 13 tools.
Example prompts
- "Pull the current text of FAR 15.305 (Proposal Evaluation) and summarize what it requires."
- "List all sections in FAR Part 19 (Small Business Programs)."
- "Look up the FAR definition of 'commercial product' in 2.101."
- "What FAR sections were amended in the last 6 months?"
- "Compare FAR 52.212-4 between 2024-01-01 and 2025-01-01 and show me what changed."
- "Get the current text of DFARS 252.227-7014 (Rights in Noncommercial Computer Software)."
- "Search Title 48 for 'organizational conflict of interest' and show me the relevant sections."
- "Which agency owns Chapter 8 in Title 48? Get their FAR supplement structure."
Design notes
- XML parsed server-side. The eCFR content endpoint returns raw XML. This server parses it into clean text (headings, paragraphs, citations) before returning to Claude, saving significant context tokens.
- Automatic date resolution. eCFR lags 1-2 business days behind the Federal Register. Using today's date on versioner endpoints causes 404 errors. All content tools auto-resolve to the latest available date unless you specify one.
- Search defaults to current text. Without
date=current, eCFR search returns ALL historical versions including superseded. Defaultcurrent_only=Trueprevents duplicate results. - Structure endpoint limitation. The eCFR structure endpoint does not support section-level filtering (returns 400).
list_sections_in_partworks around this by fetching the part structure and walking the tree. - FAR 2.101 optimization. The definitions section is ~109KB of XML.
find_far_definitionparses the full section server-side and returns only matching paragraphs with context.
CFR Title 48 quick reference
| Chapter | Regulation | Parts |
|---|---|---|
| 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 |
Data source
All data from ecfr.gov, the continuously updated online Code of Federal Regulations maintained by the Office of the Federal Register. Updated daily, typically 1-2 business days after Federal Register publication. Not an official legal edition; for official citations reference the annual CFR from GPO.
Companion skill
This MCP mirrors the ecfr-api skill from 1102tools.com. The skill is markdown-based for interactive Claude use; the MCP wraps the same API as deterministic tool calls for agent workflows and automation.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ecfr_mcp-0.2.5.tar.gz.
File metadata
- Download URL: ecfr_mcp-0.2.5.tar.gz
- Upload date:
- Size: 94.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66962ba73f3d6963bc3b419be36d39f7648611f34136d1ead0cc6ccbc414c873
|
|
| MD5 |
474ed7bc7187636e7d633ffdde073b0f
|
|
| BLAKE2b-256 |
2e421e15356dbfa45d68cfd938e5875eec5d0cec7f5ceb7886cf229b36ba261d
|
Provenance
The following attestation bundles were made for ecfr_mcp-0.2.5.tar.gz:
Publisher:
publish-pypi.yml on 1102tools/federal-contracting-mcps
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ecfr_mcp-0.2.5.tar.gz -
Subject digest:
66962ba73f3d6963bc3b419be36d39f7648611f34136d1ead0cc6ccbc414c873 - Sigstore transparency entry: 1361406643
- Sigstore integration time:
-
Permalink:
1102tools/federal-contracting-mcps@4d537cba0cb12c725e6c7b3c14ecfd980eb4fb1f -
Branch / Tag:
refs/tags/v0.1.13 - Owner: https://github.com/1102tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@4d537cba0cb12c725e6c7b3c14ecfd980eb4fb1f -
Trigger Event:
push
-
Statement type:
File details
Details for the file ecfr_mcp-0.2.5-py3-none-any.whl.
File metadata
- Download URL: ecfr_mcp-0.2.5-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5d26facc54fa5e679b45c3cbb55e647ba7edc15ea2488b7b5c5050a54f36676
|
|
| MD5 |
14f67eda44dc1752f542b039bd42960f
|
|
| BLAKE2b-256 |
ea176fa83eab145e5fadac85fc2821b77da6f4534f507ebccb15618ace79594c
|
Provenance
The following attestation bundles were made for ecfr_mcp-0.2.5-py3-none-any.whl:
Publisher:
publish-pypi.yml on 1102tools/federal-contracting-mcps
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ecfr_mcp-0.2.5-py3-none-any.whl -
Subject digest:
a5d26facc54fa5e679b45c3cbb55e647ba7edc15ea2488b7b5c5050a54f36676 - Sigstore transparency entry: 1361406647
- Sigstore integration time:
-
Permalink:
1102tools/federal-contracting-mcps@4d537cba0cb12c725e6c7b3c14ecfd980eb4fb1f -
Branch / Tag:
refs/tags/v0.1.13 - Owner: https://github.com/1102tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@4d537cba0cb12c725e6c7b3c14ecfd980eb4fb1f -
Trigger Event:
push
-
Statement type: