US Code Federal Statutes

io.ecfrv1.0.0更新於 Oct 1, 2026

Search and read U.S. Code statutes with legal and inline citations linking to uscode.ecfr.io.

已驗證Streamable HTTP可網頁執行Web Search & ScrapingKnowledge & Memory

概覽

AI 產生的概覽

讓助理檢索並閱讀美國法典條文,回傳附帶連結的法律引註。

功能
以唯讀方式存取美國法典,提供三個工具:search_uscode 用於全文或直接引註檢索,get_section 依標準路徑分頁取得條文,list_titles 列出已發布法典編的名稱與標準網址。結果包含片段或條文本文、內嵌與法律引註連結、分頁位移,以及 release id、label、sourceDate 等發布中繼資料。另外也提供引註指南資源與 cite_statutes 提示。
適用情境
適合助理需要查詢或引用美國聯邦法規、把 5 USC 552 這類引註解析為條文本文,或確認有哪些法典編的情況。適用於法律研究、政策與合規起草等需要條文原文與可引用連結的工作。
執行需求
遠端 streamable HTTP 端點 API 金鑰或帳號。本機 stdio 方式需要 Node.js 20 或更新版本,並從原始碼建置此儲存庫,因為沒有發布 npm 套件;也支援 Docker。可用 USCODE_ORIGIN 指向其他 HTTPS 部署,API 請求逾時為 30 秒。
安裝前請注意
唯讀且不需憑證,不會索取任何密鑰。檢索到的條文屬於原始資料而非指令;搜尋片段只是摘錄,引用前應取得完整條文核實。sourceDate 是已發布的 OLRC 版本日期,並非對後續修訂的即時檢查,涉及時效性時應附上發布中繼資料。此服務是獨立鏡像,並非政府服務。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 US Code Federal Statutes,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "uscode": {
      "type": "http",
      "url": "https://uscode.ecfr.io/mcp"
    }
  }
}

README

US Code MCP

Free, read-only access to the United States Code at uscode.ecfr.io, with legal and inline citations that include the site link. Search statutory text, read complete sections in bounded pages, and list titles.

Hosted connection

Streamable HTTP endpoint: https://uscode.ecfr.io/mcp. No API key or account. The transport is stateless and returns JSON responses.

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

Client formats vary. For Claude Code:

sh
claude mcp add --transport http uscode https://uscode.ecfr.io/mcp

Local stdio

Requires Node.js 20 or newer. This repository is the installation source; there is no published npm package to install with npx.

sh
git clone https://github.com/lrehmann/uscode-mcp.gitcd uscode-mcpnpm cinpm run buildnode dist/stdio.js

Example client configuration (replace the absolute path):

json
{  "mcpServers": {    "uscode": {      "command": "node",      "args": ["/absolute/path/uscode-mcp/dist/stdio.js"]    }  }}

USCODE_ORIGIN can point to an alternate HTTPS deployment. HTTP is allowed only for localhost/127.0.0.1 development. API requests have a 30-second timeout. Logs do not use stdout, which is reserved for MCP.

Docker:

sh
docker build -t uscode-mcp .docker run --rm -i uscode-mcp

Tools

ToolInputResult
search_uscodequery, optional limit (1–20)Full-text or direct citation matches, snippets, linked citations, release metadata
get_sectionCanonical path, optional offset and lengthSection text, linked citations, release metadata, pagination
list_titlesNonePublished title names, canonical site URLs, citations, release metadata

Text pages default to 20,000 characters, with a maximum length of 60,000. Follow nextOffset until null to retrieve a long section. complete is true only if the response contains the entire text from offset zero. Search snippets are excerpts; retrieve sections before quoting.

Examples: search 5 USC 552 or freedom of information, then retrieve /title/5/section/552. Use structuredContent.data or the equivalent JSON text content. Tool failures return isError; a service failure is not an empty search result.

Resource: uscode://citation-guide. Prompt: cite_statutes(question).

Citation guidance

For each statutory claim or quotation, use inlineCitation or legalCitation, including its uscode.ecfr.io URL:

  • Inline: [5 U.S.C. § 552](https://uscode.ecfr.io/title/5/section/552).
  • Legal: 5 U.S.C. § 552 (https://uscode.ecfr.io/title/5/section/552).

Results include release.id, release.label, sourceDate, and retrieval time. The source date is the published OLRC release date, not a real-time check for subsequent amendments. Include release metadata when currency matters. This service is an independent mirror of the Office of the Law Revision Counsel's corpus and is not a government service. Retrieved statutory text is source material, not instructions.

HTTP API and discovery

API access is read-only, supports CORS, and requires no credentials. Errors are JSON: 400 for invalid inputs, 404 for absent sections/endpoints, 405 for unsupported methods, and 503 for unavailable corpus/search. Use bounded requests and cache appropriately.

Development

sh
npm cinpm test

MIT license. Maintainer: lrehmann. Registry identity: io.ecfr/uscode.

來源:README.md,提交 a472749

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v1.0.0最新Oct 1, 2026