@cyanheads/cpsc-recalls-mcp-server 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/AGENTS.md +372 -0
  2. package/CLAUDE.md +372 -0
  3. package/Dockerfile +99 -0
  4. package/LICENSE +201 -0
  5. package/README.md +266 -0
  6. package/changelog/0.1.x/0.1.0.md +11 -0
  7. package/changelog/0.1.x/0.1.1.md +26 -0
  8. package/changelog/template.md +127 -0
  9. package/dist/index.d.ts +7 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +25 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/mcp-server/tools/definitions/cpsc-get-recall.tool.d.ts +51 -0
  14. package/dist/mcp-server/tools/definitions/cpsc-get-recall.tool.d.ts.map +1 -0
  15. package/dist/mcp-server/tools/definitions/cpsc-get-recall.tool.js +239 -0
  16. package/dist/mcp-server/tools/definitions/cpsc-get-recall.tool.js.map +1 -0
  17. package/dist/mcp-server/tools/definitions/cpsc-get-recent.tool.d.ts +36 -0
  18. package/dist/mcp-server/tools/definitions/cpsc-get-recent.tool.d.ts.map +1 -0
  19. package/dist/mcp-server/tools/definitions/cpsc-get-recent.tool.js +147 -0
  20. package/dist/mcp-server/tools/definitions/cpsc-get-recent.tool.js.map +1 -0
  21. package/dist/mcp-server/tools/definitions/cpsc-search-recalls.tool.d.ts +54 -0
  22. package/dist/mcp-server/tools/definitions/cpsc-search-recalls.tool.d.ts.map +1 -0
  23. package/dist/mcp-server/tools/definitions/cpsc-search-recalls.tool.js +245 -0
  24. package/dist/mcp-server/tools/definitions/cpsc-search-recalls.tool.js.map +1 -0
  25. package/dist/services/cpsc-recall/cpsc-recall-service.d.ts +29 -0
  26. package/dist/services/cpsc-recall/cpsc-recall-service.d.ts.map +1 -0
  27. package/dist/services/cpsc-recall/cpsc-recall-service.js +97 -0
  28. package/dist/services/cpsc-recall/cpsc-recall-service.js.map +1 -0
  29. package/dist/services/cpsc-recall/types.d.ts +86 -0
  30. package/dist/services/cpsc-recall/types.d.ts.map +1 -0
  31. package/dist/services/cpsc-recall/types.js +6 -0
  32. package/dist/services/cpsc-recall/types.js.map +1 -0
  33. package/package.json +101 -0
  34. package/server.json +99 -0
