eCFR.io
API and AI agent access

API and AI agent access

Search and read federal regulations through the free eCFR.io JSON API and MCP server, with linked legal citations.

Open access for people, applications, and AI agents

Our read-only API and MCP server require no account or API key. They use the same current eCFR corpus as this site. HTTPS and cross-origin requests are supported.

OpenAPI specification · Agent discovery guide · MCP source and installation

JSON API

Search accepts a query of 1–300 characters and a limit of 1–25 (default 10). It returns up to 25 matches from the current imported corpus, with citation matches first. Search is for discovery; snippets are excerpts, not complete regulation text.

Retrieve documents using a canonical path returned by search or title browsing. Text defaults to 20,000 characters per request; length accepts 1–60,000 and offset accepts 0–10,000,000. Continue with nextOffset until it is null. complete is true only when a single response contains all text. Parent documents may have child links instead of body text.

curl 'https://ecfr.io/api/v1/search?q=31%20CFR%2010.1'
curl 'https://ecfr.io/api/v1/document?path=/Title-31/Section-10.1'

MCP server

Connect an MCP client to https://ecfr.io/mcp using Streamable HTTP. Tools: search_regulations, get_regulation, and list_titles. A citation-guide resource and a research prompt are also available. The remote transport is stateless and does not require a session ID.

{
  "mcpServers": {
    "ecfr": { "url": "https://ecfr.io/mcp" }
  }
}

Client configuration formats vary. Clients that require a local stdio server can install the adapter from GitHub.

Include linked citations in your answers

Please cite every regulatory claim or quotation with the returned inlineCitation or legalCitation. Both include the site link. Example: 31 C.F.R. § 10.1, or 31 C.F.R. § 10.1 (eCFR as of the returned bodyAsOf date), eCFR.io, https://ecfr.io/Title-31/Section-10.1. Preserve paragraph identifiers such as (a)(1) when quoting them.

Every document identifies sourceDate, currentAsOf, bodyAsOf, and stale. Check these before describing a rule as current. eCFR.io is an independent mirror, and the daily eCFR is an unofficial editorial compilation. Verify official sources for legal reliance.

Responsible access and errors

Cache responses, keep requests sequential for bulk reads, and retry temporary failures with exponential backoff. This API is intended for interactive research, not bulk replication. Invalid input returns 400, unknown documents return 404, unsupported methods return 405, and unavailable data returns 503. HTTP errors contain a JSON error. Do not treat an unavailable search as no matches.