Skip to main content

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.

Connect through the published ChatGPT plugin below, or use the installation and configuration instructions for another compatible MCP client.

Tested and hardened through six rounds of integration testing against the live eCFR API. 295 regression tests (182 offline, 113 live-gated) covering 2 P0 catastrophic bugs, 26 P1 silent-wrong-data bugs, 32 P2 validation gaps, and the round-6 audit fixes (Title 48 chapter whitelist, table extraction, appendix access). See testing.md for the full testing record.

Available in ChatGPT

Install eCFR in ChatGPT

This MCP is also available as a published plugin in the ChatGPT directory. Open the listing to install and connect it; no user API key or local Python setup is required. Then try a matching prompt. Prompts that combine sources require every listed MCP to be connected.

The installation and configuration sections below cover direct setup in other compatible MCP clients.

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 part
  • get_cfr_structure - Hierarchical table of contents
  • get_version_history - Amendment history for a section or part
  • get_ancestry - Breadcrumb hierarchy path
  • search_cfr - Full-text search with hierarchy filters
  • list_agencies - All agencies with their CFR references
  • get_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 dates
  • list_sections_in_part - All sections in a FAR/DFARS part
  • find_far_definition - Search FAR 2.101 for a term definition
  • find_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. Default current_only=True prevents duplicate results.
  • Structure endpoint limitation. The eCFR structure endpoint does not support section-level filtering (returns 400). list_sections_in_part works around this by fetching the part structure and walking the tree.
  • FAR 2.101 optimization. The definitions section is ~109KB of XML. find_far_definition parses 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.

Request pacing and cache

JSON requests can start every 0.6 seconds, with a shared safety budget of 500 upstream attempts per rolling five minutes and at most two requests in flight. Uncached XML remains serialized with at least three seconds after completion. XML waiting does not hold up JSON work. These are 1102tools safeguards, not published agency quotas or guaranteed tool-call throughput.

Repeated XML requests with the same date, path and filters use a five-minute in-memory cache. Concurrent duplicate requests are coalesced. The cache stores only valid XML, at most 128 entries and 32 MiB total, with a 2 MiB per-entry limit. Errors are not cached. New dates and changed filters use separate keys; upstream corrections may take up to five minutes to appear in a cached result. Restarting the process clears the cache.

Local processes sharing FEDERAL_API_PACING_DIR share upstream pacing state. The hosted service's budget is shared by its users; other services have their own budgets. Its separate HTTP entrance limit is 120 requests per minute per IP and Cloudflare location, including protocol traffic. A tool can make more than one upstream request, or none when XML is cached.

FEDERAL_API_MIN_INTERVAL_SECONDS can slow requests. Positive values below 0.6 are clamped for the shared pacer; uncached XML always retains its minimum three-second completion gap. Explicit zero disables pacing for offline tests or externally managed clients. Hosted deployments use 0.6. Failed and cancelled attempts stay counted; Retry-After cooldowns are shared. Container replacement can reset on-disk pacing history. Upgrade local processes together rather than sharing a state directory between old and new implementations.

License

MIT

Metadata

Release files for ecfr-mcp 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ecfr-mcp 1.0.9
File Size Uploaded
ecfr_mcp-1.0.9.tar.gz 149.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ecfr-mcp 1.0.9
File Interpreter ABI Platform
ecfr_mcp-1.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 179.1 kB

Release files / ecfr_mcp-1.0.9.tar.gz

Download URL ecfr_mcp-1.0.9.tar.gz
Size 149.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ad155730083f16ebd4db272902a83430c1e76132b3a839427a8596d83cc64c3a
BLAKE2b-256 checksum
How to use checksums
f91e7dc3d648cfa2c54a57cbb11ab0df2ac1adde1b4ab6272c216a715f80f50d
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 Sep 13, 2026.

Transparency log

Release files / ecfr_mcp-1.0.9-py3-none-any.whl

Download URL ecfr_mcp-1.0.9-py3-none-any.whl
Size 29.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
902a47cf49e5a1ea94280e1605b0fff9909830934aaaf4d7547b6bf685eeb5b2
BLAKE2b-256 checksum
How to use checksums
06b88697272cee1324de7bcec53fa1ed3877b0c72293049cceebcda14b65b011
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 Sep 13, 2026.

Transparency log

Release history Release notifications | RSS feed

1.1.10

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.10

2 release files

This release

1.0.9 This release

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page