@pipeworx/mcp-recreation-gov 0.1.0 → 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.
@@ -0,0 +1,152 @@
1
+ name: Publish to npm
2
+
3
+ # Trusted publishing (OIDC) — NO npm token anywhere in this repo.
4
+ #
5
+ # Why this file exists: npm is withdrawing the ability for access tokens to
6
+ # bypass 2FA when publishing. Phase 1 (2026-07-31) already blocked token-driven
7
+ # MANAGEMENT operations; Phase 2 (~January 2027) removes DIRECT PUBLISHING, and
8
+ # when it lands no token you can create will publish this package. The
9
+ # replacement is trusted publishing: GitHub Actions proves this repo's identity
10
+ # to npm over OIDC, with no long-lived credential to leak or rotate.
11
+ #
12
+ # Provenance comes free and is why this workflow lives HERE rather than in the
13
+ # pipeworx-core monorepo: npm will only attach a provenance attestation when the
14
+ # source repo is PUBLIC, and pipeworx-core is private. This repo is public, and
15
+ # package.json's `repository.url` already points at it, which is the match npm
16
+ # checks (case-sensitive).
17
+ #
18
+ # Do NOT add `--provenance`: with trusted publishing npm generates the
19
+ # attestation automatically, and passing the flag is redundant.
20
+ #
21
+ # The FILENAME matters. npm's trusted-publisher config names the org, the repo
22
+ # and this file's name — `publish.yml`. Renaming this file silently breaks
23
+ # publishing for this package until someone re-runs `npm trust` against the new
24
+ # name. Keep it `publish.yml` across every pack repo so the bulk config loop in
25
+ # pipeworx-core's scripts/npm-trust-bulk.sh stays a one-liner.
26
+ #
27
+ # This file is GENERATED by pipeworx-core's scripts/publish-pack.sh from
28
+ # scripts/templates/publish-npm.yml. Edit it there — publish-pack.sh rebuilds
29
+ # this repo from scratch and force-pushes, so local edits are erased on the next
30
+ # publish.
31
+
32
+ on:
33
+ push:
34
+ branches: [main]
35
+ paths:
36
+ - 'package.json'
37
+ - 'src/**'
38
+ workflow_dispatch:
39
+
40
+ permissions:
41
+ id-token: write # REQUIRED: lets Actions mint the OIDC token npm authenticates
42
+ contents: read
43
+
44
+ jobs:
45
+ publish:
46
+ runs-on: ubuntu-latest # must be GitHub-HOSTED; self-hosted runners are unsupported
47
+ steps:
48
+ - uses: actions/checkout@v4
49
+
50
+ - uses: actions/setup-node@v4
51
+ with:
52
+ node-version: 22 # trusted publishing needs Node >= 22.14.0
53
+ # Deliberately NO `registry-url:` — that option exists to inject a token
54
+ # into an .npmrc, writes a literal `_authToken=${NODE_AUTH_TOKEN}` line,
55
+ # and would trip the credential assertion below. npm publish already
56
+ # defaults to registry.npmjs.org.
57
+
58
+ - name: Upgrade npm to a trusted-publishing-capable version
59
+ # The runner image's bundled npm lags. Trusted publishing needs npm
60
+ # >= 11.5.1; installing `latest` rather than a pinned version keeps this
61
+ # from silently rotting, and the assertion below fails loudly rather
62
+ # than falling through to a publish that cannot authenticate.
63
+ run: |
64
+ set -euo pipefail
65
+ npm install -g npm@latest
66
+ v=$(npm --version)
67
+ echo "npm $v"
68
+ node -e 'const v=process.argv[1].split("-")[0].split(".").map(Number);
69
+ const min=[11,5,1];
70
+ for (let i=0;i<3;i++){ if(v[i]>min[i]) break; if(v[i]<min[i]){
71
+ console.error(`npm ${process.argv[1]} is below the 11.5.1 trusted-publishing floor`);
72
+ process.exit(1); } }' "$v"
73
+
74
+ - name: Assert no npm token is present
75
+ # The whole point of this workflow is that it publishes with NO
76
+ # credential. If a token ever appears, a publish could succeed for the
77
+ # wrong reason and hide a broken OIDC config until Phase 2 removes the
78
+ # token fallback and every pack breaks at once. Fail loudly instead.
79
+ run: |
80
+ set -euo pipefail
81
+ if [ -n "${NODE_AUTH_TOKEN:-}" ] || [ -n "${NPM_TOKEN:-}" ]; then
82
+ echo "::error::an npm token is in the environment; this workflow must publish over OIDC only"
83
+ exit 1
84
+ fi
85
+ tok=$(npm config get //registry.npmjs.org/:_authToken 2>/dev/null || echo "undefined")
86
+ if [ "$tok" != "undefined" ] && [ -n "$tok" ]; then
87
+ echo "::error::npm config carries an _authToken; refusing to publish"
88
+ exit 1
89
+ fi
90
+ echo "no npm credential present — publishing over OIDC"
91
+
92
+ - name: Skip if this version is already published
93
+ id: check
94
+ run: |
95
+ set -euo pipefail
96
+ name=$(node -p "require('./package.json').name")
97
+ version=$(node -p "require('./package.json').version")
98
+ published=$(npm view "$name" version 2>/dev/null || echo "")
99
+ echo "name=$name" >> "$GITHUB_OUTPUT"
100
+ echo "version=$version" >> "$GITHUB_OUTPUT"
101
+ if [ "$published" = "$version" ]; then
102
+ # Not an error: most pushes here are README/metadata refreshes from
103
+ # publish-pack.sh, which force-pushes the whole repo. Publishing is
104
+ # the exception, so a same-version push is the normal case.
105
+ echo "skip=true" >> "$GITHUB_OUTPUT"
106
+ echo "::notice::$name@$version already published — nothing to do"
107
+ else
108
+ echo "skip=false" >> "$GITHUB_OUTPUT"
109
+ echo "::notice::publishing $name@$version (registry has ${published:-none})"
110
+ fi
111
+
112
+ - name: Publish
113
+ if: steps.check.outputs.skip == 'false'
114
+ # Do NOT add --provenance: with trusted publishing npm generates the
115
+ # attestation automatically.
116
+ #
117
+ # The error translation below is not decoration. When no trusted
118
+ # publisher is configured for this package, npm does not say so — it
119
+ # returns a generic `ENEEDAUTH / You need to authorize this machine
120
+ # using npm login`, which reads exactly like a forgotten credential and
121
+ # sends you looking for a token. There is no token to find; that is the
122
+ # point. The ENEEDAUTH text itself was seen live in mcp-opentargets run
123
+ # 33261239541 — but note that run executed a plain `npm publish`, so the
124
+ # capture-and-translate below was NOT what produced it.
125
+ #
126
+ # `set -e` IS ON here: GitHub's default `run:` shell is `bash -e {0}` —
127
+ # visible in that run's own step header — and `set -uo pipefail` does not
128
+ # clear it. A bare `out=$(npm publish ...)` therefore aborts the step AT
129
+ # THE ASSIGNMENT the instant publish fails, swallowing npm's output AND
130
+ # skipping the translation, leaving a red step with an EMPTY log. Since
131
+ # every pack fails this way until its trusted publisher exists, that is
132
+ # the common path, not the edge case. `|| rc=$?` keeps the failure
133
+ # in-band. Do not "simplify" it back to a bare assignment.
134
+ run: |
135
+ set -uo pipefail
136
+ out=$(npm publish --access public 2>&1) && rc=0 || rc=$?
137
+ echo "$out"
138
+ if [ $rc -ne 0 ] && echo "$out" | grep -q 'ENEEDAUTH'; then
139
+ # npm-trust-bulk.sh --only matches pack SLUGS, and the repo name is
140
+ # mcp-<slug> — strip the prefix or the suggested command matches
141
+ # nothing (seen live: "--only mcp-csv" → "matched no outstanding
142
+ # published pack").
143
+ repo='${{ github.event.repository.name }}'
144
+ echo "::error::npm returned ENEEDAUTH. This almost certainly means no trusted publisher is configured for this package yet, NOT that a token is missing — this workflow publishes over OIDC and deliberately has no credential. Fix: from pipeworx-core, npm login (interactive, 2FA) then ./scripts/npm-trust-bulk.sh --only ${repo#mcp-}. See docs/npm-trusted-publishing.md."
145
+ fi
146
+ exit $rc
147
+
148
+ - name: Report
149
+ if: steps.check.outputs.skip == 'false'
150
+ run: |
151
+ echo "published ${{ steps.check.outputs.name }}@${{ steps.check.outputs.version }}"
152
+ echo "verify: npm view ${{ steps.check.outputs.name }} dist.attestations"
package/README.md CHANGED
@@ -2,12 +2,16 @@
2
2
 
3
3
  Recreation.gov MCP — wraps the Recreation Information Database (RIDB) API v1
4
4
 
5
- Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 764+ live data sources.
5
+ Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1481+ live data sources.
6
6
 
7
7
  ## Tools
8
8
 
9
9
  | Tool | Description |
10
10
  |------|-------------|
11
+ | `search_facilities` | Search US federal recreation facilities — campgrounds, day-use areas, visitor centers, trailheads — on Recreation.gov. Filter by name/keyword, state, activity (e.g. "camping", "hiking"), or geographic radius. Returns facility IDs, names, types, phone/email, and coordinates. Example: search_facilities({ query: "Yosemite", state: "CA", activity: "camping" }) |
12
+ | `get_facility` | Get full details for a single Recreation.gov facility (e.g. a campground) by its FacilityID. Returns description, directions, ADA access, phone/email, keywords, and coordinates. Example: get_facility({ facility_id: "232447" }) |
13
+ | `search_recareas` | Search US federal recreation areas — the parent regions (national parks, national forests, BLM/USACE lands) that contain campgrounds and facilities — on Recreation.gov. Filter by name/keyword or state. Returns RecArea IDs, names, descriptions, phone, and coordinates. Example: search_recareas({ query: "Grand Canyon", state: "AZ" }) |
14
+ | `list_campsites` | List the individual campsites within a Recreation.gov facility (campground) by FacilityID. Returns campsite IDs, names, type (e.g. "TENT ONLY", "RV"), loop, reservability, and type of use. Example: list_campsites({ facility_id: "232447" }) |
11
15
 
12
16
  ## Quick Start
13
17
 
@@ -16,14 +20,32 @@ Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
16
20
  ```json
17
21
  {
18
22
  "mcpServers": {
19
- "recreation-gov": {
20
- "url": "https://gateway.pipeworx.io/recreation-gov/mcp"
23
+ "recreation_gov": {
24
+ "url": "https://gateway.pipeworx.io/recreation_gov/mcp"
21
25
  }
22
26
  }
23
27
  }
24
28
  ```
25
29
 
26
- Or connect to the full Pipeworx gateway for access to all 764+ data sources:
30
+ ### What this endpoint actually serves
31
+
32
+ `tools/list` at `https://gateway.pipeworx.io/recreation_gov/mcp` returns the tools in the table
33
+ above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
34
+ `discover_tools`, `search_within`, `remember`/`recall` and the rest of the
35
+ gateway-wide set. So the tool count you see is larger than this table: a
36
+ single-pack endpoint currently lists roughly 30 shared tools alongside the
37
+ pack's own. The connection's `initialize` response states its exact scope, and
38
+ is the authoritative answer for a given day.
39
+
40
+ This is deliberate, not multiplexing by accident. The meta-tools are what let a
41
+ scoped connection answer a question this pack does not cover — via
42
+ `ask_pipeworx`, which routes across the whole catalog — without you adding a
43
+ second MCP server. There is currently no way to mount a pack endpoint without
44
+ them; if the extra schemas cost you more context than the routing is worth,
45
+ connect to the full gateway once rather than to several pack endpoints.
46
+
47
+ Or connect to the full Pipeworx gateway to get every pack's tools listed
48
+ directly, instead of just this one's:
27
49
 
28
50
  ```json
29
51
  {
@@ -35,9 +57,14 @@ Or connect to the full Pipeworx gateway for access to all 764+ data sources:
35
57
  }
36
58
  ```
37
59
 
60
+ Both URLs reach the same gateway and the same 1481+ data sources. The
61
+ only difference is which pack's tools are listed **directly**; `ask_pipeworx`
62
+ reaches all of them from either one.
63
+
38
64
  ## Using with ask_pipeworx
39
65
 
40
- Instead of calling tools directly, you can ask questions in plain English:
66
+ Instead of calling tools directly, you can ask questions in plain English —
67
+ this works on the pack endpoint above as well as on the full gateway:
41
68
 
42
69
  ```
43
70
  ask_pipeworx({ question: "your question about Recreation Gov data" })
@@ -47,7 +74,7 @@ The gateway picks the right tool and fills the arguments automatically.
47
74
 
48
75
  ## More
49
76
 
50
- - [All tools and guides](https://github.com/pipeworx-io/examples)
77
+ - [Docs and guides](https://pipeworx.io/docs)
51
78
  - [pipeworx.io](https://pipeworx.io)
52
79
 
53
80
  ## License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipeworx/mcp-recreation-gov",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Recreation.gov MCP — wraps the Recreation Information Database (RIDB) API v1",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",