Cpsc Recalls Mcp Server

io.github.cyanheads由 GitHub 帳號 cyanheads 發布v0.3.1更新於 Oct 29, 2026

US consumer product recalls from the CPSC: hazards, remedies, and affected products.

已驗證Streamable HTTP可網頁執行網頁搜尋與抓取商業與電商

概覽

AI 產生的概覽

檢索並取得美國 CPSC 消費品召回資訊——危害、補救措施、受影響產品及官方召回頁面,供 AI 助理使用。

可以做什麼
  • 依標題、產品、品牌、零售商、進口商、經銷商、危害、補救措施或描述關鍵字搜尋召回,支援日期範圍與分頁
  • 依召回編號取得單筆完整紀錄:危害、補救說明、各產品款式、UPC、傷害報告、圖片及官方 CPSC 頁面
  • 依最近 N 天(最多 365 天)取得最新召回清單,依時間由新到舊排序
  • 讀取隨附的指南技能,了解搜尋寫法、召回編號的特殊規則與管轄範圍界線
適用情境
適合查核某項產品、型號或 UPC 是否被召回,梳理某品牌或零售商的召回歷史,或追蹤最新的消費品召回動態;也能協助將不屬於 CPSC 管轄的產品轉介給正確機關。
執行需求
可使用託管的 Streamable HTTP 端點(免安裝、免 API 金鑰),也可透過 npx 在本機執行(需 Node.js),原始碼建置需 Bun v1.4.0 以上。不需要 CPSC API 金鑰;選用環境變數可設定傳輸方式、連接埠、主機、端點路徑、驗證模式、日誌等級與儲存。
安裝前請注意
對公開政府資料集進行唯讀查詢,不涉及憑證或付費。選用設定 LOG_TOOL_FAILURE_PAYLOADS 會記錄失敗工具呼叫的參數,且自由文字中的密鑰不會被遮蔽。結果為轉述的 CPSC 資料,可能有欄位缺漏,會標示於 data_quality_notes。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Cpsc Recalls Mcp Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.cyanheads%2Fcpsc-recalls-mcp-server/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

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

{
  "mcpServers": {
    "cpsc-recalls": {
      "type": "http",
      "url": "https://cpsc-recalls.caseyjhand.com/mcp"
    }
  }
}

README

@cyanheads/cpsc-recalls-mcp-server

Search and retrieve US consumer product recalls from the CPSC (Consumer Product Safety Commission) via MCP. STDIO or Streamable HTTP.

3 Tools • 1 Skill


Overview

Consumer product recalls from the CPSC saferproducts.gov database — toys, electronics, furniture, appliances, children's products, tools, and clothing. Search recalls by product, brand, retailer, or hazard, fetch full detail for a specific recall number, or pull a recent-recalls feed for a date window.

Tools

ToolDescription
cpsc_search_recallsSearch consumer product recalls by title, product name, brand, retailer, importer, distributor, hazard, remedy, or description keyword, with optional date filtering and offset paging
cpsc_get_recallFull detail for a single recall by recall number — hazards, remedy, products, injuries, images, and the official CPSC page
cpsc_get_recentFetch the most recent recalls ordered newest-first, scoped to a configurable date window

Skills

SkillDescription
cpsc-recalls-guideFind and confirm US consumer product recalls with the cpsc_* tools — search formulation, recall-number quirks, and when an empty result proves nothing

CPSC covers consumer products, including some that sit next to another agency's domain: child-resistant packaging for drugs and supplements, ATVs and snowmobiles, bicycle tires, and gun safes and locks. Food and drugs (FDA), on-road vehicles and their tires (NHTSA), boats (USCG), pesticides (EPA), and firearms (ATF) belong to other agencies; every response carries this jurisdiction note.

Capability reference

