@carrierllc/mcp 0.13.71 → 0.13.73

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/README.md CHANGED
@@ -230,7 +230,7 @@ flags. Two rules apply everywhere:
230
230
  ### Stdio server (token env)
231
231
 
232
232
  ```bash
233
- ESIMVAULT_API_TOKEN=your_key npx -y -p @carrierllc/mcp carrier-mcp
233
+ CARRIER_OCS_API_TOKEN=your_key npx -y -p @carrierllc/mcp carrier-mcp
234
234
  ```
235
235
 
236
236
  Get a key at [mcp.carrier.llc](https://mcp.carrier.llc) or an org API key from the console.
@@ -248,7 +248,7 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
248
248
  "command": "npx",
249
249
  "args": ["-y", "-p", "@carrierllc/mcp", "carrier-mcp"],
250
250
  "env": {
251
- "ESIMVAULT_API_TOKEN": "YOUR_KEY"
251
+ "CARRIER_OCS_API_TOKEN": "YOUR_KEY"
252
252
  }
253
253
  }
254
254
  }
@@ -266,7 +266,7 @@ Add to `~/.cursor/mcp.json`:
266
266
  "command": "npx",
267
267
  "args": ["-y", "-p", "@carrierllc/mcp", "carrier-mcp"],
268
268
  "env": {
269
- "ESIMVAULT_API_TOKEN": "YOUR_KEY"
269
+ "CARRIER_OCS_API_TOKEN": "YOUR_KEY"
270
270
  }
271
271
  }
272
272
  }
@@ -284,7 +284,7 @@ Add to `~/.codeium/windsurf/mcp_config.json`:
284
284
  "command": "npx",
285
285
  "args": ["-y", "-p", "@carrierllc/mcp", "carrier-mcp"],
286
286
  "env": {
287
- "ESIMVAULT_API_TOKEN": "YOUR_KEY"
287
+ "CARRIER_OCS_API_TOKEN": "YOUR_KEY"
288
288
  }
289
289
  }
290
290
  }
@@ -314,8 +314,7 @@ For multi-user deployments with OAuth 2.1 + PKCE, use the remote endpoint:
314
314
  |----------|----------|---------|-------------|
315
315
  | `CARRIER_API_TOKEN` | Inventory issuance | — | Your own authenticated Carrier API credential. Required for durable `assign_package` inventory; never falls back to an OCS token. |
316
316
  | `CARRIER_API_BASE_URL` | No | `https://api.carrier.llc` | Carrier REST API origin for durable inventory. Do not use the OCS provider URL. |
317
- | `ESIMVAULT_API_TOKEN` | Explicit OCS tools | — | Your eSIMVault OCS API token; not a Carrier API credential |
318
- | `CARRIER_OCS_API_TOKEN` | Alternative | — | Alias for `ESIMVAULT_API_TOKEN` |
317
+ | `CARRIER_OCS_API_TOKEN` | Explicit OCS tools | — | Your OCS API token; not a Carrier API credential. Older releases used a different variable name; it is still read |
319
318
  | `CARRIER_OCS_BASE_URL` | No | `https://ocs.esimvault.cloud` | OCS base URL (no trailing slash) |
320
319
  | `BROWSER_USE_API_KEY` | No | — | Browser Use Cloud key. Enables the browsing agent (`ui_agent_ask`). Runs are billed to this key at roughly **$0.20–1.00 each** |
321
320
  | `CARRIER_BROWSER_USE_MAX_RUNS` | No | `10` | Browser-agent runs allowed per CLI process. `0` disables the agent. See the caveats below |
