Skip to main content

cfr-mcp

CI PyPI

An MCP server that gives AI assistants access to the US Code of Federal Regulations.

Ask "what does 21 CFR 101.9 require?" or "has 40 CFR 261 changed since 2023?" and get the actual regulation text, with citations, instead of a plausible-sounding guess.

Unofficial community project. Not affiliated with or endorsed by the Office of the Federal Register, NARA, or GPO, and uses no government seals or logos.

Install

Requires Python 3.11+. No API key — the eCFR API is open.

Claude Code:

claude mcp add cfr -- uvx cfr-mcp

Any other MCP client:

{
  "mcpServers": {
    "cfr": {
      "command": "uvx",
      "args": ["cfr-mcp"]
    }
  }
}

Tools

Tool What it does
lookup_citation Text of a citation — 21 CFR 101.9, 40 CFR 261.4(b)(1), 40 CFR Part 261 Subpart C
search_regulations Full-text search; returns citations and snippets, never bodies
where_does_term_appear Which titles contain a term, with hit counts. Fetches no text
browse_structure The hierarchy of a title or part, no text
what_changed Amendment history and published corrections for a citation
list_agencies Maps agency names to the CFR titles they administer

Point-in-time works throughout: pass date as YYYY-MM-DD to read the CFR as it stood.

Design notes

Context budget is the whole game. The eCFR full endpoint returns an entire downloadable XML document for a title-level request. Every tool here caps output and degrades to an outline rather than dumping text into the model's context. Title-level XML requests are refused outright.

Dates must be resolved, not assumed. Versioner routes 404 on dates that aren't valid issue dates for a title, so the client resolves through titles.json first rather than passing today's date blindly.

Caching is courtesy. The eCFR publishes no rate limit and has no key to identify callers politely, so the client caches to disk (historical dates forever, since point-in-time content is immutable) and self-limits concurrency. Set CFR_MCP_CACHE_DIR to relocate the cache.

Legal

Regulation text is free to reproduce. 1 CFR 2.6 states that any person may reproduce or republish material appearing in the Federal Register, with no restrictions on what is reproduced, who reproduces it, or where. Federal government works are also outside copyright under 17 U.S.C. §105.

Incorporation by reference. Some CFR sections incorporate private standards (ASTM, NFPA, ASHRAE) whose copyright status after incorporation remains unsettled. The eCFR does not contain the text of those standards and neither does this server — it returns the citation only. Obtain standards from the issuing organization or the Office of the Federal Register reading room.

Status of the text. The eCFR is authoritative but unofficial. Anyone relying on it for legal research should verify against the current official CFR, the daily Federal Register, and the List of CFR Sections Affected (LSA).

Not legal advice. This is a retrieval tool. It returns the text of regulations; it does not tell you whether you are compliant with them.

Development

uv sync --extra dev
uv run pytest

MIT licensed.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cfr_mcp-0.1.0.tar.gz (216.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cfr_mcp-0.1.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file cfr_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: cfr_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 216.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for cfr_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6a89d9aae4a7e9d5241536173c9801e97b3e2a243fc10eff055538c35f2e18a0
MD5 0b54c0f203d93584995120ce49d6afa0
BLAKE2b-256 495a1391ccefd24cb00467df57bf309911bc0ac2787dc12c6082ccf805e8c3c6

See more details on using hashes here.

File details

Details for the file cfr_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cfr_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for cfr_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78eeaaac7e0b4d88617d6eb3c3c3c8b49551d82b98b1558978ea9e851039d056
MD5 fcc90328577e183123bae05b8ab69b47
BLAKE2b-256 0767fa91c272da0aa096b9ce9328b10adb96e83aa2b81cc64de06194021aa2b8

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

This release

0.1.0 This release

2 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