package/README.md ADDED
@@ -0,0 +1,266 @@
1
+ <div align="center">
2
+ <h1>@cyanheads/cpsc-recalls-mcp-server</h1>
3
+ <p><b>Search and retrieve US consumer product recalls from the CPSC (Consumer Product Safety Commission) via MCP. STDIO or Streamable HTTP.</b>
4
+ <div>3 Tools</div>
5
+ </p>
6
+ </div>
7
+
8
+ <div align="center">
9
+
10
+ [![Version](https://img.shields.io/badge/Version-0.1.1-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/cpsc-recalls-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/cpsc-recalls-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/cpsc-recalls-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^5.9.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.0+-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
+
12
+ </div>
13
+
14
+ <div align="center">
15
+
16
+ [![Install in Claude Desktop](https://img.shields.io/badge/Install_in-Claude_Desktop-D97757?style=for-the-badge&logo=anthropic&logoColor=white)](https://github.com/cyanheads/cpsc-recalls-mcp-server/releases/latest/download/cpsc-recalls-mcp-server.mcpb) [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=cpsc-recalls-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvY3BzYy1yZWNhbGxzLW1jcC1zZXJ2ZXIiXX0=) [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22cpsc-recalls-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads%2Fcpsc-recalls-mcp-server%22%5D%7D)
17
+
18
+ [![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-67E8F9?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
19
+
20
+ </div>
21
+
22
+ ---
23
+
24
+ ## Tools
25
+
26
+ 3 tools for searching and retrieving CPSC consumer product recall data:
27
+
28
+ | Tool | Description |
29
+ |:---|:---|
30
+ | `cpsc_search_recalls` | Search consumer product recalls by product name, brand, retailer, importer, or description keyword, with optional date filtering |
31
+ | `cpsc_get_recall` | Full detail for a single recall by recall number — hazards, remedy, products, injuries, images, and the official CPSC page |
32
+ | `cpsc_get_recent` | Fetch the most recent recalls ordered newest-first, scoped to a configurable date window |
33
+
34
+ **CPSC jurisdiction:** Consumer products only — toys, electronics, furniture, appliances, children's products, tools, and clothing. Food and drugs (FDA), motor vehicles and tires (NHTSA), boats (USCG), and pesticides (EPA) are not in this database. Every response includes a jurisdiction note.
35
+
36
+ Data sourced from the [U.S. Consumer Product Safety Commission](https://www.saferproducts.gov/) via the CPSC public recalls API.
37
+
38
+ ### `cpsc_search_recalls`
39
+
40
+ Search recalls with flexible filtering across product, organization, and description fields.
41
+
42
+ - Filter by product name, manufacturer, retailer, importer, or description keyword — all fields are optional substring matches that combine with AND
43
+ - Date range filtering via `date_start` / `date_end` (ISO 8601)
44
+ - Client-side limit (1–200, default 20) applied after fetching all matching records
45
+ - Returns hazard descriptions, remedy options, remedy instructions, product list, UPCs, manufacturer/importer/retailer names, images, and the CPSC recall page URL
46
+ - Includes `total_found` and `truncated` fields for pagination awareness
47
+ - Note: the `Hazard` filter param is non-functional in the upstream API — use `description_search` for hazard-type keywords like "fire", "choking", or "burn"
48
+ - When `manufacturer` returns no results, try `importer` or `retailer` — many recalls list the importer as the primary organization
49
+
50
+ ---
51
+
52
+ ### `cpsc_get_recall`
53
+
54
+ Full detail for a single CPSC recall by recall number.
55
+
56
+ - Accepts modern 5-digit recall numbers (e.g. `"25043"`) and historical 1998–2001 records with letter suffixes (e.g. `"99003a"`)
57
+ - Returns the complete record: full description, all hazard descriptions, remedy type and instructions, all product variants with unit counts, UPCs, incident/injury narrative, manufacturer and importer names, retailer names with sale date ranges, country of manufacture, images, and coordinated agency recall URLs
58
+ - Model numbers are typically embedded in the description text, not in a structured field
59
+ - Use `cpsc_search_recalls` or `cpsc_get_recent` to find a recall number first
60
+
61
+ ---
62
+
63
+ ### `cpsc_get_recent`
64
+
65
+ Fetch the most recent CPSC recalls, ordered newest-first.
66
+
67
+ - Configurable look-back window of 1–365 days (default 30)
68
+ - Limit of 1–100 results (default 20)
69
+ - Always applies a date window — without one, the upstream API returns 9,800+ records
70
+ - Returns a lightweight record per recall: number, date, title, hazards, remedy types, product names, and CPSC URL
71
+ - Use `cpsc_get_recall` to retrieve full detail for any result
72
+
73
+ ## Features
74
+
75
+ Built on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core):
76
+
77
+ - Declarative tool definitions — single file per tool, framework handles registration and validation
78
+ - Unified error handling — handlers throw, framework catches, classifies, and formats
79
+ - Pluggable auth: `none`, `jwt`, `oauth`
80
+ - Swappable storage backends: `in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`
81
+ - Structured logging with optional OpenTelemetry tracing
82
+ - STDIO and Streamable HTTP transports
83
+
84
+ CPSC-specific:
85
+
86
+ - Full integration with the CPSC saferproducts.gov public recalls API
87
+ - Client-side filtering applied over complete API result sets for accurate `total_found` counts
88
+ - Jurisdiction boundary documented in every response — prevents misattribution of food, vehicle, or drug recalls
89
+
90
+ Agent-friendly output:
91
+
92
+ - Jurisdiction note on every response — agents can route callers to the correct agency (FDA, NHTSA, USCG, EPA) when the product is out of scope
93
+ - `total_found` + `truncated` fields on search/recent responses — agents can detect when results are clipped and suggest narrowing filters
94
+ - `cpsc_url` on every recall — authoritative source link for consumer verification
95
+
96
+ ## Getting started
97
+
98
+ Add the following to your MCP client configuration file.
99
+
100
+ ```json
101
+ {
102
+ "mcpServers": {
103
+ "cpsc-recalls": {
104
+ "type": "stdio",
105
+ "command": "bunx",
106
+ "args": ["@cyanheads/cpsc-recalls-mcp-server@latest"],
107
+ "env": {
108
+ "MCP_TRANSPORT_TYPE": "stdio",
109
+ "MCP_LOG_LEVEL": "info"
110
+ }
111
+ }
112
+ }
113
+ }
114
+ ```
115
+
116
+ Or with npx (no Bun required):
117
+
118
+ ```json
119
+ {
120
+ "mcpServers": {
121
+ "cpsc-recalls": {
122
+ "type": "stdio",
123
+ "command": "npx",
124
+ "args": ["-y", "@cyanheads/cpsc-recalls-mcp-server@latest"],
125
+ "env": {
126
+ "MCP_TRANSPORT_TYPE": "stdio",
127
+ "MCP_LOG_LEVEL": "info"
128
+ }
129
+ }
130
+ }
131
+ }
132
+ ```
133
+
134
+ Or with Docker:
135
+
136
+ ```json
137
+ {
138
+ "mcpServers": {
139
+ "cpsc-recalls": {
140
+ "type": "stdio",
141
+ "command": "docker",
142
+ "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/cpsc-recalls-mcp-server:latest"]
143
+ }
144
+ }
145
+ }
146
+ ```
147
+
148
+ For Streamable HTTP, set the transport and start the server:
149
+
150
+ ```sh
151
+ MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
152
+ # Server listens at http://localhost:3010/mcp
153
+ ```
154
+
155
+ ### Prerequisites
156
+
157
+ - [Bun v1.3.0](https://bun.sh/) or higher (or Node.js v24+).
158
+ - No API key required — the CPSC public recalls API is freely accessible.
159
+
160
+ ### Installation
161
+
162
+ 1. **Clone the repository:**
163
+
164
+ ```sh
165
+ git clone https://github.com/cyanheads/cpsc-recalls-mcp-server.git
166
+ ```
167
+
168
+ 2. **Navigate into the directory:**
169
+
170
+ ```sh
171
+ cd cpsc-recalls-mcp-server
172
+ ```
173
+
174
+ 3. **Install dependencies:**
175
+
176
+ ```sh
177
+ bun install
178
+ ```
179
+
180
+ 4. **Configure environment:**
181
+
182
+ ```sh
183
+ cp .env.example .env
184
+ # edit .env if needed — no required API keys
185
+ ```
186
+
187
+ ## Configuration
188
+
189
+ All configuration is validated at startup via Zod schemas. Key environment variables:
190
+
191
+ | Variable | Description | Default |
192
+ |:---|:---|:---|
193
+ | `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http` | `stdio` |
194
+ | `MCP_HTTP_PORT` | HTTP server port | `3010` |
195
+ | `MCP_HTTP_HOST` | HTTP server host | `127.0.0.1` |
196
+ | `MCP_HTTP_ENDPOINT_PATH` | HTTP endpoint path | `/mcp` |
197
+ | `MCP_PUBLIC_URL` | Public origin for TLS-terminating reverse-proxy deployments | — |
198
+ | `MCP_AUTH_MODE` | Authentication: `none`, `jwt`, or `oauth` | `none` |
199
+ | `MCP_LOG_LEVEL` | Log level (`debug`, `info`, `warning`, `error`) | `info` |
200
+ | `LOGS_DIR` | Directory for log files (Node.js only) | `<project-root>/logs` |
201
+ | `STORAGE_PROVIDER_TYPE` | Storage backend: `in-memory`, `filesystem`, `supabase`, `cloudflare-kv/r2/d1` | `in-memory` |
202
+ | `OTEL_ENABLED` | Enable OpenTelemetry | `false` |
203
+
204
+ No server-specific API keys are required. See [`.env.example`](./.env.example) for the full list of optional overrides.
205
+
206
+ ## Running the server
207
+
208
+ ### Local development
209
+
210
+ - **Build and run the production version:**
211
+
212
+ ```sh
213
+ # One-time build
214
+ bun run rebuild
215
+
216
+ # Run the built server
217
+ bun run start:stdio
218
+ # or
219
+ bun run start:http
220
+ ```
221
+
222
+ - **Run checks and tests:**
223
+
224
+ ```sh
225
+ bun run devcheck # Lint, format, typecheck, security
226
+ bun run test # Vitest test suite
227
+ ```
228
+
229
+ ### Docker
230
+
231
+ ```sh
232
+ docker build -t cpsc-recalls-mcp-server .
233
+ docker run --rm -p 3010:3010 cpsc-recalls-mcp-server
234
+ ```
235
+
236
+ 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.
237
+
238
+ ## Project structure
239
+
240
+ | Directory | Purpose |
241
+ |:---|:---|
242
+ | `src/index.ts` | `createApp()` entry point — registers tools and inits the CPSC service |
243
+ | `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). Three tools: search, get-recall, get-recent |
244
+ | `src/services/cpsc-recall` | CPSC recall service — API client, types, normalization |
245
+
246
+ ## Development guide
247
+
248
+ See [`CLAUDE.md`](./CLAUDE.md) / [`AGENTS.md`](./AGENTS.md) for development guidelines and architectural rules. The short version:
249
+
250
+ - Handlers throw, framework catches — no `try/catch` in tool logic
251
+ - Use `ctx.log` for request-scoped logging, `ctx.state` for tenant-scoped storage
252
+ - Register new tools in the `createApp()` arrays in `src/index.ts`
253
+ - Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
254
+
255
+ ## Contributing
256
+
257
+ Issues and pull requests are welcome. Run checks and tests before submitting:
258
+
259
+ ```sh
260
+ bun run devcheck
261
+ bun run test
262
+ ```
263
+
264
+ ## License
265
+
266
+ Apache-2.0 — see [LICENSE](LICENSE) for details.
@@ -0,0 +1,11 @@
1
+ ---
2
+ summary: "Initial release — CPSC recall search, details, and product lookup via MCP"
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.1.0 — 2026-05-31
8
+
9
+ ## Added
10
+
11
+ - Initial scaffold from `@cyanheads/mcp-ts-core` template
@@ -0,0 +1,26 @@
1
+ ---
2
+ summary: "Initial public release — cpsc_search_recalls, cpsc_get_recall, cpsc_get_recent over the CPSC saferproducts.gov API"
3
+ breaking: false
4
+ security: true
5
+ ---
6
+
7
+ # 0.1.1 — 2026-06-01
8
+
9
+ Initial public release. Search and retrieve US consumer product recalls from the CPSC via the saferproducts.gov API.
10
+
11
+ ## Added
12
+
13
+ - **`cpsc_search_recalls`** — search recalls by product name, brand, retailer, importer, or description keyword; optional date window and result limit.
14
+ - **`cpsc_get_recall`** — full recall detail by recall number: hazards, remedy options, affected products, consumer contact.
15
+ - **`cpsc_get_recent`** — recent recalls feed by date window, defaulting to the past 30 days.
16
+ - **`manifest.json`** — MCPB bundle support for one-click Claude Desktop install.
17
+ - Plugin manifests (`.claude-plugin/`, `.codex-plugin/`) populated with package metadata, descriptions, and install config.
18
+
19
+ ## Fixed
20
+
21
+ - **`ctx.fail` call sites** — error `cause` moved to the correct fourth argument position across all three tool handlers; was incorrectly merged into the third (options) argument.
22
+ - **`cpsc_get_recall` hazard mapping** — filter applied before map to avoid emitting objects with empty `description`; was mapping then filtering.
23
+
24
+ ## Security
25
+
26
+ - **`date_start` / `date_end` input validation** — date fields in `cpsc_search_recalls` now enforce ISO 8601 `YYYY-MM-DD` format via `z.regex()`, surfacing as a `pattern` constraint in the JSON Schema. Previously accepted any string and passed it unvalidated to the upstream API.
@@ -0,0 +1,127 @@
1
+ ---
2
+ # FORMAT REFERENCE — do not edit. Copy this file to
3
+ # `changelog/<major.minor>.x/<version>.md` (e.g. `changelog/0.8.x/0.8.6.md`)
4
+ # to author a new release. Set that file's H1 to `# <version> — YYYY-MM-DD`
5
+ # with a concrete date.
6
+
7
+ # Required. One-line GitHub Release-style headline. 350 character cap.
8
+ # Default short and scannable. Don't pad, don't stitch unrelated changes with
9
+ # semicolons — pick the headline. Quotes required: unquoted YAML treats `: `
10
+ # inside the value as a key separator and fails GitHub's strict parser.
11
+ summary: ""
12
+
13
+ # Set `true` when consumers must change code to upgrade: API removals,
14
+ # signature changes, config renames, behavior changes that break existing
15
+ # usage. Flagged as `Breaking` in the rollup.
16
+ breaking: false
17
+
18
+ # Set `true` if this release contains any security fix. Pairs with the
19
+ # `## Security` section below. Flagged as `Security` in the rollup so
20
+ # users can triage upgrade urgency at a glance.
21
+ security: false
22
+
23
+ # Optional free-form notes for maintenance agents processing this release.
24
+ # Not rendered in CHANGELOG — consumed by agents running `maintenance` on
25
+ # downstream servers. Use for adoption instructions that don't fit the
26
+ # human-facing sections: new files to create, fields to populate, one-time
27
+ # migration steps. Omit the field entirely when there's nothing to say.
28
+ # agent-notes: |
29
+ # <instructions for downstream maintenance agents>
30
+ ---
31
+
32
+ # <version> — YYYY-MM-DD
33
+
34
+ <!--
35
+ AUTHORING GUIDE — applies to the new per-version file you create from this
36
+ template.
37
+
38
+ Audience: someone scanning release notes to decide what affects them. Lead
39
+ each bullet with the symbol or concept name in **bold** so they can skip
40
+ what's irrelevant and zoom in on what's not.
41
+
42
+ Tone: terse, fact-dense, not verbose. Default to one sentence per bullet —
43
+ name the symbol, state what changed, stop. Use a second sentence only when
44
+ it carries weight. If a bullet feels long, it is.
45
+
46
+ Cut: mechanism walkthroughs (those belong in JSDoc, CLAUDE.md/AGENTS.md, or the
47
+ relevant skill), ceremonial framings ("This release introduces…",
48
+ backwards-compat paragraphs), file-by-file test enumerations, internal
49
+ implementation notes. Prefer code/symbol names over English re-explanations.
50
+
51
+ Narrative intro: skip by default. Add one short sentence only when the
52
+ release theme genuinely needs framing the bullets can't carry.
53
+
54
+ Sections: Keep a Changelog order — Added, Changed, Deprecated, Removed,
55
+ Fixed, Security. Include only sections with entries; delete the rest
56
+ (including the commented-out scaffolding below). Don't ship empty headers.
57
+
58
+ Include: every distinct fact a reader needs to adopt or audit the release —
59
+ new exports, signatures, lint rule IDs, env vars, breaking changes, version
60
+ bumps on shipped skills. Nothing more.
61
+
62
+ Links: link issues, PRs, docs, or skills where they help a reader jump to
63
+ context. Once per item per entry — don't re-link the same issue in summary,
64
+ narrative, and bullet. Skip links for inline symbol names; code spans speak
65
+ for themselves.
66
+
67
+ Issue/PR URLs: use full URLs. GitHub's bare `#NN` auto-link only resolves
68
+ inside its own UI, not in npm reads or local editors.
69
+
70
+ [#38](https://github.com/cyanheads/mcp-ts-core/issues/38) ← issue
71
+ [#42](https://github.com/cyanheads/mcp-ts-core/pull/42) ← PR
72
+
73
+ Verify numbers exist before linking (`gh issue view NN`, `gh pr view NN`).
74
+ Never speculate on a future number — `#42` for an upcoming PR silently
75
+ resolves to whatever real item already owns 42, and timeline previews pull
76
+ in that unrelated item's metadata.
77
+
78
+ TAG ANNOTATIONS — the annotated tag body renders as the GitHub Release body
79
+ via `gh release create --notes-from-tag`. The tag is a derivative of this
80
+ changelog entry — a condensed, scannable version, not a copy. Format:
81
+
82
+ <theme — omit version number, GitHub prepends it>
83
+ ← blank line
84
+ <1-2 sentence context: what this release does>
85
+ ← blank line
86
+ Dependency bumps: ← section header
87
+ ← blank line
88
+ - `@cyanheads/mcp-ts-core` ^0.9.1 → ^0.9.6 ← bullet
89
+ ← blank line
90
+ Changed: ← only sections with entries
91
+ ← blank line
92
+ - `format()` output includes `query` in text mode
93
+ ← blank line
94
+ Added:
95
+ ← blank line
96
+ - `manifest.json` scaffolded for MCPB bundle support
97
+ - Install badges (Claude Desktop, Cursor, VS Code)
98
+ ← blank line
99
+ <N> tests pass; `bun run devcheck` clean. ← footer
100
+
101
+ Never a flat comma-separated string. Always structured markdown with
102
+ sections. The tag must scan well as a rendered GitHub Release page.
103
+ -->
104
+
105
+ ## Added
106
+
107
+ -
108
+
109
+ ## Changed
110
+
111
+ -
112
+
113
+ <!-- ## Deprecated
114
+
115
+ - -->
116
+
117
+ <!-- ## Removed
118
+
119
+ - -->
120
+
121
+ ## Fixed
122
+
123
+ -
124
+
125
+ <!-- ## Security
126
+
127
+ - -->
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @fileoverview cpsc-recalls-mcp-server MCP server entry point.
4
+ * @module index
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG"}
package/dist/index.js ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @fileoverview cpsc-recalls-mcp-server MCP server entry point.
4
+ * @module index
5
+ */
6
+ import { createApp } from '@cyanheads/mcp-ts-core';
7
+ import { cpscGetRecall } from './mcp-server/tools/definitions/cpsc-get-recall.tool.js';
8
+ import { cpscGetRecent } from './mcp-server/tools/definitions/cpsc-get-recent.tool.js';
9
+ import { cpscSearchRecalls } from './mcp-server/tools/definitions/cpsc-search-recalls.tool.js';
10
+ import { initCpscRecallService } from './services/cpsc-recall/cpsc-recall-service.js';
11
+ await createApp({
12
+ tools: [cpscSearchRecalls, cpscGetRecall, cpscGetRecent],
13
+ resources: [],
14
+ prompts: [],
15
+ instructions: 'CPSC consumer product recall database (saferproducts.gov). ' +
16
+ 'Use cpsc_search_recalls to find recalls by product, brand, hazard, or date. ' +
17
+ 'Use cpsc_get_recall for full detail on a specific recall number. ' +
18
+ 'Use cpsc_get_recent for a recent recall feed. ' +
19
+ 'CPSC jurisdiction: consumer products only — food/drugs (FDA), vehicles/tires (NHTSA), boats (USCG), pesticides (EPA) are covered by other agencies.',
20
+ setup(core) {
21
+ void core;
22
+ initCpscRecallService();
23
+ },
24
+ });
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,wDAAwD,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,wDAAwD,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,4DAA4D,CAAC;AAC/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,MAAM,SAAS,CAAC;IACd,KAAK,EAAE,CAAC,iBAAiB,EAAE,aAAa,EAAE,aAAa,CAAC;IACxD,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,YAAY,EACV,6DAA6D;QAC7D,8EAA8E;QAC9E,mEAAmE;QACnE,gDAAgD;QAChD,qJAAqJ;IACvJ,KAAK,CAAC,IAAI;QACR,KAAK,IAAI,CAAC;QACV,qBAAqB,EAAE,CAAC;IAC1B,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @fileoverview Full detail for a single CPSC recall by recall number.
3
+ * @module mcp-server/tools/definitions/cpsc-get-recall
4
+ */
5
+ import { z } from '@cyanheads/mcp-ts-core';
6
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
7
+ export declare const cpscGetRecall: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
8
+ recall_number: z.ZodString;
9
+ }, z.core.$strip>, z.ZodObject<{
10
+ recall_number: z.ZodString;
11
+ recall_date: z.ZodString;
12
+ last_updated: z.ZodString;
13
+ title: z.ZodString;
14
+ description: z.ZodString;
15
+ cpsc_url: z.ZodString;
16
+ consumer_contact: z.ZodNullable<z.ZodString>;
17
+ hazards: z.ZodArray<z.ZodObject<{
18
+ description: z.ZodString;
19
+ }, z.core.$strip>>;
20
+ remedy_options: z.ZodArray<z.ZodString>;
21
+ remedy_instructions: z.ZodString;
22
+ products: z.ZodArray<z.ZodObject<{
23
+ name: z.ZodString;
24
+ units_recalled: z.ZodString;
25
+ }, z.core.$strip>>;
26
+ upcs: z.ZodArray<z.ZodString>;
27
+ injuries: z.ZodString;
28
+ manufacturers: z.ZodArray<z.ZodString>;
29
+ importers: z.ZodArray<z.ZodString>;
30
+ retailers: z.ZodArray<z.ZodString>;
31
+ distributors: z.ZodArray<z.ZodString>;
32
+ manufacturer_countries: z.ZodArray<z.ZodString>;
33
+ images: z.ZodArray<z.ZodObject<{
34
+ url: z.ZodString;
35
+ caption: z.ZodString;
36
+ }, z.core.$strip>>;
37
+ coordinated_recalls: z.ZodArray<z.ZodString>;
38
+ cpsc_jurisdiction: z.ZodString;
39
+ }, z.core.$strip>, readonly [{
40
+ readonly reason: "not_found";
41
+ readonly code: JsonRpcErrorCode.NotFound;
42
+ readonly when: "No recall exists with the given recall number";
43
+ readonly recovery: "Verify the recall number (e.g. \"25043\" for modern records, \"99003a\" for 1998–2001 historical records). Use cpsc_search_recalls or cpsc_get_recent to find the correct number.";
44
+ }, {
45
+ readonly reason: "upstream_error";
46
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
47
+ readonly when: "The saferproducts.gov API returned an error or timed out";
48
+ readonly recovery: "The CPSC API is occasionally unavailable. Retry in a few seconds.";
49
+ readonly retryable: true;
50
+ }], undefined>;
51
+ //# sourceMappingURL=cpsc-get-recall.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsc-get-recall.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/cpsc-get-recall.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAQjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA8RxB,CAAC"}