cpsc_search_recalls tool

  • At least one criterion, combined with AND: nine text filters of up to 500 characters each (title_search, usually the highest-signal, plus product_name, manufacturer, retailer, importer, distributor, description_search, remedy, hazard_search) and two date axes (date_start/date_end for the issue date, updated_start/updated_end for the last CPSC publish date); limit (1–10,000, default 20; a page holds at most 200) and offset page through total_found
  • Each text filter matches every word, in any order, as a case-insensitive substring with no stemming — search a stem (batter finds battery and batteries)
  • Returns the issue and last-published dates, hazards, remedy options and instructions, products, UPCs, manufacturer, importer, retailer, and distributor names, images, cpsc_url, and per-recall data_quality_notes; zero matches is an empty success whose effectiveQuery echoes the criteria and whose notice names the criterion to relax. Failures: missing_criteria, invalid_date_range, upstream_rejected (not retryable), upstream_error (retryable)
  • has_more is the paging signal; a page cut short by the 64,000-byte response budget, or held to 200 under a larger limit, carries a notice with the offset to continue from

cpsc_get_recall tool

  • One recall_number: 5 digits ("25043"), with a letter a–d on some 1998–2001 records ("99003a"); only the record with exactly that number is returned
  • Returns the complete record — nullable description (where model numbers usually live), hazards, remedy options and instructions, every product variant, UPCs, injury narrative, company names by role, country of manufacture, images, coordinated-agency recall URLs, and data_quality_notes
  • Failures: not_found (resolve a number through cpsc_search_recalls or cpsc_get_recent; for the bare base of a lettered family such as 01160, the hint names the separate lettered recalls 01160a, 01160b, 01160c), upstream_rejected (not retryable), upstream_error (retryable)

cpsc_get_recent tool

  • days look-back window (1–365, default 30) anchored to today; limit (1–10,000, default 20; a page holds at most 100) and offset page through total_found, since narrowing days drops the oldest recalls rather than paging. Older recalls are reachable through cpsc_search_recalls date bounds
  • Returns a lightweight record per recall — number, date, title, hazards, remedy types, product names, cpsc_url, data_quality_notes — for cpsc_get_recall to expand; has_more is the paging signal, and an empty window, an offset past the end, a budget-cut page, or a page held to 100 under a larger limit carries a notice. Failures: upstream_rejected (not retryable), upstream_error (retryable)

cpsc-recalls-guide skill

  • Helps an agent check whether a specific product, model, serial, or UPC was recalled, sweep a brand's or retailer's recall history, monitor new or republished recalls for a hazard, and decide whether a product is CPSC's at all
  • Served over MCP as the resource skill://cpsc-recalls-guide/SKILL.md under the template skill://{+path}; also ships in skills/ for plugin installs and the .mcpb bundle

Features

Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.

CPSC-specific:

  • Full client for the CPSC saferproducts.gov public recalls API — search, single-recall detail, and a recent-recalls feed
  • Every-word matching on all nine text filters — each word in any order, as a case-insensitive substring with no stemming, against the plain text the results show — applied over the complete result set before paging so total_found and has_more stay accurate; hazard_search (alias hazard) covers hazard text, product names, and remedy instructions
  • Handles 5-digit recall numbers and the lettered numbers some 1998–2001 records carry, matching the requested number exactly
  • One 50-second budget per call covers every CPSC attempt and retry, so a stalled request ends as a retryable upstream_error before an MCP client's default 60-second timeout
  • Jurisdiction boundary documented in every response — names the drug-packaging, vehicle, tire, and gun-safe products CPSC does recall, and the agencies that own the rest

Agent-friendly output:

  • Provenance on every response — source_note, cpsc_url, and (CPSC source text) blockquote labels distinguish relayed CPSC narrative from the server's own guidance
  • Plain text on both surfaces — the HTML markup and character codes CPSC stores in some records (&amp;, <br>, stray table tags) are converted to plain text before matching and output, and content[] escapes Markdown so model and serial numbers such as 1HFVE05**K4000003 keep every character; recall pages and coordinated recalls render as links, and product images render inline with their captions; HTTP(S) addresses preserve CPSC’s URL values on both surfaces, while other schemes remain visible as text
  • Pagination discriminators — total_found, offset, has_more, and truncated on every search/recent response so agents can tell when results are clipped and page with offset; each surface of a page stays within a 64,000-byte budget, and a notice gives the next offset when the budget or the page ceiling ends a page early; an oversized limit is served at the page ceiling rather than rejected
  • data_quality_notes on every response — gaps observed in the upstream record (missing hazard text, no product entries), derived from which fields CPSC left blank rather than any judgment call
  • Jurisdiction note (cpsc_jurisdiction) on every response — lets agents route callers to the correct agency (FDA, NHTSA, USCG, EPA, ATF) when a product is out of scope