@@ -1915,7 +1915,7 @@ function storefrontScreen(input) {
1915
1915
  // package.json
1916
1916
  var package_default = {
1917
1917
  name: "@carrierllc/mcp",
1918
- version: "0.13.71",
1918
+ version: "0.13.73",
1919
1919
  description: "Carrier MCP \u2014 natural-language control of MVNO/eSIM fleets via the network OCS. Stdio mode for direct integration with Claude Desktop, Cursor, Windsurf, and MCP-compatible clients. Ships the `carrier` CLI (plugin install + white-label eSIM storefront scaffold).",
1920
1920
  license: "MIT",
1921
1921
  author: "Carrier (Lifecycle Innovations Limited)",
@@ -3186,7 +3186,7 @@ async function runWithBudget(method, attempt, budget = ocsBudgetFor(method)) {
3186
3186
  throw lastTimeout ?? new OcsTimeoutError(method, budget.attemptMs, budget.totalMs, Math.max(attempts, 1));
3187
3187
  }
3188
3188
 
3189
- // ../../packages/ocs-client/dist/chunk-ZGPZMTHL.js
3189
+ // ../../packages/ocs-client/dist/chunk-STAIW6BD.js
3190
3190
  var RATE_LIMIT = 10;
3191
3191
  var WINDOW_MS = 1e3;
3192
3192
  var windows = /* @__PURE__ */ new Map();
@@ -3636,6 +3636,8 @@ var OcsClient = class {
3636
3636
  this._strictMethods = options.strictMethods ?? false;
3637
3637
  this._validateResponses = options.validateResponses ?? true;
3638
3638
  this._strictValidation = options.strictValidation ?? false;
3639
+ this._customFetch = options.fetch;
3640
+ this._tapeReplay = options.tapeReplay;
3639
3641
  const envConfig = options.env ? fixedEgressFromEnv(options.env) : configuredFixedEgress ?? (typeof process !== "undefined" && process?.env ? fixedEgressFromEnv(process.env) : void 0);
3640
3642
  const optConfig = options.fixedEgress ?? {
3641
3643
  proxyUrl: options.fixedEgressProxyUrl,
@@ -3684,6 +3686,8 @@ var OcsClient = class {
3684
3686
  _validateResponses;
3685
3687
  _strictValidation;
3686
3688
  _fixedEgress;
3689
+ _customFetch;
3690
+ _tapeReplay;
3687
3691
  // Per-instance (NOT static): a static set would dedup across requests in a
3688
3692
  // reused Worker isolate and silently swallow recurring contract-drift warnings.
3689
3693
  _warnedMethods = /* @__PURE__ */ new Set();
@@ -3691,6 +3695,27 @@ var OcsClient = class {
3691
3695
  get fixedEgress() {
3692
3696
  return this._fixedEgress;
3693
3697
  }
3698
+ _validatePayload(method, payload) {
3699
+ if (this._validateResponses) {
3700
+ const schema = RESPONSE_SCHEMAS[method];
3701
+ if (schema) {
3702
+ const parsed = schema.safeParse(payload);
3703
+ if (!parsed.success) {
3704
+ const issues = parsed.error.issues.map((i) => ({
3705
+ path: i.path.join(".") || "<root>",
3706
+ message: i.message
3707
+ }));
3708
+ if (this._strictValidation) {
3709
+ throw new OcsContractError(method, issues, payload);
3710
+ }
3711
+ if (!this._warnedValidation.has(method)) {
3712
+ this._warnedValidation.add(method);
3713
+ console.warn(`[ocs-client] ${new OcsContractError(method, issues, payload).message}`);
3714
+ }
3715
+ }
3716
+ }
3717
+ }
3718
+ }
3694
3719
  async call(method, params = {}, token) {
3695
3720
  if (OCS_FORBIDDEN_METHODS.has(method)) {
3696
3721
  throw new OcsUnknownMethodError(method);
@@ -3721,12 +3746,18 @@ var OcsClient = class {
3721
3746
  assertBareIntParam(method, params);
3722
3747
  const wireParams = applyParamRenames(method, params);
3723
3748
  const shapedParams = nestsSubscriberId(method) ? nestSubscriberIdParam(wireParams) : wireParams;
3749
+ if (this._tapeReplay) {
3750
+ const payload = await this._tapeReplay.play(method, shapedParams);
3751
+ this._validatePayload(method, payload);
3752
+ return payload;
3753
+ }
3724
3754
  const body = JSON.stringify({ [method]: shapedParams });
3725
3755
  const singleAttempt = SINGLE_ATTEMPT_METHODS.has(method);
3726
3756
  const directFallback = !this._fixedEgress?.requireFixedEgress && this._fixedEgress?.fallbackMode === "fallback" && !singleAttempt;
3727
3757
  const send = async () => {
3728
3758
  await acquireToken(tok);
3729
3759
  await acquireEndpointSlot(tok, method, this._priority);
3760
+ const fetchFn = this._customFetch ?? globalThis.fetch;
3730
3761
  return runWithBudget(method, async (signal, attemptMs) => {
3731
3762
  let res;
3732
3763
  if (useProxy) {
@@ -3741,7 +3772,7 @@ var OcsClient = class {
3741
3772
  proxyHeaders["X-Carrier-Proxy-Secret"] = this._fixedEgress.proxySecret;
3742
3773
  }
3743
3774
  try {
3744
- res = await fetch(url, {
3775
+ res = await fetchFn(url, {
3745
3776
  method: "POST",
3746
3777
  headers: proxyHeaders,
3747
3778
  body,
@@ -3756,7 +3787,7 @@ var OcsClient = class {
3756
3787
  `[ocs-client] fixed-egress proxy network failure (${err instanceof Error ? err.message : String(err)}), falling back to direct OCS call`
3757
3788
  );
3758
3789
  try {
3759
- res = await fetch(directUrl, {
3790
+ res = await fetchFn(directUrl, {
3760
3791
  method: "POST",
3761
3792
  headers: { "Content-Type": "application/json" },
3762
3793
  body,
@@ -3781,7 +3812,7 @@ var OcsClient = class {
3781
3812
  `[ocs-client] fixed-egress proxy returned HTTP ${res.status}, falling back to direct OCS call`
3782
3813
  );
3783
3814
  try {
3784
- res = await fetch(directUrl, {
3815
+ res = await fetchFn(directUrl, {
3785
3816
  method: "POST",
3786
3817
  headers: { "Content-Type": "application/json" },
3787
3818
  body,
@@ -3799,7 +3830,7 @@ var OcsClient = class {
3799
3830
  }
3800
3831
  } else {
3801
3832
  try {
3802
- res = await fetch(directUrl, {
3833
+ res = await fetchFn(directUrl, {
3803
3834
  method: "POST",
3804
3835
  headers: { "Content-Type": "application/json" },
3805
3836
  body,
@@ -3861,25 +3892,7 @@ var OcsClient = class {
3861
3892
  payload = null;
3862
3893
  }
3863
3894
  payload = normaliseAbsentOcsPayload(method, payload, shapedParams);
3864
- if (this._validateResponses) {
3865
- const schema = RESPONSE_SCHEMAS[method];
3866
- if (schema) {
3867
- const parsed = schema.safeParse(payload);
3868
- if (!parsed.success) {
3869
- const issues = parsed.error.issues.map((i) => ({
3870
- path: i.path.join(".") || "<root>",
3871
- message: i.message
3872
- }));
3873
- if (this._strictValidation) {
3874
- throw new OcsContractError(method, issues, payload);
3875
- }
3876
- if (!this._warnedValidation.has(method)) {
3877
- this._warnedValidation.add(method);
3878
- console.warn(`[ocs-client] ${new OcsContractError(method, issues, payload).message}`);
3879
- }
3880
- }
3881
- }
3882
- }
3895
+ this._validatePayload(method, payload);
3883
3896
  return payload;
3884
3897
  }, singleAttempt ? { ...ocsBudgetFor(method), maxAttempts: 1 } : void 0);
3885
3898
  };
@@ -6148,4 +6161,4 @@ export {
6148
6161
  package_default,
6149
6162
  CARRIER_VERSION
6150
6163
  };
6151
- //# sourceMappingURL=chunk-HGPV63X3.js.map
6164
+ //# sourceMappingURL=chunk-G2DAODML.js.map