ecfr-mcp
Free, open-source MCP server for the eCFR (Electronic Code of Federal Regulations) API. Read FAR, DFARS, and all agency FAR supplement text with no authentication required.
No API key required, locally or hosted. See Local or hosted.
Regression tests, including live checks against the eCFR API and a check that every piece of text in ten saved eCFR responses comes out exactly once and in order. The October 2026 releases were also checked with realistic contracting questions (clause lookups, FAR definitions, version history, recent changes). See testing.md.
Local or hosted
| Local (desktop) | Claude (hosted) | ChatGPT (hosted) |
|---|---|---|
| Local setup | Install | Install |
- Local runs it on your computer, inside the Claude or ChatGPT desktop app or another AI app. You get your own full rate limits, and it relies only on the government service. It doesn't update itself, so ask your AI to update it. You don't have to set it up by hand: give your AI this page's link and ask it to set it up or walk you through it.
- Hosted is always up to date, needs no setup or keys, and works in Claude or ChatGPT anywhere.
Compare local and hosted · Matching prompts
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-dev/federal-contracting-mcps.git
cd federal-contracting-mcps/servers/ecfr-mcp
pip install -e .
Configuration
Use the configuration below as the server definition and adapt its placement to your compatible MCP client. For practical requests using this source, see the prompt library.
{
"mcpServers": {
"ecfr": {
"command": "uvx",
"args": ["--refresh-package", "ecfr-mcp", "--from", "ecfr-mcp", "ecfr-mcp"]
}
}
}
The --refresh-package flag tells uv to check PyPI for a newer release each time your client launches the server, so fixes arrive automatically; without it, uv keeps serving whatever version it first cached. It adds a moment of network time at startup, so raise your platform's MCP startup timeout if it enforces a short one.
Restart the client. The ecfr server appears 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 the model, 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.
Part of
federal-contracting-mcps: monorepo of 9 MCP servers for federal contracting data. Pair these sources with the MCP prompt library.
License
MIT
Metadata
Release files for ecfr-mcp 1.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ecfr_mcp-1.1.9.tar.gz | 294.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ecfr_mcp-1.1.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 354.9 kB
Release files / ecfr_mcp-1.1.9.tar.gz
| Download URL | ecfr_mcp-1.1.9.tar.gz |
|---|---|
| Size | 294.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9619cb8a34b2c39696b3d70e71c85ac7e685a85513bea9c4ea461998640f3aba
|
|
BLAKE2b-256 checksum How to use checksums |
86afb41f45cccec8e93d13c89596d5bc94fcb6854446bd75bd2480054da52081
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.
Transparency logRelease files / ecfr_mcp-1.1.9-py3-none-any.whl
| Download URL | ecfr_mcp-1.1.9-py3-none-any.whl |
|---|---|
| Size | 61.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d6b29c6a8654979f8217c8dc7b6a2ceebfd0a8237c1f687650ed5cd612b010b9
|
|
BLAKE2b-256 checksum How to use checksums |
da519efd1aef7b73aa6c7f4e4b780414b45209b5320b34980bd30b0d4b2ccef7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.
Transparency log