Getting started

Connect to the hosted instance (Streamable HTTP, stateless), no install:

sh
claude mcp add --transport http cpsc-recalls-mcp-server https://cpsc-recalls.caseyjhand.com/mcp

Or run it locally:

sh
claude mcp add cpsc-recalls-mcp-server -- npx -y @cyanheads/cpsc-recalls-mcp-server

For other clients, add this to the MCP config file:

json
{  "mcpServers": {    "cpsc-recalls-mcp-server": {      "command": "npx",      "args": ["-y", "@cyanheads/cpsc-recalls-mcp-server"]    }  }}

No API key is required — the CPSC public recalls API is freely accessible. For Docker or a source build, see Running the server.

Configuration

All configuration is validated at startup via Zod schemas. Key environment variables:

VariableDescriptionDefault
MCP_TRANSPORT_TYPETransport: stdio or httpstdio
MCP_HTTP_PORTHTTP server port3010
MCP_HTTP_HOSTHTTP server host127.0.0.1
MCP_HTTP_ENDPOINT_PATHHTTP endpoint path/mcp
MCP_PUBLIC_URLPublic origin for TLS-terminating reverse-proxy deployments—
MCP_SESSION_MODESession handling: auto, stateful, or stateless. The server declares stateless in src/index.ts; setting this overrides it.stateless
MCP_AUTH_MODEAuthentication: none, jwt, or oauthnone
MCP_LOG_LEVELLog level (debug, info, warning, error)info
LOGS_DIRDirectory for log files (Node.js only)<project-root>/logs
LOG_TOOL_FAILURE_PAYLOADSLog each failed tool call's arguments and result, redacted by key name and capped at LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES (default 16384). A secret inside a free-form value is not redacted.false
STORAGE_PROVIDER_TYPEStorage backend: in-memory, filesystem, supabase, cloudflare-kv/r2/d1in-memory
OTEL_ENABLEDEnable OpenTelemetryfalse

No server-specific API keys are required. See .env.example for the full list of optional overrides.

Running the server

Local development

Requires Bun v1.4.0 or higher (or Node.js v24+). No API key is needed.

  • Clone and install:

    sh
    git clone https://github.com/cyanheads/cpsc-recalls-mcp-server.gitcd cpsc-recalls-mcp-server && bun installcp .env.example .env   # optional — no required API keys
  • Build and run the production version:

    sh
    # One-time buildbun run rebuild
    # Run the built serverbun run start:stdio# orbun run start:http

    For Streamable HTTP, set the transport and port; the server listens at http://localhost:3010/mcp:

    sh
    MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
  • Run checks and tests:

    sh
    bun run devcheck  # Lint, format, typecheck, securitybun run test      # Vitest test suite

Docker

sh
docker build -t cpsc-recalls-mcp-server .docker run --rm -p 3010:3010 cpsc-recalls-mcp-server

To run the published image over stdio from an MCP client, use "command": "docker" with "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/cpsc-recalls-mcp-server:latest"].

The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/cpsc-recalls-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.

Project structure

