@pipeworx/mcp-aphis-animal-care 0.1.0

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.
@@ -0,0 +1,6 @@
1
+ {
2
+ "staged_at": "2026-09-23T18:53:37.277Z",
3
+ "publisher_blob": "da6994091dc9dcc6a7433084251ca4bbd58b4bed",
4
+ "publisher_commit": "1c417b2cfcdac06e2d9210e869265722ef013f20",
5
+ "note": "Written by scripts/publish-pack.sh as its LAST step. Its presence is the ONLY thing that lets stage-unpublished-packs.sh skip this pack. Deleting this dir is the correct way to force a rebuild."
6
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mojibake Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,176 @@
1
+ # @pipeworx/aphis-animal-care
2
+
3
+ USDA Animal Welfare Act licensees and registrants — commercial dog breeders,
4
+ dealers, exhibitors, carriers and research facilities — together with the APHIS
5
+ Animal Care inspection reports written about them, their critical/direct
6
+ violation counts and links to the official signed report PDFs.
7
+
8
+ Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1663+ live data sources.
9
+
10
+ ## Tools
11
+
12
+ - `aphis_licensee_search(state?, license_type?, name?, city?, zip?, certificate_number?, customer_number?, kind?, status?, limit?, page?)` —
13
+ who holds an AWA licence or registration. Answers "USDA licensed dog breeders
14
+ in Missouri", "look up certificate 43-A-6814", "is this kennel USDA
15
+ licensed". Returns name, certificate number, licence class, certificate
16
+ status (Active / Cancelled / Revoked), facility city/county/ZIP.
17
+ - `aphis_inspection_reports(state?, license_type?, name?, city?, zip?, certificate_number?, customer_number?, animal_category?, citation?, teachable_moments_only?, limit?, page?)` —
18
+ Animal Care inspection reports with inspection date, licensee, location,
19
+ counts of critical / direct / non-critical violations and teachable moments,
20
+ and `report_pdf_url` (the official signed report).
21
+ - `aphis_inspection_filter_options(query?, kind?, limit?)` — the 34 animal
22
+ categories and 2,165 AWA citation section codes the inspection filters
23
+ accept.
24
+
25
+ ## Auth
26
+
27
+ Keyless. No account, no cookies, no session token.
28
+
29
+ ## Data sources
30
+
31
+ - <https://efile.aphis.usda.gov/PublicSearchTool/s/sfsites/aura> — the Aura
32
+ endpoint behind the USDA APHIS eFile Public Search Tool. Actions used:
33
+ `apex://EFL_PSTController/ACTION$doCustomerQuery` (licensees/registrants),
34
+ `…$doIRSearch_UI` (inspection reports), `…$getSearchSetup` (state and
35
+ licence-type vocabularies), `…$getIRSearchFilters` (animal categories,
36
+ citation section codes).
37
+
38
+ ### Things the next person would otherwise rediscover the hard way
39
+
40
+ There is no documented REST API for this data and no key. The Public Search
41
+ Tool is a Salesforce Lightning community; its search runs over the Aura
42
+ endpoint. The Apex class and methods were captured by driving one real search
43
+ in a headless Chrome under CDP and reading the request off the wire — blind
44
+ guessing at Apex class names does not work, because a wrong class and a wrong
45
+ method return the byte-identical `No apex action available for X.y`.
46
+
47
+ - **"Guest user access is not allowed" is not a policy block.** A malformed or
48
+ missing `aura.context` returns that message with descriptor
49
+ `aura:invalidSession`, which reads as a hard refusal of anonymous callers.
50
+ It is not — the endpoint serves guests. Measured 2026-09-05, `aura.context`
51
+ needs nothing beyond `{"mode":"PROD","app":"siteforce:communityApp"}`.
52
+ - **`fwuid` does not matter.** A bogus fwuid, and an omitted one, both return
53
+ `SUCCESS`. This pack therefore does not scrape a framework version off the
54
+ page and cannot break when Salesforce rolls it.
55
+ - **`index` is a page number, not a row offset**, and the upstream caps the
56
+ underlying SOQL offset at 2,000 rows: `page * page_size <= 2000`. Past that
57
+ it throws `Maximum SOQL offset allowed for apiName EFLLicense__c is 2000`.
58
+ `totalCount` is still the true unpaged count (4,986 Class A breeder licences
59
+ in Missouri alone), so narrow rather than page.
60
+ - **`irFilterCriteria` keys are SINGULAR.** `animalCategory` and `sectionCode`
61
+ each take one Salesforce id. The plural `animalCategories: [id]` is silently
62
+ ignored and returns the *unfiltered* count with a 200 — a silent wrong
63
+ answer, not an error.
64
+ - **No date filter exists** on the inspection search. `inspectionDateFrom`,
65
+ `fromDate` and `startDate` are all ignored. Filter caller-side on
66
+ `inspection_date`.
67
+ - **A licence record is not a business.** One person appears once per
68
+ certificate, and most rows in any state are Cancelled historical licences.
69
+ `status: "active"` is the argument that matters for "who is licensed today".
70
+ - `sObjectType` selects the register: `EFLLicense__c` (Class A/B/C licensees)
71
+ vs `EFLRegistration__c` (registrants — research facilities, carriers,
72
+ intermediate handlers).
73
+
74
+ ## Quick Start
75
+
76
+ Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
77
+
78
+ ```json
79
+ {
80
+ "mcpServers": {
81
+ "aphis-animal-care": {
82
+ "url": "https://gateway.pipeworx.io/aphis-animal-care/mcp"
83
+ }
84
+ }
85
+ }
86
+ ```
87
+
88
+ ### What this endpoint actually serves
89
+
90
+ `tools/list` at `https://gateway.pipeworx.io/aphis-animal-care/mcp` returns the tools in the table
91
+ above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
92
+ `discover_tools`, `search_within`, `remember`/`recall` and the rest of the
93
+ gateway-wide set. So the tool count you see is larger than this table: a
94
+ single-pack endpoint currently lists roughly 30 shared tools alongside the
95
+ pack's own. The connection's `initialize` response states its exact scope, and
96
+ is the authoritative answer for a given day.
97
+
98
+ This is deliberate, not multiplexing by accident. The meta-tools are what let a
99
+ scoped connection answer a question this pack does not cover — via
100
+ `ask_pipeworx`, which routes across the whole catalog — without you adding a
101
+ second MCP server. There is currently no way to mount a pack endpoint without
102
+ them; if the extra schemas cost you more context than the routing is worth,
103
+ connect to the full gateway once rather than to several pack endpoints.
104
+
105
+ Or connect to the full Pipeworx gateway to get every pack's tools listed
106
+ directly, instead of just this one's:
107
+
108
+ ```json
109
+ {
110
+ "mcpServers": {
111
+ "pipeworx": {
112
+ "url": "https://gateway.pipeworx.io/mcp"
113
+ }
114
+ }
115
+ }
116
+ ```
117
+
118
+ Both URLs reach the same gateway and the same 1663+ data sources. The
119
+ only difference is which pack's tools are listed **directly**; `ask_pipeworx`
120
+ reaches all of them from either one.
121
+
122
+ ## No MCP client? Call it over HTTP
123
+
124
+ ```bash
125
+ curl -X POST https://gateway.pipeworx.io/v1/tools/aphis_licensee_search \
126
+ -H 'Content-Type: application/json' \
127
+ -d '{"state":"Missouri","license_type":"BREEDER","status":"active","limit":5}'
128
+ ```
129
+
130
+ No account needed for the first calls. Inspect any tool: `GET https://gateway.pipeworx.io/v1/tools/aphis_licensee_search`. Find one: `POST https://gateway.pipeworx.io/v1/tools/search_packs` with `{"query":"..."}`.
131
+
132
+ ## Standalone (no gateway account)
133
+
134
+ This package also runs as a local stdio MCP server — no Pipeworx account, no
135
+ gateway round-trip:
136
+
137
+ ```json
138
+ {
139
+ "mcpServers": {
140
+ "aphis-animal-care": {
141
+ "command": "npx",
142
+ "args": ["-y", "@pipeworx/mcp-aphis-animal-care"]
143
+ }
144
+ }
145
+ }
146
+ ```
147
+
148
+ Or run it directly to confirm it starts:
149
+
150
+ ```bash
151
+ npx -y @pipeworx/mcp-aphis-animal-care
152
+ ```
153
+
154
+ It speaks MCP over stdin/stdout and answers `initialize`/`tools/list`/`tools/call`
155
+ for **only** this pack's tools — none of the shared meta-tools the gateway
156
+ connection above adds. Same source, same tools, no ask_pipeworx routing.
157
+
158
+ ## Using with ask_pipeworx
159
+
160
+ Instead of calling tools directly, you can ask questions in plain English —
161
+ this works on the pack endpoint above as well as on the full gateway:
162
+
163
+ ```
164
+ ask_pipeworx({ question: "your question about Aphis Animal Care data" })
165
+ ```
166
+
167
+ The gateway picks the right tool and fills the arguments automatically.
168
+
169
+ ## More
170
+
171
+ - [Docs and guides](https://pipeworx.io/docs)
172
+ - [pipeworx.io](https://pipeworx.io)
173
+
174
+ ## License
175
+
176
+ MIT
package/bin/cli.js ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ //
3
+ // Entry point for `npx @pipeworx/mcp-<slug>`.
4
+ //
5
+ // Packs ship as raw TypeScript (no build step — see publish-pack.sh for why:
6
+ // tsx sidesteps every extensionless-import / bare-JSON-import edge case a
7
+ // per-pack tsc build would have to solve one pack at a time). This file
8
+ // registers tsx's ESM loader programmatically, then hands off to src/server.ts,
9
+ // which wraps the pack's {tools, callTool} export in a stdio MCP server.
10
+ //
11
+ // Copied verbatim into every published pack repo by scripts/publish-pack.sh —
12
+ // edit this file, not a per-pack copy.
13
+ import { register } from 'tsx/esm/api';
14
+
15
+ register();
16
+
17
+ await import('../src/server.ts');
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@pipeworx/mcp-aphis-animal-care",
3
+ "version": "0.1.0",
4
+ "description": "APHIS Animal Care MCP — USDA Animal Welfare Act licensees, registrants and",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "bin": {
9
+ "mcp-aphis-animal-care": "bin/cli.js"
10
+ },
11
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "aphis-animal-care"],
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/pipeworx-io/mcp-aphis-animal-care.git"
16
+ },
17
+ "scripts": {
18
+ "typecheck": "tsc --noEmit"
19
+ },
20
+ "dependencies": {
21
+ "@modelcontextprotocol/sdk": "^1.30.0",
22
+ "tsx": "^4.19.0"
23
+ },
24
+ "devDependencies": {
25
+ "typescript": "^5.9.3",
26
+ "@cloudflare/workers-types": "^4.20260405.1"
27
+ }
28
+ }
package/server.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.pipeworx-io/aphis-animal-care",
4
+ "title": "Aphis Animal Care",
5
+ "description": "APHIS Animal Care MCP — USDA Animal Welfare Act licensees, registrants and",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/aphis-animal-care",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-aphis-animal-care",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/aphis-animal-care/mcp"
16
+ }
17
+ ]
18
+ }