@yawlabs/lemonsqueezy-mcp 0.10.4 → 0.10.6

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,32 @@
2
2
 
3
3
  All notable changes to `@yawlabs/lemonsqueezy-mcp` are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and versioning follows [SEMVER.md](./SEMVER.md).
4
4
 
5
+ ## [0.10.6] -- 2026-05-16
6
+
7
+ ### Security
8
+
9
+ - **Sink response body size cap.** `sinkRequest` in `src/tools/sink.ts` now rejects responses larger than 10 MB before calling `JSON.parse`, defending the in-process MCP server against CPU exhaustion from a malicious or misconfigured sink (`Sink response body too large: X bytes exceeds Y byte limit`). The 10 s `AbortSignal` timeout already bounded wall-clock; the size cap bounds the parse cost as well.
10
+
11
+ ### Changed
12
+
13
+ - **`buildQuery` page-param values are URL-encoded.** Brought `page[number]` / `page[size]` in line with the `include` / `filter` branches (which already wrapped values in `encodeURIComponent`). Today the Zod schemas constrain both to integers so the encoding is a no-op, but if pagination ever widens to accept a string cursor the values are already safely escaped.
14
+ - **`smithery.yaml` numeric fields are typed `integer`.** `lemonsqueezyMaxRefundAmountCents` and `lemonsqueezyDestructiveRateLimit` now declare `type: integer, minimum: 1` (were `type: string`). Smithery's config UI now renders a number input with client-side validation. The `commandFunction` `String(...)` coerces back to env-var form, and the truthy check switched to `!= null` so the (admittedly nonsensical) value `0` would not be silently dropped.
15
+
16
+ ### Docs
17
+
18
+ - **`CHANGELOG.md` em-dashes normalized to ASCII `--`** throughout v0.9.3 and earlier sections. Brings older entries in line with the v0.10.x style and avoids the Windows-terminal mojibake risk called out in the Yaw Mode discipline.
19
+
20
+ ## [0.10.5] -- 2026-05-16
21
+
22
+ ### Changed
23
+
24
+ - **`release.sh` step 3 now bumps `server.json` alongside `package.json` and stages it in the release commit.** Previously `server.json` was treated as a derived artifact only -- `release.yml` ran a `jq` step at publish time to sync `version` and `packages[0].version` from `$GITHUB_REF_NAME`, but the committed file was never updated, so a manual `mcp-publisher publish` outside CI would push a stale registry version. The new `node -e` step mirrors the CI `jq` so the committed source matches the latest published version on every release. No `jq` dependency added (`node` was already a release-flow prereq).
25
+ - **`server.json` resynced to 0.10.4** to clear the existing drift (file was last touched at 0.10.0; releases 0.10.1 through 0.10.4 all relied on CI's publish-time `jq` rewrite). 0.10.5 going forward, the workstation release path keeps it current automatically.
26
+
27
+ ### Docs
28
+
29
+ - **CHANGELOG footers backfilled** for v0.10.0 through v0.10.4. Adds the missing `[X.Y.Z]: .../compare/...` lines per Keep a Changelog and points `[Unreleased]` at `v0.10.4...HEAD` (previously stuck at `v0.9.3...HEAD`).
30
+
5
31
  ## [0.10.4] -- 2026-05-16
6
32
 
7
33
  ### Changed
@@ -37,17 +63,17 @@ All notable changes to `@yawlabs/lemonsqueezy-mcp` are documented here. The form
37
63
  - `ls_sink_stats` -- total, unprocessed, last-received timestamp
38
64
  - `LEMONSQUEEZY_SINK_URL` and `LEMONSQUEEZY_SINK_ADMIN_TOKEN` env vars to configure the bridge. Tools are always registered for `tools/list` discovery; missing env vars surface at call time as a structured "not configured" error (with a pointer to the sink repo), not a registration-time failure. 10s fetch timeout via `AbortSignal.timeout()`; auth failures (401), admin-disabled (404), and transport errors each get a tailored diagnostic.
39
65
 
40
- ## [0.9.3] 2026-05-15
66
+ ## [0.9.3] -- 2026-05-15
41
67
 
42
68
  ### Fixed
43
69
 
44
70
  - `server.json` rewritten against the current registry schema (`2025-12-11`). The 0.9.2 release's MCP-Registry publish step failed validation against the live schema: `description` exceeded the 100-char cap, the package field was `registry_type` (snake_case) where the schema expects `registryType` (camelCase), and the required `packages[].transport` field was missing. 0.9.2 is live on npm and GitHub but did not reach the Official MCP Registry. 0.9.3 is the first release that should land on `registry.modelcontextprotocol.io`.
45
71
 
46
- ## [0.9.2] 2026-05-15
72
+ ## [0.9.2] -- 2026-05-15
47
73
 
48
74
  ### Added
49
75
 
50
- - `.github/workflows/release.yml` now publishes to the [Official MCP Registry](https://registry.modelcontextprotocol.io) after the post-publish smoke test passes. Authentication is via GitHub OIDC the `id-token: write` permission already enabled for npm provenance also satisfies the registry's auth; no `MCP_*` secret is required. The namespace `io.github.YawLabs/*` is authorized purely from the OIDC `repository_owner` claim, so anyone outside the YawLabs GitHub org cannot publish under it. A `jq` step overwrites `server.json`'s `version` (and `packages[0].version`) from the pushed tag, so a forgotten manual bump on `server.json` no longer publishes a stale version to the registry. Downstream registries (Glama, PulseMCP, mcpservers.org) that auto-source from the official registry now pick up each `@yawlabs/lemonsqueezy-mcp` release without a manual mcp-publisher run.
76
+ - `.github/workflows/release.yml` now publishes to the [Official MCP Registry](https://registry.modelcontextprotocol.io) after the post-publish smoke test passes. Authentication is via GitHub OIDC -- the `id-token: write` permission already enabled for npm provenance also satisfies the registry's auth; no `MCP_*` secret is required. The namespace `io.github.YawLabs/*` is authorized purely from the OIDC `repository_owner` claim, so anyone outside the YawLabs GitHub org cannot publish under it. A `jq` step overwrites `server.json`'s `version` (and `packages[0].version`) from the pushed tag, so a forgotten manual bump on `server.json` no longer publishes a stale version to the registry. Downstream registries (Glama, PulseMCP, mcpservers.org) that auto-source from the official registry now pick up each `@yawlabs/lemonsqueezy-mcp` release without a manual mcp-publisher run.
51
77
 
52
78
  ### Docs
53
79
 
@@ -55,24 +81,24 @@ All notable changes to `@yawlabs/lemonsqueezy-mcp` are documented here. The form
55
81
  - README Development section documents `npm run gen:containerfile` / `npm run check:containerfile` so a contributor editing `Dockerfile` knows to regenerate.
56
82
  - README Releasing section notes that the local `./release.sh` path does not publish to the Official MCP Registry (CI-only) and gives the manual `mcp-publisher` commands as the fallback when a release is cut without CI.
57
83
 
58
- ## [0.9.1] 2026-05-15
84
+ ## [0.9.1] -- 2026-05-15
59
85
 
60
86
  ### Docs
61
87
 
62
- - README "Features" list now mentions authority-class disable, per-class rate limits, and the audit-log MCP Resource previously omitted under the umbrella "Guardrails" bullet despite being documented in detail later in the file.
88
+ - README "Features" list now mentions authority-class disable, per-class rate limits, and the audit-log MCP Resource -- previously omitted under the umbrella "Guardrails" bullet despite being documented in detail later in the file.
63
89
  - README description of `LEMONSQUEEZY_DESTRUCTIVE_RATE_LIMIT` now lists every destructive trigger the runtime classifier counts: `ls_update_license_key` calls that change `activationLimit` (added in 0.7.1), `ls_update_customer` calls with `status: "archived"`, plus the previously-documented pause/plan-switch and `disabled: true` paths.
64
90
  - README qualifies the "issue a scoped LemonSqueezy API key" recommendation. LS API keys are account-wide; the qualifier directs readers to LS team-membership scoping where it exists and treats the env-var guardrails as the primary control surface for what LS itself can't express (per-class rate ceilings).
65
91
 
66
92
  ### Changed
67
93
 
68
94
  - `audit-buffer.ts` overflow path is now O(1) (circular index) instead of O(N) (`Array.splice(0, …)`). No observable behavior change; the buffer caps at 1000 entries and presents the same most-recent-first read order.
69
- - `src/index.ts` split the registered MCP tool wrapper and the audit-log Resource read-callback now live in `src/wrapper.ts` so unit tests can exercise them end-to-end without starting the stdio MCP server. `src/index.ts` becomes a thin entry point that imports `createToolHandler` and `readAuditLogResource` from the new module. No observable behavior change in the published binary.
95
+ - `src/index.ts` split -- the registered MCP tool wrapper and the audit-log Resource read-callback now live in `src/wrapper.ts` so unit tests can exercise them end-to-end without starting the stdio MCP server. `src/index.ts` becomes a thin entry point that imports `createToolHandler` and `readAuditLogResource` from the new module. No observable behavior change in the published binary.
70
96
  - `secret.ts` cache fingerprint no longer embeds the raw API key. The fingerprint is now a SHA-256 digest of `mode:value`, preserving the mid-process change-detection semantics while removing the only in-memory copy of the key outside the `cached.key` field itself.
71
97
  - `redact.ts` now also masks any string value matching the LemonSqueezy bearer-token shape (`eyJ…`-style JWT prefix), even when the key name is innocuous. Closes the future-feature gap where a destructive tool accepts a `customData`/`metadata` object whose values happen to contain a key. Also covers additional credential / PII key names (`private_key`, `pin`, `ssn`, `social_security_number`, `credit_card`, `card_number`, `cvv`, `cvc`).
72
98
 
73
99
  ### Fixed
74
100
 
75
- - Smithery one-click install now exposes `LEMONSQUEEZY_DISABLE_CLASSES` and `LEMONSQUEEZY_RATE_LIMIT_PER_CLASS` the two env vars added in 0.9.0. Previously a Smithery user had to hand-edit the spawned process env to reach the authority-class layer.
101
+ - Smithery one-click install now exposes `LEMONSQUEEZY_DISABLE_CLASSES` and `LEMONSQUEEZY_RATE_LIMIT_PER_CLASS` -- the two env vars added in 0.9.0. Previously a Smithery user had to hand-edit the spawned process env to reach the authority-class layer.
76
102
  - Smithery description for `lemonsqueezyDestructiveRateLimit` now states the actual format (a positive integer interpreted as calls per 60-second rolling window) instead of "Format depends on server defaults."
77
103
  - `logger.ts` JSON-stringify fallback now coerces `entry.error` to a plain string before the second serialization pass, so a non-string error field (an `Error` with a circular `cause` chain, or an object with a throwing `toJSON`) no longer skips both write attempts and degrades to silence. Tests cover the case.
78
104
  - `integration.test.ts` `before()` hook now clears `LEMONSQUEEZY_API_KEY_COMMAND` and `LEMONSQUEEZY_TEST_API_KEY` before setting `LEMONSQUEEZY_API_KEY` from the test key, and resets the secret cache. Previously a developer with a vault-backed `LEMONSQUEEZY_API_KEY_COMMAND` would silently run the integration suite against their dev key, because the command takes precedence over the bare env var in `secret.ts`.
@@ -80,54 +106,54 @@ All notable changes to `@yawlabs/lemonsqueezy-mcp` are documented here. The form
80
106
 
81
107
  ### Added
82
108
 
83
- - `src/wrapper.ts` extracted production module containing `createToolHandler` (the MCP tool registration wrapper) and `readAuditLogResource` (the audit-log Resource read-callback). Same logic that previously lived inline in `src/index.ts`; now reusable and testable.
84
- - `src/wrapper.test.ts` end-to-end test that exercises the registered MCP tool wrapper from `src/wrapper.ts`. Covers the order in which `checkClassAllowed` / `checkClassRateLimit` / `checkDestructiveRateLimit` / `checkStoreScopedToolInput` fire, the destructive-call audit pipeline (logger + ring buffer), the audit-log MCP Resource (`lemonsqueezy://audit-log`), and the predicate-destructive routing (e.g. `ls_update_license_key` with `activationLimit`). Previously every handler test invoked `tool.handler(input)` directly and the wrapper was untested.
109
+ - `src/wrapper.ts` -- extracted production module containing `createToolHandler` (the MCP tool registration wrapper) and `readAuditLogResource` (the audit-log Resource read-callback). Same logic that previously lived inline in `src/index.ts`; now reusable and testable.
110
+ - `src/wrapper.test.ts` -- end-to-end test that exercises the registered MCP tool wrapper from `src/wrapper.ts`. Covers the order in which `checkClassAllowed` / `checkClassRateLimit` / `checkDestructiveRateLimit` / `checkStoreScopedToolInput` fire, the destructive-call audit pipeline (logger + ring buffer), the audit-log MCP Resource (`lemonsqueezy://audit-log`), and the predicate-destructive routing (e.g. `ls_update_license_key` with `activationLimit`). Previously every handler test invoked `tool.handler(input)` directly and the wrapper was untested.
85
111
 
86
- ## [0.9.0] 2026-05-14
112
+ ## [0.9.0] -- 2026-05-14
87
113
 
88
114
  ### Added
89
115
 
90
116
  - **Authority classes.** Every tool now declares an `authorityClass` describing the kind of business authority a caller needs to invoke it (`read`, `pii`, `mutate`, `money`, `recurring`, `key`, `webhook`). The class is separate from the existing destructive/read-only annotation.
91
- - `LEMONSQUEEZY_DISABLE_CLASSES` comma-separated list of classes to refuse outright. Example: `money,recurring,pii` lets an agent run reads but blocks refunds, subscription changes, and customer-record access. Unknown class names throw at server startup.
92
- - `LEMONSQUEEZY_RATE_LIMIT_PER_CLASS` per-class rolling rate limits with a DSL. Each entry is `class:N`, `class:N/m`, or `class:N/h`. Example: `money:2/h,recurring:5/h,key:10/m`. Composes with `LEMONSQUEEZY_DESTRUCTIVE_RATE_LIMIT` both must pass. No LemonSqueezy permission can express "max 2 refunds per hour"; this is the only place that policy can live.
93
- - `deprecate.yml` workflow CI-driven `npm deprecate` via `workflow_dispatch`, using the org-level `NPM_TOKEN` and the same `release-npm` concurrency group as `release.yml`. No local WebAuthn session needed for a deprecate run.
94
- - `server.json` + `mcpName` field in `package.json` prepares the repo for the Official MCP Registry. Downstream registries (Glama, PulseMCP, mcpservers.org) auto-source from the official registry, so a single publish reaches the ecosystem.
95
- - README "Add to mcp.hosting" install button one-click sync of the server into [mcp.hosting](https://mcp.hosting) so it propagates to every MCP client a user has configured.
117
+ - `LEMONSQUEEZY_DISABLE_CLASSES` -- comma-separated list of classes to refuse outright. Example: `money,recurring,pii` lets an agent run reads but blocks refunds, subscription changes, and customer-record access. Unknown class names throw at server startup.
118
+ - `LEMONSQUEEZY_RATE_LIMIT_PER_CLASS` -- per-class rolling rate limits with a DSL. Each entry is `class:N`, `class:N/m`, or `class:N/h`. Example: `money:2/h,recurring:5/h,key:10/m`. Composes with `LEMONSQUEEZY_DESTRUCTIVE_RATE_LIMIT` -- both must pass. No LemonSqueezy permission can express "max 2 refunds per hour"; this is the only place that policy can live.
119
+ - `deprecate.yml` workflow -- CI-driven `npm deprecate` via `workflow_dispatch`, using the org-level `NPM_TOKEN` and the same `release-npm` concurrency group as `release.yml`. No local WebAuthn session needed for a deprecate run.
120
+ - `server.json` + `mcpName` field in `package.json` -- prepares the repo for the Official MCP Registry. Downstream registries (Glama, PulseMCP, mcpservers.org) auto-source from the official registry, so a single publish reaches the ecosystem.
121
+ - README "Add to mcp.hosting" install button -- one-click sync of the server into [mcp.hosting](https://mcp.hosting) so it propagates to every MCP client a user has configured.
96
122
 
97
123
  ### Changed
98
124
 
99
125
  - README "Authority classes" section reframed to lead with the authoritative control (a scoped LemonSqueezy API key) and present the env vars as defense in depth. `RATE_LIMIT_PER_CLASS` is called out as load-bearing (no LS access-control equivalent); `DISABLE_CLASSES` is positioned as a fast deploy-time alternative when the cost of a key rotation outweighs the strength gained.
100
126
  - `release.yml` smoke test now retries the actual `npx --version` call (30 × 10s) instead of gating on `npm view`. The two paths hit different CDN caches; `npm view` can clear while `npx` still ETARGETs on a stale mirror. Mirrors the pattern in `aws-mcp` / `tailscale-mcp`.
101
127
 
102
- ## [0.8.1] 2026-05-13
128
+ ## [0.8.1] -- 2026-05-13
103
129
 
104
130
  ### Fixed
105
131
 
106
132
  - `handlers.test.ts` isolation: CI's integration job sets `LEMONSQUEEZY_TEST_API_KEY` from a repo secret. With the priority chain introduced in 0.8.0 (`COMMAND` > `TEST_API_KEY` > `API_KEY`), that injected value took precedence over the in-test stub and broke three handler tests (`ls_get_user` bearer-token assertion plus the missing/empty-key cases). The suite-level `before()` now saves and clears all three source env vars, restores them in `after()`, and resets the secret cache. Reproducible locally by running with `LEMONSQUEEZY_TEST_API_KEY=ci-stub-key LEMONSQUEEZY_API_KEY="" npm test`.
107
133
 
108
- ## [0.8.0] 2026-05-13
134
+ ## [0.8.0] -- 2026-05-13
109
135
 
110
- Distribution-readiness pass closes feature gaps against other OSS LemonSqueezy MCP servers ahead of broader distribution.
136
+ Distribution-readiness pass -- closes feature gaps against other OSS LemonSqueezy MCP servers ahead of broader distribution.
111
137
 
112
138
  ### Added
113
139
 
114
140
  - **Smithery one-click install.** `smithery.yaml` declares the stdio start command + JSON Schema for env vars; Smithery generates the config UX. Install via `npx -y @smithery/cli install @yawlabs/lemonsqueezy-mcp --client claude`.
115
141
  - **Container images.** `Dockerfile` + `Containerfile` + `.dockerignore`. Multi-stage build on `node:20-alpine`, runs as the non-root `node` user, copies only `dist/index.js` into the runtime image. Stdio transport; no port exposed. Pass env via `-e LEMONSQUEEZY_*`.
116
- - `LEMONSQUEEZY_TEST_API_KEY` separate test-mode key. Priority sits between `LEMONSQUEEZY_API_KEY_COMMAND` (highest) and `LEMONSQUEEZY_API_KEY` (lowest), so a developer can point the server at a sandbox store without unsetting their production key. A one-shot stderr `test_mode` notice fires on first activation per process.
117
- - **MCP Resource `lemonsqueezy://audit-log`** bounded ring buffer (last 1000 entries, most-recent-first) of destructive-call audit entries, exposed as `application/x-ndjson`. Lets clients without stderr access retrieve the audit trail structurally. Secret-shaped input fields are already redacted before they reach the buffer.
142
+ - `LEMONSQUEEZY_TEST_API_KEY` -- separate test-mode key. Priority sits between `LEMONSQUEEZY_API_KEY_COMMAND` (highest) and `LEMONSQUEEZY_API_KEY` (lowest), so a developer can point the server at a sandbox store without unsetting their production key. A one-shot stderr `test_mode` notice fires on first activation per process.
143
+ - **MCP Resource `lemonsqueezy://audit-log`** -- bounded ring buffer (last 1000 entries, most-recent-first) of destructive-call audit entries, exposed as `application/x-ndjson`. Lets clients without stderr access retrieve the audit trail structurally. Secret-shaped input fields are already redacted before they reach the buffer.
118
144
 
119
145
  ### Changed
120
146
 
121
147
  - Dev-dependency audit warnings cleared via `npm audit fix`. Runtime bundle is unaffected (zero runtime deps).
122
148
 
123
- ## [0.7.1] 2026-05-13
149
+ ## [0.7.1] -- 2026-05-13
124
150
 
125
151
  Hardening pass on the v0.4.0 guardrails after observing realistic agent failure modes.
126
152
 
127
153
  ### Added
128
154
 
129
155
  - **Retry deadline.** `OVERALL_DEADLINE_MS=90s` ceiling on total wall clock across retries. The timeout error reports actual elapsed and attempt count (`Request timed out after Xs (N attempts)`) instead of the per-attempt budget. The loop stops on 5xx/429/timeout once the deadline is reached rather than starting a new attempt or sleeping past it.
130
- - **Audit redaction (`src/redact.ts`).** Masks values of secret-shaped keys (`secret`, `password`, `token`, `api[_-]?key`, `bearer`, `authorization`, `signing[_-]?secret` case-insensitive, whole-word) before the entry reaches the audit log. Anchored regex so business identifiers (`licenseKey`, `instanceId`, `storeId`) are preserved. Cycle-safe via `WeakSet` with a 32-depth cap. Defense in depth no destructive tool today carries a secret-typed input, but flipping any webhook tool to destructive would otherwise leak its signing secret.
156
+ - **Audit redaction (`src/redact.ts`).** Masks values of secret-shaped keys (`secret`, `password`, `token`, `api[_-]?key`, `bearer`, `authorization`, `signing[_-]?secret` -- case-insensitive, whole-word) before the entry reaches the audit log. Anchored regex so business identifiers (`licenseKey`, `instanceId`, `storeId`) are preserved. Cycle-safe via `WeakSet` with a 32-depth cap. Defense in depth -- no destructive tool today carries a secret-typed input, but flipping any webhook tool to destructive would otherwise leak its signing secret.
131
157
  - **`requiredFilters` scoping.** When `LEMONSQUEEZY_ALLOWED_STORE_IDS` is active, list tools that lack a `storeId` field must specify at least one parent filter (orderId, productId, variantId, etc.). Closes the silent-no-op gap on `ls_list_files` / `ls_list_prices` / `ls_list_variants` / `ls_list_order_items` / `ls_list_subscription_items` / `ls_list_usage_records` / `ls_list_discount_redemptions` / `ls_list_license_key_instances`. Each affected tool description flags the cross-store consideration. `ls_list_affiliates` has no meaningful parent filter and is description-only.
132
158
 
133
159
  ### Changed
@@ -135,11 +161,11 @@ Hardening pass on the v0.4.0 guardrails after observing realistic agent failure
135
161
  - `ls_update_license_key` is now classified as destructive whenever `activationLimit` changes, not just when `disabled: true`. Shrinking the limit can revoke access and the input alone doesn't reveal shrink-vs-grow direction.
136
162
  - `ls_create_checkout` email validation tightened to `.email().max(320)` to match `ls_create_customer` (was `max(10000)` with no shape check).
137
163
 
138
- ## [0.7.0] 2026-05-06
164
+ ## [0.7.0] -- 2026-05-06
139
165
 
140
166
  ### Added
141
167
 
142
- - `LEMONSQUEEZY_LOG=audit|error|all` fine-grained log levels for long-running deployments. `audit` keeps destructive-call entries plus errors and drops successful reads (recommended for production where log volume matters over weeks). `error` keeps only failures. `all` is the verbose default. `json` is retained as a backwards-compat alias for `all`.
168
+ - `LEMONSQUEEZY_LOG=audit|error|all` -- fine-grained log levels for long-running deployments. `audit` keeps destructive-call entries plus errors and drops successful reads (recommended for production where log volume matters over weeks). `error` keeps only failures. `all` is the verbose default. `json` is retained as a backwards-compat alias for `all`.
143
169
 
144
170
  ### Changed
145
171
 
@@ -150,24 +176,24 @@ Hardening pass on the v0.4.0 guardrails after observing realistic agent failure
150
176
 
151
177
  ### Fixed
152
178
 
153
- - `release.sh` annotated tags (`git tag -a`) `git push --follow-tags` silently skips lightweight tags. Pre-0.7.0, the release commit could push without the tag, leaving CI release unfired. Caught by review before any failed run.
154
- - `release.sh` idempotency check now queries `@yawlabs/<pkg>@${VERSION}` specifically rather than the package's `latest` dist-tag. The bare query returned whichever version is latest on the registry, so an out-of-band higher version made the script try to re-publish the current one and fail with "cannot publish over previously published version." The versioned form returns the version when it exists and empty otherwise correct idempotency semantics.
179
+ - `release.sh` annotated tags (`git tag -a`) -- `git push --follow-tags` silently skips lightweight tags. Pre-0.7.0, the release commit could push without the tag, leaving CI release unfired. Caught by review before any failed run.
180
+ - `release.sh` idempotency check now queries `@yawlabs/<pkg>@${VERSION}` specifically rather than the package's `latest` dist-tag. The bare query returned whichever version is latest on the registry, so an out-of-band higher version made the script try to re-publish the current one and fail with "cannot publish over previously published version." The versioned form returns the version when it exists and empty otherwise -- correct idempotency semantics.
155
181
  - `release.sh` push now uses `--follow-tags` instead of `--tags` so stale local tags don't ride along (`--tags` pushes every local tag).
156
182
  - `release.yml` concurrency group is now a literal `release-npm` (workflow-scoped); previously `release-${{ github.ref }}` evaluated to per-tag groups and back-to-back tag pushes would race on `npm publish`.
157
- - `ci.yml` no longer runs a redundant explicit `npm run build` step `npm test` is `npm run build && node --test dist/...` for this dist-based repo, so the explicit step was building twice per matrix cell for zero signal.
183
+ - `ci.yml` no longer runs a redundant explicit `npm run build` step -- `npm test` is `npm run build && node --test dist/...` for this dist-based repo, so the explicit step was building twice per matrix cell for zero signal.
158
184
 
159
185
  ### Restored
160
186
 
161
187
  - `CODEOWNERS` and `dependabot.yml` (dropped along with the workflows in 0.6.0; restored when the workflows came back in 0.6.1). Routes review requests to `@jeffyaw` and bumps npm deps weekly / github-actions deps monthly.
162
188
 
163
- ## [0.6.2] 2026-05-04
189
+ ## [0.6.2] -- 2026-05-04
164
190
 
165
191
  ### Changed
166
192
 
167
193
  - `release.yml` now runs a post-publish smoke test that fetches the just-published tarball via `npx -y @yawlabs/lemonsqueezy-mcp@<version> --version` and asserts the binary executes and prints the expected version. Catches packaging regressions (missing bin shebang, broken `files` entry, bad esbuild output) before they reach real users.
168
194
  - `release.sh` step 7 now verifies that CI publishes carry a sigstore provenance attestation. A missing attestation in CI mode is a soft warning; local publishes legitimately skip provenance.
169
195
 
170
- ## [0.6.1] 2026-05-04
196
+ ## [0.6.1] -- 2026-05-04
171
197
 
172
198
  ### Changed
173
199
 
@@ -181,7 +207,7 @@ Hardening pass on the v0.4.0 guardrails after observing realistic agent failure
181
207
  - `release.sh` `npm publish` retry only fires on EOTP/EAUTH/OTP messages. Other failures (duplicate-version E403, packaging errors) bail immediately instead of wasting 60s in the retry loop.
182
208
  - `package.json` `prepublishOnly` trimmed to `npm run build`. `release.sh` already runs lint + tests before publishing in both modes, so the embedded test run was doubling the CI work per release.
183
209
 
184
- ## [0.6.0] 2026-04-24
210
+ ## [0.6.0] -- 2026-04-24
185
211
 
186
212
  ### Changed
187
213
 
@@ -199,18 +225,18 @@ Hardening pass on the v0.4.0 guardrails after observing realistic agent failure
199
225
 
200
226
  ### Removed
201
227
 
202
- - All of `.github/` (workflows, dependabot, CODEOWNERS). There is no CI `release.sh` is the only supported release path.
228
+ - All of `.github/` (workflows, dependabot, CODEOWNERS). There is no CI -- `release.sh` is the only supported release path.
203
229
  - `test:ci` npm script.
204
230
 
205
231
  ### Docs
206
232
 
207
233
  - README documents the local release flow and the one-time `npm login` / `gh auth login` setup.
208
- - README clarifies `LEMONSQUEEZY_ALLOWED_STORE_IDS` semantics list filters now required when the allowlist is set; tools with no `storeId` field at all remain ungated, so pair with the refund cap and rate limit.
234
+ - README clarifies `LEMONSQUEEZY_ALLOWED_STORE_IDS` semantics -- list filters now required when the allowlist is set; tools with no `storeId` field at all remain ungated, so pair with the refund cap and rate limit.
209
235
  - README notes that `LEMONSQUEEZY_DESTRUCTIVE_RATE_LIMIT` counts include `ls_update_license_key` with `disabled: true`.
210
236
  - `SEMVER.md` points at `npm run test:integration` for upstream-drift detection instead of the removed nightly workflow.
211
237
  - `CLAUDE.md` and `CONTRIBUTING.md` updated to reference the local script and Biome-on-review instead of CI checks.
212
238
 
213
- ## [0.5.0] 2026-04-23
239
+ ## [0.5.0] -- 2026-04-23
214
240
 
215
241
  ### Changed
216
242
 
@@ -227,7 +253,7 @@ Hardening pass on the v0.4.0 guardrails after observing realistic agent failure
227
253
 
228
254
  - README tool count corrected from 59 to 61 (affiliate tools from 0.3.0 plus `ls_refund_subscription_invoice` weren't reflected in the total).
229
255
 
230
- ## [0.4.1] 2026-04-20
256
+ ## [0.4.1] -- 2026-04-20
231
257
 
232
258
  ### Security
233
259
 
@@ -237,23 +263,23 @@ Hardening pass on the v0.4.0 guardrails after observing realistic agent failure
237
263
 
238
264
  - README links to `@yawlabs/lemonsqueezy-webhook-sink` from the webhook-reconciliation callout.
239
265
 
240
- ## [0.4.0] 2026-04-20
266
+ ## [0.4.0] -- 2026-04-20
241
267
 
242
268
  Hardening pass for unattended automation against live billing flows.
243
269
 
244
270
  ### Added
245
271
 
246
272
  - **Guardrails.** Opt-in controls evaluated in a single dispatcher pre-check:
247
- - `LEMONSQUEEZY_ALLOWED_STORE_IDS` allowlist enforced on every tool call that names a store.
248
- - `LEMONSQUEEZY_MAX_REFUND_AMOUNT_CENTS` per-call cap on `ls_refund_order` to prevent runaway agents from issuing large refunds.
249
- - `LEMONSQUEEZY_DESTRUCTIVE_RATE_LIMIT` rolling 60-second circuit breaker on destructive tool calls.
273
+ - `LEMONSQUEEZY_ALLOWED_STORE_IDS` -- allowlist enforced on every tool call that names a store.
274
+ - `LEMONSQUEEZY_MAX_REFUND_AMOUNT_CENTS` -- per-call cap on `ls_refund_order` to prevent runaway agents from issuing large refunds.
275
+ - `LEMONSQUEEZY_DESTRUCTIVE_RATE_LIMIT` -- rolling 60-second circuit breaker on destructive tool calls.
250
276
  All three default to unset → disabled, so existing integrations are unaffected until explicitly opted in.
251
277
  - **Retry layer** (`src/retry.ts`). Exponential backoff with jitter, capped at 4 attempts and 30s. Retries `429` always (honors `Retry-After`), `5xx` and transport errors only on idempotent methods (`GET`/`DELETE`). Non-idempotent writes fail fast.
252
278
  - **Secret loader** (`src/secret.ts`). `LEMONSQUEEZY_API_KEY_COMMAND` invokes an external command (vault CLI, 1Password, etc.) and caches the result for 1 hour. Lets credentials rotate without restarting the server.
253
279
  - **Structured logger** (`src/logger.ts`). Opt-in via `LEMONSQUEEZY_LOG=json`. Emits JSON lines to stderr (stdout stays reserved for MCP protocol). Destructive tool calls are tagged `audit: true` with redacted inputs.
254
280
  - **Request ID surfacing.** API error messages include upstream `X-Request-Id` when present, so support tickets can be traced.
255
281
  - **Read-only integration tests.** `npm run test:integration` hits a live LemonSqueezy store if `LEMONSQUEEZY_TEST_API_KEY` + `LEMONSQUEEZY_TEST_STORE_ID` are set; skips gracefully otherwise. Exercises `ls_get_user`, `ls_get_store`, `ls_list_products`, `ls_list_variants`, `ls_list_orders`, `ls_list_subscriptions`, and 404 error paths. Runs nightly via `.github/workflows/integration.yml`.
256
- - **`SEMVER.md`** documents what counts as a breaking change for this package (tool names, required inputs, return shapes), and what explicitly does not (upstream API drift, internal module names).
282
+ - **`SEMVER.md`** -- documents what counts as a breaking change for this package (tool names, required inputs, return shapes), and what explicitly does not (upstream API drift, internal module names).
257
283
 
258
284
  ### Changed
259
285
 
@@ -262,18 +288,18 @@ Hardening pass for unattended automation against live billing flows.
262
288
  ### Fixed
263
289
 
264
290
  - `parseRetryAfterMs` now correctly falls back to the default 1s when given a negative number like `"-3"` (previously `Date.parse("-3")` returned a finite value and produced a non-sensical delay).
265
- - Retry policy no longer retries `5xx` on `POST`/`PATCH`/`PUT` prevents duplicate writes if a timeout is actually a slow success.
291
+ - Retry policy no longer retries `5xx` on `POST`/`PATCH`/`PUT` -- prevents duplicate writes if a timeout is actually a slow success.
266
292
 
267
- ## [0.3.0] 2026-04-18
293
+ ## [0.3.0] -- 2026-04-18
268
294
 
269
295
  ### Added
270
296
 
271
297
  - Affiliate tools (`ls_list_affiliates`, `ls_get_affiliate`).
272
298
  - `429` retry with exponential backoff in the API client.
273
- - `SECURITY.md` vulnerability disclosure policy.
274
- - `CONTRIBUTING.md` contributor and AI-agent guidelines.
299
+ - `SECURITY.md` -- vulnerability disclosure policy.
300
+ - `CONTRIBUTING.md` -- contributor and AI-agent guidelines.
275
301
 
276
- ## [0.2.1] 2026-04-16
302
+ ## [0.2.1] -- 2026-04-16
277
303
 
278
304
  ### Changed
279
305
 
@@ -287,7 +313,7 @@ Hardening pass for unattended automation against live billing flows.
287
313
 
288
314
  - Error-path tests for every tool.
289
315
 
290
- ## [0.2.0] 2026-04-14
316
+ ## [0.2.0] -- 2026-04-14
291
317
 
292
318
  ### Added
293
319
 
@@ -297,17 +323,24 @@ Hardening pass for unattended automation against live billing flows.
297
323
 
298
324
  - `ls_generate_order_invoice` and `ls_generate_subscription_invoice` now hit the correct endpoints and handle the async invoice-generation response shape.
299
325
 
300
- ## [0.1.1] 2026-04-12
326
+ ## [0.1.1] -- 2026-04-12
301
327
 
302
328
  ### Added
303
329
 
304
330
  - Edge-case handler tests for fuller coverage across all 59 tools.
305
331
 
306
- ## [0.1.0] 2026-04-11
332
+ ## [0.1.0] -- 2026-04-11
307
333
 
308
334
  Initial release. 59 tools covering all 17 LemonSqueezy API resources.
309
335
 
310
- [Unreleased]: https://github.com/YawLabs/lemonsqueezy-mcp/compare/v0.9.3...HEAD
336
+ [Unreleased]: https://github.com/YawLabs/lemonsqueezy-mcp/compare/v0.10.6...HEAD
337
+ [0.10.6]: https://github.com/YawLabs/lemonsqueezy-mcp/compare/v0.10.5...v0.10.6
338
+ [0.10.5]: https://github.com/YawLabs/lemonsqueezy-mcp/compare/v0.10.4...v0.10.5
339
+ [0.10.4]: https://github.com/YawLabs/lemonsqueezy-mcp/compare/v0.10.3...v0.10.4
340
+ [0.10.3]: https://github.com/YawLabs/lemonsqueezy-mcp/compare/v0.10.2...v0.10.3
341
+ [0.10.2]: https://github.com/YawLabs/lemonsqueezy-mcp/compare/v0.10.1...v0.10.2
342
+ [0.10.1]: https://github.com/YawLabs/lemonsqueezy-mcp/compare/v0.10.0...v0.10.1
343
+ [0.10.0]: https://github.com/YawLabs/lemonsqueezy-mcp/compare/v0.9.3...v0.10.0
311
344
  [0.9.3]: https://github.com/YawLabs/lemonsqueezy-mcp/compare/v0.9.2...v0.9.3
312
345
  [0.9.2]: https://github.com/YawLabs/lemonsqueezy-mcp/compare/v0.9.1...v0.9.2
313
346
  [0.9.1]: https://github.com/YawLabs/lemonsqueezy-mcp/compare/v0.9.0...v0.9.1
package/dist/index.js CHANGED
@@ -30684,10 +30684,10 @@ function buildQuery(params) {
30684
30684
  }
30685
30685
  if (params.page) {
30686
30686
  if (params.page.number !== void 0) {
30687
- parts.push(`page[number]=${params.page.number}`);
30687
+ parts.push(`page[number]=${encodeURIComponent(String(params.page.number))}`);
30688
30688
  }
30689
30689
  if (params.page.size !== void 0) {
30690
- parts.push(`page[size]=${params.page.size}`);
30690
+ parts.push(`page[size]=${encodeURIComponent(String(params.page.size))}`);
30691
30691
  }
30692
30692
  }
30693
30693
  return parts.length > 0 ? `?${parts.join("&")}` : "";
@@ -31831,6 +31831,7 @@ var productTools = [
31831
31831
  // src/tools/sink.ts
31832
31832
  var SINK_REPO_URL = "https://github.com/YawLabs/lemonsqueezy-webhook-sink";
31833
31833
  var FETCH_TIMEOUT_MS = 1e4;
31834
+ var MAX_BODY_SIZE_BYTES = 10 * 1024 * 1024;
31834
31835
  function loadSinkConfig() {
31835
31836
  const rawUrl = process.env.LEMONSQUEEZY_SINK_URL;
31836
31837
  const token = process.env.LEMONSQUEEZY_SINK_ADMIN_TOKEN;
@@ -31910,6 +31911,12 @@ async function sinkRequest(config2, method, pathAndQuery) {
31910
31911
  }
31911
31912
  const text = await res.text();
31912
31913
  if (!text.trim()) return { ok: true, data: {} };
31914
+ if (text.length > MAX_BODY_SIZE_BYTES) {
31915
+ return {
31916
+ ok: false,
31917
+ error: `Sink response body too large: ${text.length} bytes exceeds ${MAX_BODY_SIZE_BYTES} byte limit`
31918
+ };
31919
+ }
31913
31920
  try {
31914
31921
  return { ok: true, data: JSON.parse(text) };
31915
31922
  } catch (err) {
@@ -32779,7 +32786,7 @@ function readAuditLogResource(uri) {
32779
32786
  }
32780
32787
 
32781
32788
  // src/index.ts
32782
- var version2 = true ? "0.10.4" : (await null).createRequire(import.meta.url)("../package.json").version;
32789
+ var version2 = true ? "0.10.6" : (await null).createRequire(import.meta.url)("../package.json").version;
32783
32790
  var subcommand = process.argv[2];
32784
32791
  if (subcommand === "version" || subcommand === "--version") {
32785
32792
  console.log(version2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yawlabs/lemonsqueezy-mcp",
3
- "version": "0.10.4",
3
+ "version": "0.10.6",
4
4
  "mcpName": "io.github.YawLabs/lemonsqueezy-mcp",
5
5
  "description": "LemonSqueezy MCP server for managing your store from AI assistants",
6
6
  "license": "MIT",