DirectoryPurpose
src/index.tscreateApp() entry point — registers tools, serves the published skill from skills/, and inits the CPSC service
skills/cpsc-recalls-guide/SKILL.md, the published agent skill
src/mcp-server/toolsTool definitions (definitions/*.tool.ts) — search, get-recall, get-recent — plus response-budget.ts, the page size budget the two list tools share, and markdown-escape.ts, the escaping applied to CPSC text in content[]
src/services/cpsc-recallCPSC recall service — API client, types, and normalize-text.ts, which converts CPSC's HTML markup and character codes to plain text

Development guide

See CLAUDE.md / AGENTS.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for request-scoped logging, ctx.state for tenant-scoped storage
  • Register new tools in the createApp() arrays in src/index.ts
  • Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields

Contributing

Issues are welcome. Run checks and tests before submitting:

sh
bun run devcheckbun run test

License

Apache-2.0 — see LICENSE for details.

來源:README.md,提交 bc22d27

工具

3

cpsc_search_recalls

Search CPSC Recalls

Search consumer product recalls from the CPSC (Consumer Product Safety Commission) — toys, electronics, furniture, appliances, children's products, tools, and clothing. Give at least one text filter or date bound; to browse the latest recalls without one, use cpsc_get_recent. Filters combine with AND, and a text filter matches records whose field contains every one of its words, in any order — each word as a case-insensitive substring with no stemming, so "fire" also matches fireworks and "battery" misses batteries; search a stem instead ("batter" finds battery and batteries). Start with title_search when you have a product in hand — CPSC titles carry the brand, product, and hazard phrasing. For hazard types ("fire", "choking", "burn"), use hazard_search, which matches hazard descriptions, product names, and remedy instructions. When manufacturer finds nothing, try importer, retailer, or distributor: many recalls name one of those as the responsible company. Page past limit with offset — total_found counts every match and has_more says whether more remain; a page returns fewer than limit recalls when it reaches the 64,000-byte response size budget. Pass a recall_number to cpsc_get_recall for the full record, including the complete description, all images, and incident reports. CPSC jurisdiction: consumer products, including child-resistant packaging for drugs and supplements, ATVs and snowmobiles, bicycle tires, and gun safes and locks; food and drugs (FDA), on-road vehicles and their tires (NHTSA), boats (USCG), pesticides (EPA), and firearms (ATF) belong to other agencies.

輸入參數limitoffsetremedydate_endimporterretailerdate_startdistributorupdated_endmanufacturerproduct_nametitle_search另有 3 個

cpsc_get_recall

Get CPSC Recall Detail

Fetch the full record for one CPSC recall by recall number: hazard description, remedy instructions, every product variant, UPCs, incident and injury reports, images, and the official CPSC recall page URL. Get a recall number from cpsc_search_recalls or cpsc_get_recent. CPSC jurisdiction: consumer products, including child-resistant packaging for drugs and supplements, ATVs and snowmobiles, bicycle tires, and gun safes and locks; food and drugs (FDA), on-road vehicles and their tires (NHTSA), boats (USCG), pesticides (EPA), and firearms (ATF) belong to other agencies.

輸入參數recall_number必填

cpsc_get_recent

Get Recent CPSC Recalls

Fetch the most recent CPSC consumer product recalls, newest-first, from a window of the last N days (default 30, up to 365). Use for "what's been recalled lately?" or a product safety feed; to find recalls by product, brand, hazard, or an older date range, use cpsc_search_recalls. Page past limit with offset: narrowing days cannot page, because the window is anchored to today and shrinking it drops the oldest recalls rather than advancing past the newest. A page returns fewer than limit recalls when it reaches the 64,000-byte response size budget; has_more and the notice give the offset to continue from. Pass a recall_number to cpsc_get_recall for the full record. CPSC jurisdiction: consumer products, including child-resistant packaging for drugs and supplements, ATVs and snowmobiles, bicycle tires, and gun safes and locks; food and drugs (FDA), on-road vehicles and their tires (NHTSA), boats (USCG), pesticides (EPA), and firearms (ATF) belong to other agencies.

輸入參數dayslimitoffset

版本歷史

6
  1. v0.3.1最新Oct 29, 2026
  2. v0.2.3Oct 25, 2026
  3. v0.2.2Oct 8, 2026
  4. v0.2.1Sep 25, 2026
  5. v0.1.8Sep 20, 2026
  6. v0.1.7Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分