@pofky/asc-mcp 1.9.11 → 1.9.13

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
@@ -12,7 +12,7 @@
12
12
  npx @pofky/asc-mcp init --write # finds your .p8, asks for your Issuer ID, writes your MCP config
13
13
  ```
14
14
 
15
- Then ask your agent: **"start my asc-mcp trial, my email is you@example.com"**. All 41 tools unlock for 7 days, no card and nothing to cancel, and the trial activates in the session you are already in, so whatever you were blocked on works on the very next call. After that Pro is $9 a month. Six tools stay free, and three of those need nothing but Node.
15
+ Then ask your agent: **"start my asc-mcp trial, my email is you@example.com"**. All 41 tools unlock for 7 days, no card and nothing to cancel, and the trial activates in the session you are already in, so whatever you were blocked on works on the very next call. After that Pro is $9 a month. Six tools stay free, and two of those (the setup check and the playbook) need nothing but Node.
16
16
 
17
17
  | You say | What happens |
18
18
  |---------|-------------|
@@ -58,6 +58,14 @@ npx @pofky/asc-mcp init --write # auto-detects the key, asks for your Issuer
58
58
 
59
59
  `init --write` finds your Claude Desktop / Claude Code config, backs it up, and merges in the server block, so there's no JSON editing. The server also auto-discovers the `.p8` path at runtime, so you only ever need `ASC_ISSUER_ID` (and `ASC_LICENSE_KEY` for Pro).
60
60
 
61
+ **As a Claude Code plugin.** One line installs the server and the review-triage skill together, and Claude Code asks for your Issuer ID when it enables the plugin:
62
+
63
+ ```
64
+ /plugin install asc-mcp --marketplace pofky/asc-mcp
65
+ ```
66
+
67
+ The plugin lives in [`plugin/`](plugin/), and its README says what it runs and sends.
68
+
61
69
  **Running it from an agent, or any pipe.** There is no terminal to answer questions in, so pass what would have been asked:
62
70
 
63
71
  ```bash
@@ -88,7 +96,7 @@ With the `.p8` in `~/.appstoreconnect/private_keys/`, `ASC_ISSUER_ID` is the onl
88
96
 
89
97
  **Step 3.** Ask your agent: "List my App Store Connect apps"
90
98
 
91
- **Step 4, to try the paid half.** Ask your agent: "start my asc-mcp trial, my email is you@example.com". It calls `asc_start_trial`, which unlocks all 41 tools for 7 days with no card and nothing to cancel. The key activates in the running session, so whatever you were blocked on works on the very next call, and it is written into your MCP config so it survives a restart. One trial per Apple developer account.
99
+ **Step 4, to try the paid half.** Ask your agent: "start my asc-mcp trial, my email is you@example.com". It calls `asc_start_trial`, which unlocks all 41 tools for 7 days with no card and nothing to cancel. The key activates in the running session, so whatever you were blocked on works on the very next call, and it is saved on your machine, in `~/.asc-mcp/license.json` and in any MCP client config that already has an asc-mcp entry, so it survives a restart. One trial per Apple developer account.
92
100
 
93
101
  Works with **Claude Code**, **Cursor**, **Windsurf**, **Cline**, and any MCP-compatible client.
94
102
 
@@ -278,18 +286,19 @@ Lead with the most impactful change. Keep under 4000 chars.
278
286
  | **Git-aware release notes** | No | Yes, reads your project's commit history |
279
287
  | **Smart review summaries** | No | Yes, theme clustering, action items |
280
288
  | **Setup** | Build from source (Swift or Node) | One command, `init --write` writes your config |
281
- | **Free tier** | Some | Yes, 6 tools, no signup. Three of them need nothing but Node |
289
+ | **Free tier** | Some | Yes, 6 tools, no signup. Two of them need nothing but Node |
282
290
  | **Try the paid half** | n/a | 7 days, no card, started from inside your agent |
283
291
 
284
292
  Raw wrappers give you endpoints. This gives you answers.
285
293
 
286
294
  ## Security
287
295
 
288
- Your credentials never leave your machine:
296
+ Your `.p8` private key never leaves your machine:
289
297
 
290
- - The `.p8` private key is read locally. JWT tokens are generated on your computer.
298
+ - The `.p8` private key is read locally. JWT tokens are generated on your computer, and name your Key ID and Issuer ID to Apple, as Apple's API requires.
291
299
  - API calls go directly from your machine to `api.appstoreconnect.apple.com`.
292
- - The license server sees only your license key string. Zero Apple data, zero credentials.
300
+ - The license server is sent your license key string when one is set and, if you start a trial, your email address, a one-way hash of your Issuer ID and the name of the tool you started from. No Apple data and no credentials.
301
+ - Starting a trial, or fetching a paid key with `asc_start_trial`, saves the license key in plain text in `~/.asc-mcp/license.json` (owner-only permissions on macOS and Linux) and adds it as `ASC_LICENSE_KEY` to every asc-mcp entry found in your Claude Desktop, Claude Code (`~/.claude.json`, including per-project entries), `./.mcp.json`, Cursor, Windsurf and Cline configs. Nothing else in those files is changed, and each edited file gets a one-time `.bak` copy beside it, which holds whatever the file held. `~/.asc-mcp/last-verdict.json` holds the last license check and a hash of the key. Delete the file and the `ASC_LICENSE_KEY` lines to remove the key.
293
302
  - Fully open source. [Read the code.](https://github.com/pofky/asc-mcp)
294
303
 
295
304
  ## Works With
@@ -309,9 +318,10 @@ Your credentials never leave your machine:
309
318
  ## Legal
310
319
 
311
320
  - [Privacy Policy](https://asc-mcp-license.remewdy.workers.dev/privacy)
321
+ - [What the server sends, and to whom](plugin/README.md#privacy-policy): the short version
312
322
  - [Terms of Service](https://asc-mcp-license.remewdy.workers.dev/terms)
313
323
 
314
- This project is not affiliated with, endorsed by, or sponsored by Apple Inc. Apple, App Store, App Store Connect, TestFlight, iOS, and macOS are trademarks of Apple Inc.
324
+ This project is not affiliated with, endorsed by, or sponsored by Apple Inc. Apple, App Store, App Store Connect, TestFlight, Xcode, iOS, and macOS are trademarks of Apple Inc.
315
325
 
316
326
  ## License
317
327
 
package/USER_GUIDE.md CHANGED
@@ -35,7 +35,7 @@ Steps:
35
35
 
36
36
  Manual interruptions you must do yourself:
37
37
  - MANUAL: generating the API key and downloading the .p8 is a one-time App Store Connect website action. The .p8 cannot be re-downloaded; if lost, revoke and make a new one.
38
- - Free tier is read/intelligence only. To unlock every write/control tool, call `asc_start_trial` with the user's email: 7 days, no card, and it takes effect in the running session with no restart. After that it is $9/month (ASC_LICENSE_KEY).
38
+ - The free tier is three read tools (list_apps, app_details, review_status); the write, control and intelligence tools need Pro. To unlock all of them, call `asc_start_trial` with the user's email: 7 days, no card, and it takes effect in the running session with no restart. After that it is $9/month (ASC_LICENSE_KEY).
39
39
 
40
40
  ---
41
41
 
package/dist/gate.js CHANGED
@@ -56,7 +56,7 @@ function requirePro(tier, capability, tool) {
56
56
  ` ${upgradeUrl(tool)}\n` +
57
57
  ` (direct link: ${exports.CHECKOUT_URL})\n\n` +
58
58
  "If you already subscribed, call `asc_start_trial` with the same email and it will fetch " +
59
- "your paid key and put it in your config.\n"
59
+ "your paid key and save it on this machine.\n"
60
60
  : "Free for 7 days, no card: call the `asc_start_trial` tool with the user's email. " +
61
61
  "It unlocks all 41 tools in this session immediately, no restart.\n\n" +
62
62
  `Or subscribe now, $9/month: ${upgradeUrl(tool)}\n` +
@@ -85,6 +85,8 @@ function keyAdvice() {
85
85
  // the two populations apart from inside the process.
86
86
  return process.env.ASC_INSTALL === "mcpb"
87
87
  ? "Already have a key? Paste it into Claude Settings > Extensions > asc-mcp > Configure > License key, then Save."
88
- : "Already have a key? Set ASC_LICENSE_KEY in your MCP server config.";
88
+ : process.env.ASC_INSTALL === "plugin"
89
+ ? "Already have a key? Set it as the License key option in the asc-mcp plugin's settings."
90
+ : "Already have a key? Set ASC_LICENSE_KEY in your MCP server config.";
89
91
  }
90
92
  //# sourceMappingURL=gate.js.map
package/dist/gate.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"gate.js","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":";;;AAoBA,gCAGC;AAcD,gCAoCC;AAxED,6CAAkE;AAElE;;;;;;;GAOG;AACU,QAAA,YAAY,GACvB,2EAA2E,CAAC;AAE9E;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,IAAa;IACtC,MAAM,IAAI,GAAG,GAAG,4BAAe,KAAK,CAAC;IACrC,OAAO,IAAI,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,SAAS,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAChF,CAAC;AAED,qEAAqE;AACxD,QAAA,WAAW,GAAG,UAAU,EAAE,CAAC;AAExC;;;;;;;;GAQG;AACH,SAAgB,UAAU,CACxB,IAAU,EACV,UAAkB,EAClB,IAAa;IAEb,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAEhC,8EAA8E;IAC9E,+EAA+E;IAC/E,8EAA8E;IAC9E,MAAM,KAAK,GAAG,IAAA,8BAAiB,GAAE,EAAE,MAAM,KAAK,eAAe,CAAC;IAE9D,6EAA6E;IAC7E,2EAA2E;IAC3E,6EAA6E;IAC7E,8EAA8E;IAC9E,MAAM,MAAM,GAAG,IAAA,8BAAiB,GAAE,EAAE,MAAM,CAAC;IAC3C,MAAM,UAAU,GAAG,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,UAAU,IAAI,MAAM,KAAK,UAAU,CAAC;IAE1F,OAAO,CACL,GAAG,UAAU,oBAAoB;QACjC,CAAC,KAAK,IAAI,UAAU;YAClB,CAAC,CAAC,CAAC,KAAK;gBACJ,CAAC,CAAC,8BAA8B;gBAChC,CAAC,CAAC,gFAAgF,CAAC;gBACrF,qCAAqC;gBACrC,KAAK,UAAU,CAAC,IAAI,CAAC,IAAI;gBACzB,mBAAmB,oBAAY,OAAO;gBACtC,0FAA0F;gBAC1F,4CAA4C;YAC9C,CAAC,CAAC,mFAAmF;gBACnF,sEAAsE;gBACtE,+BAA+B,UAAU,CAAC,IAAI,CAAC,IAAI;gBACnD,iBAAiB,oBAAY,KAAK,CAAC;QACvC,KAAK,SAAS,EAAE,EAAE,CACnB,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,SAAS;IAChB,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACpD,IAAI,MAAM,IAAI,IAAA,8BAAiB,GAAE,KAAK,IAAI,EAAE,CAAC;QAC3C,OAAO,CACL,qFAAqF;YACrF,iFAAiF;YACjF,GAAG,4BAAe,SAAS,CAC5B,CAAC;IACJ,CAAC;IACD,wEAAwE;IACxE,8EAA8E;IAC9E,2EAA2E;IAC3E,2EAA2E;IAC3E,qDAAqD;IACrD,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,MAAM;QACvC,CAAC,CAAC,gHAAgH;QAClH,CAAC,CAAC,oEAAoE,CAAC;AAC3E,CAAC"}
1
+ {"version":3,"file":"gate.js","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":";;;AAoBA,gCAGC;AAcD,gCAoCC;AAxED,6CAAkE;AAElE;;;;;;;GAOG;AACU,QAAA,YAAY,GACvB,2EAA2E,CAAC;AAE9E;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,IAAa;IACtC,MAAM,IAAI,GAAG,GAAG,4BAAe,KAAK,CAAC;IACrC,OAAO,IAAI,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,SAAS,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAChF,CAAC;AAED,qEAAqE;AACxD,QAAA,WAAW,GAAG,UAAU,EAAE,CAAC;AAExC;;;;;;;;GAQG;AACH,SAAgB,UAAU,CACxB,IAAU,EACV,UAAkB,EAClB,IAAa;IAEb,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAEhC,8EAA8E;IAC9E,+EAA+E;IAC/E,8EAA8E;IAC9E,MAAM,KAAK,GAAG,IAAA,8BAAiB,GAAE,EAAE,MAAM,KAAK,eAAe,CAAC;IAE9D,6EAA6E;IAC7E,2EAA2E;IAC3E,6EAA6E;IAC7E,8EAA8E;IAC9E,MAAM,MAAM,GAAG,IAAA,8BAAiB,GAAE,EAAE,MAAM,CAAC;IAC3C,MAAM,UAAU,GAAG,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,UAAU,IAAI,MAAM,KAAK,UAAU,CAAC;IAE1F,OAAO,CACL,GAAG,UAAU,oBAAoB;QACjC,CAAC,KAAK,IAAI,UAAU;YAClB,CAAC,CAAC,CAAC,KAAK;gBACJ,CAAC,CAAC,8BAA8B;gBAChC,CAAC,CAAC,gFAAgF,CAAC;gBACrF,qCAAqC;gBACrC,KAAK,UAAU,CAAC,IAAI,CAAC,IAAI;gBACzB,mBAAmB,oBAAY,OAAO;gBACtC,0FAA0F;gBAC1F,8CAA8C;YAChD,CAAC,CAAC,mFAAmF;gBACnF,sEAAsE;gBACtE,+BAA+B,UAAU,CAAC,IAAI,CAAC,IAAI;gBACnD,iBAAiB,oBAAY,KAAK,CAAC;QACvC,KAAK,SAAS,EAAE,EAAE,CACnB,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,SAAS;IAChB,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACpD,IAAI,MAAM,IAAI,IAAA,8BAAiB,GAAE,KAAK,IAAI,EAAE,CAAC;QAC3C,OAAO,CACL,qFAAqF;YACrF,iFAAiF;YACjF,GAAG,4BAAe,SAAS,CAC5B,CAAC;IACJ,CAAC;IACD,wEAAwE;IACxE,8EAA8E;IAC9E,2EAA2E;IAC3E,2EAA2E;IAC3E,qDAAqD;IACrD,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,MAAM;QACvC,CAAC,CAAC,gHAAgH;QAClH,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,QAAQ;YACpC,CAAC,CAAC,wFAAwF;YAC1F,CAAC,CAAC,oEAAoE,CAAC;AAC7E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAgDA;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,MAOzB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAiDA;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,MAOzB,CAAC"}
package/dist/index.js CHANGED
@@ -45,6 +45,7 @@ const node_fs_1 = require("node:fs");
45
45
  const node_path_1 = require("node:path");
46
46
  const gate_js_1 = require("./gate.js");
47
47
  const instructions_js_1 = require("./instructions.js");
48
+ const tool_meta_js_1 = require("./tool-meta.js");
48
49
  /**
49
50
  * Read from package.json rather than a literal. A hand-maintained constant
50
51
  * drifts: 1.8.6 shipped announcing itself as 1.8.5 to every client handshake,
@@ -59,6 +60,44 @@ exports.SERVER_VERSION = (() => {
59
60
  return "0.0.0";
60
61
  }
61
62
  })();
63
+ /**
64
+ * A plugin or bundle declares its settings as template fields, and an optional
65
+ * field the user leaves blank can reach the process as an empty string or as
66
+ * the literal `${user_config.asc_license_key}`. Neither is a value. Dropping
67
+ * them here, once, before anything dispatches, means the server, `doctor` and
68
+ * the Pro gate all see "not set" instead of a key that will not validate or a
69
+ * path that does not exist.
70
+ */
71
+ for (const name of Object.keys(process.env)) {
72
+ if (!name.startsWith("ASC_"))
73
+ continue;
74
+ const value = process.env[name] ?? "";
75
+ if (!value.trim() || value.includes("${"))
76
+ delete process.env[name];
77
+ }
78
+ // The key the client itself handed over, before a saved one can stand in for
79
+ // it. `asc_start_trial` needs to know the difference: a key set in the client's
80
+ // own settings is the one that will be used after a restart, whatever this
81
+ // server saves, so a subscriber who fetches a paid key while an old one is
82
+ // still set there has to be told to replace it.
83
+ const licenseKeyFromClient = process.env.ASC_LICENSE_KEY;
84
+ // A key this server saved on this machine stands in when the client config
85
+ // carries none. The config always wins, so someone who sets a paid key by hand
86
+ // is never overruled by an older trial key on disk. Not for `init`: that
87
+ // writes whatever key it is given into a client config and announces Pro, and
88
+ // it should only do that with a key the person supplied on this run.
89
+ if (!process.env.ASC_LICENSE_KEY && process.argv[2] !== "init") {
90
+ const saved = (0, license_js_1.savedLicenseKey)();
91
+ if (saved)
92
+ process.env.ASC_LICENSE_KEY = saved;
93
+ }
94
+ /**
95
+ * Register a tool with the title and read/write hints tool-meta.ts holds for
96
+ * it. The name is typed, so a tool with no row there does not compile.
97
+ */
98
+ function annotated(server) {
99
+ return (name, description, inputSchema, handler) => server.registerTool(name, { ...(0, tool_meta_js_1.toolMeta)(name), description, inputSchema }, handler);
100
+ }
62
101
  const MISSING_CREDS_MESSAGE = "Missing App Store Connect credentials.\n\n" +
63
102
  "Fastest path: run `npx @pofky/asc-mcp init` (auto-detects your .p8, prints a paste-ready config).\n\n" +
64
103
  "Or set manually:\n" +
@@ -105,8 +144,9 @@ async function runSetupMode() {
105
144
  instructions: "asc-mcp, running in SETUP MODE: no App Store Connect credentials were found, so only asc_setup_check and asc_guide are available. Call asc_setup_check first and relay the fix it prints. Once credentials are in place and the user restarts this server, the full tool set appears; the write and control tools then need Pro, which asc_start_trial unlocks free for 7 days.",
106
145
  });
107
146
  const text = (t) => ({ content: [{ type: "text", text: t }] });
108
- server.tool("asc_setup_check", "Diagnose your setup: checks the .p8 key, Key ID, Issuer ID, a LIVE authenticated connection to App Store Connect, and your license tier. For anything wrong, returns the exact fix. Run this first if something isn't working. Free.", {}, async () => text((0, doctor_js_1.formatDoctor)(await (0, doctor_js_1.runDoctor)())));
109
- server.tool("asc_guide", "START HERE. Returns the exact end-to-end playbook for an App Store task, with every manual ASC-website/Xcode step that no API can do flagged inline. Free.", { topic: zod_1.z.string().optional().describe("Which playbook. Omit for the overview + topic list.") }, async (args) => text(await (0, guide_js_1.ascGuide)(args)));
147
+ const tool = annotated(server);
148
+ tool("asc_setup_check", "Diagnose your setup: checks the .p8 key, Key ID, Issuer ID, a LIVE authenticated connection to App Store Connect, and your license tier. For anything wrong, returns the exact fix. Run this first if something isn't working. Free.", {}, async () => text((0, doctor_js_1.formatDoctor)(await (0, doctor_js_1.runDoctor)())));
149
+ tool("asc_guide", "START HERE. Returns the exact end-to-end playbook for an App Store task, with every manual ASC-website/Xcode step that no API can do flagged inline. Free.", { topic: zod_1.z.string().optional().describe("Which playbook. Omit for the overview + topic list.") }, async (args) => text(await (0, guide_js_1.ascGuide)(args)));
110
150
  await server.connect(new stdio_js_1.StdioServerTransport());
111
151
  }
112
152
  async function main() {
@@ -145,6 +185,7 @@ async function main() {
145
185
  instructions: instructions_js_1.BASE_INSTRUCTIONS + (tier === "pro" ? "" : instructions_js_1.FREE_TIER_INSTRUCTIONS),
146
186
  });
147
187
  // --- Free tools ---
188
+ const tool = annotated(server);
148
189
  /** Wrap a tool handler so API errors return messages instead of crashing. */
149
190
  function safe(fn) {
150
191
  return async (...a) => {
@@ -157,7 +198,7 @@ async function main() {
157
198
  }
158
199
  };
159
200
  }
160
- server.tool("asc_guide", "START HERE. Returns the exact end-to-end playbook for an App Store task, with every manual ASC-website/Xcode step that no API can do flagged inline. Call with topic to orient before any multi-step flow. Free.", {
201
+ tool("asc_guide", "START HERE. Returns the exact end-to-end playbook for an App Store task, with every manual ASC-website/Xcode step that no API can do flagged inline. Call with topic to orient before any multi-step flow. Free.", {
161
202
  topic: zod_1.z
162
203
  .enum([
163
204
  "overview",
@@ -175,14 +216,14 @@ async function main() {
175
216
  .optional()
176
217
  .describe("Which playbook. Omit for the overview + topic list."),
177
218
  }, safe((args) => (0, guide_js_1.ascGuide)(args)));
178
- server.tool("asc_setup_check", "Diagnose your setup: checks the .p8 key, Key ID, Issuer ID, a LIVE authenticated connection to App Store Connect, and your license tier. For anything wrong, returns the exact fix. Run this first if something isn't working. Free.", {}, safe(async () => (0, doctor_js_1.formatDoctor)(await (0, doctor_js_1.runDoctor)())));
219
+ tool("asc_setup_check", "Diagnose your setup: checks the .p8 key, Key ID, Issuer ID, a LIVE authenticated connection to App Store Connect, and your license tier. For anything wrong, returns the exact fix. Run this first if something isn't working. Free.", {}, safe(async () => (0, doctor_js_1.formatDoctor)(await (0, doctor_js_1.runDoctor)())));
179
220
  server.registerTool("asc_start_trial", {
180
- title: "Start a free 7-day Pro trial",
221
+ ...(0, tool_meta_js_1.toolMeta)("asc_start_trial"),
181
222
  description: "Start a free 7-day Pro trial, no credit card, unlocking all 41 tools including the full write/control plane. Call this when a Pro tool is refused and the user wants to proceed, and also when they ask for something only a Pro tool can do (editing metadata, screenshots, builds, TestFlight, IAP, submitting, releasing, preflight, briefings, keyword or review intelligence) before you hit the refusal. Either way, ask for their email address first and never invent one. The trial activates in THIS session immediately, so you can retry the tool that was blocked without any restart. Free.",
182
223
  inputSchema: {
183
224
  email: zod_1.z
184
225
  .string()
185
- .describe("The user's email address. Required: the trial key is sent there so they still have it later. Ask the user for it; never invent one. Tell them what the request stores: this address and a one-way hash of their Issuer ID, nothing else, and both are deletable at https://asc-mcp-license.remewdy.workers.dev/delete (policy: https://asc-mcp-license.remewdy.workers.dev/privacy)."),
226
+ .describe("The user's email address. Required: the trial key is sent there so they still have it later. Ask the user for it; never invent one. Tell them what the request stores: this address, a one-way hash of their Issuer ID, the trial key with its start and end dates, and which tool they started from. Tell them the address gets the key, one reminder shortly before the trial ends and one note after it, and that each has an unsubscribe link or they can reply stop. Tell them it also saves the key on this machine (~/.asc-mcp/license.json) and adds it to any existing asc-mcp entry in their MCP client configs, leaving a .bak copy of each file it edits. All of it is deletable at https://asc-mcp-license.remewdy.workers.dev/delete (policy: https://asc-mcp-license.remewdy.workers.dev/privacy)."),
186
227
  tool: zod_1.z
187
228
  .string()
188
229
  .optional()
@@ -210,29 +251,56 @@ async function main() {
210
251
  tier = "pro";
211
252
  process.env.ASC_LICENSE_KEY = result.key;
212
253
  (0, license_js_1.clearLicenseCache)();
254
+ // Two places, on purpose. The client config is where someone looks for
255
+ // the key and what carries it to a reinstall; the file in ~/.asc-mcp is
256
+ // what makes it survive a restart in a client whose config this cannot
257
+ // find or edit. Either alone has left people on the free tier.
213
258
  const { updated, skipped } = (0, setup_js_1.injectLicenseKey)(result.key);
259
+ const savedLocally = (0, license_js_1.saveLicenseKey)(result.key);
260
+ // Where the key goes by hand, for this kind of install. A one-click
261
+ // install has no server block in any client config file: Claude Desktop
262
+ // keeps an extension's settings in its own registry, and a plugin keeps
263
+ // them in the plugin's options. Telling either to hand-edit JSON sends
264
+ // them looking for a file that does not exist. The manifests set
265
+ // ASC_INSTALL so the populations can be told apart.
266
+ const whereByHand = process.env.ASC_INSTALL === "mcpb"
267
+ ? "Claude Settings > Extensions > asc-mcp > Configure > License key, then Save."
268
+ : process.env.ASC_INSTALL === "plugin"
269
+ ? "the License key option in the asc-mcp plugin's settings."
270
+ : "the ASC_LICENSE_KEY line in your client's MCP config.";
271
+ // A key the client supplies always wins over the saved file. If one is
272
+ // set there, is not this key, and no config was rewritten, the next
273
+ // session starts on the old key: for a subscriber replacing a trial key,
274
+ // that is the free tier, after being told the key was saved.
275
+ // A bundle or a plugin keeps its key where no config edit reaches, so for
276
+ // those a rewritten config elsewhere (a Cursor file, say) changes nothing
277
+ // about which key this client starts with.
278
+ const clientKeyOutOfReach = process.env.ASC_INSTALL === "mcpb" || process.env.ASC_INSTALL === "plugin";
279
+ const staleClientKey = Boolean(licenseKeyFromClient) &&
280
+ licenseKeyFromClient !== result.key &&
281
+ (clientKeyOutOfReach || !updated.length);
282
+ const staleWarning = `A different key is set in your client's own settings, and that one is used after a restart. Replace it with the key above: ${whereByHand}`;
283
+ const inWorkingDir = updated.filter((path) => path === (0, node_path_1.join)(process.cwd(), ".mcp.json"));
214
284
  const persistence = updated.length
215
- ? `Saved to ${updated.join(", ")} (backup alongside), so it survives a restart.`
216
- : // A one-click install has no server block in any client config file:
217
- // Claude Desktop keeps an extension's settings in its own registry, and
218
- // the key belongs in the extension's own License key field. Telling a
219
- // bundle user to hand-edit JSON sends them looking for a file that does
220
- // not exist, right after they chose the install path that exists to
221
- // avoid JSON entirely. The manifest sets ASC_INSTALL so this branch can
222
- // tell the two populations apart.
223
- process.env.ASC_INSTALL === "mcpb"
224
- ? "To keep it after a restart, paste it into the extension's own settings: " +
225
- "Claude Settings > Extensions > asc-mcp > Configure > License key, then Save."
226
- : "Could not find an asc-mcp block in a known client config, so add ASC_LICENSE_KEY yourself to keep it after a restart:\n" +
227
- ` "ASC_LICENSE_KEY": "${result.key}"`;
285
+ ? `Saved to ${updated.join(", ")} (backup alongside)` +
286
+ (savedLocally ? ` and to ${(0, license_js_1.savedLicenseKeyPath)()}` : "") +
287
+ (staleClientKey ? `. ${staleWarning}` : ", so it survives a restart.") +
288
+ (inWorkingDir.length
289
+ ? ` ${inWorkingDir.join(", ")} is in this project folder and is often committed: keep the key and the .bak out of version control.`
290
+ : "")
291
+ : savedLocally
292
+ ? `Saved on this machine in ${(0, license_js_1.savedLicenseKeyPath)()}` +
293
+ (staleClientKey
294
+ ? `. ${staleWarning}`
295
+ : ", so it survives a restart. To use it on another machine, set ASC_LICENSE_KEY there.")
296
+ : "It could not be saved on this machine. To keep it after a restart, set it in " + whereByHand;
228
297
  return text([
229
298
  result.subscription
230
299
  ? // Deliberately says nothing about replacing a trial key. Most
231
300
  // subscribers never trialled at all (every live subscription has
232
301
  // a null trial_fingerprint), and telling those people their trial
233
302
  // key was swapped out describes a key they never had.
234
- "You already subscribed, so this is your paid license key, not a trial. " +
235
- "It is now in your config, replacing whatever key was there."
303
+ "You already subscribed, so this is your paid license key, not a trial."
236
304
  : result.already_started
237
305
  ? `Trial already running: ${result.days_remaining} day(s) left.`
238
306
  : `Pro trial started. ${result.days_remaining} day(s), no card, nothing to cancel.`,
@@ -242,9 +310,14 @@ async function main() {
242
310
  skipped.length ? `Left untouched: ${skipped.join(", ")}` : "",
243
311
  "",
244
312
  "All 41 tools are unlocked in this session right now. Retry what you were doing.",
245
- "Stored: your email and a one-way hash of your Issuer ID. Nothing else. " +
246
- "Delete both at https://asc-mcp-license.remewdy.workers.dev/delete , policy at " +
247
- "https://asc-mcp-license.remewdy.workers.dev/privacy",
313
+ result.subscription
314
+ ? "Stored: a one-way hash of your Issuer ID against your subscription, so nobody else can " +
315
+ "fetch this key with your email. Policy at https://asc-mcp-license.remewdy.workers.dev/privacy"
316
+ : "Stored: your email, a one-way hash of your Issuer ID, the trial key with its start and " +
317
+ "end dates, and the tool you started from. Your email is used to send the key, one " +
318
+ "reminder shortly before the trial ends and one note after it; each has an unsubscribe " +
319
+ "link, or reply stop. Delete everything at https://asc-mcp-license.remewdy.workers.dev/delete , " +
320
+ "policy at https://asc-mcp-license.remewdy.workers.dev/privacy",
248
321
  result.subscription || !result.checkout_url
249
322
  ? ""
250
323
  : `When the trial ends, Pro is $9/month: ${result.checkout_url}`,
@@ -252,18 +325,18 @@ async function main() {
252
325
  .filter(Boolean)
253
326
  .join("\n"));
254
327
  });
255
- server.tool("list_apps", "List all apps in your App Store Connect account with name, bundle ID, SKU and App ID.", { limit: zod_1.z.number().optional().describe("Max apps to return (default 50, max 200)") }, safe((args) => (0, list_apps_js_1.listApps)(client, args)));
256
- server.tool("app_details", "Get detailed info about an app including versions, build status, and release state.", { app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID (use list_apps to find it)") }, safe((args) => (0, app_details_js_1.appDetails)(client, args)));
257
- server.tool("review_status", "Check the current App Store review status - in review, waiting, approved, or rejected.", { app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID") }, safe((args) => (0, review_status_js_1.reviewStatus)(client, args)));
328
+ tool("list_apps", "List all apps in your App Store Connect account with name, bundle ID, SKU and App ID.", { limit: zod_1.z.number().optional().describe("Max apps to return (default 50, max 200)") }, safe((args) => (0, list_apps_js_1.listApps)(client, args)));
329
+ tool("app_details", "Get detailed info about an app including versions, build status, and release state.", { app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID (use list_apps to find it)") }, safe((args) => (0, app_details_js_1.appDetails)(client, args)));
330
+ tool("review_status", "Check the current App Store review status - in review, waiting, approved, or rejected.", { app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID") }, safe((args) => (0, review_status_js_1.reviewStatus)(client, args)));
258
331
  // --- Pro tools (gated) ---
259
- server.tool("list_reviews", "List customer reviews for an app. Filter by rating. Pro feature.", {
332
+ tool("list_reviews", "List customer reviews for an app. Filter by rating. Pro feature.", {
260
333
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
261
334
  rating: zod_1.z.number().min(1).max(5).optional().describe("Filter by star rating (1-5)"),
262
335
  limit: zod_1.z.number().optional().describe("Max reviews (default 20, max 100)"),
263
336
  sort: zod_1.z.enum(["newest", "oldest", "rating_high", "rating_low"]).optional()
264
337
  .describe("Sort order (default: newest)"),
265
338
  }, safe((args) => (0, list_reviews_js_1.listReviews)(client, args, tier)));
266
- server.tool("sales_report", "Download sales/downloads summary. Shows units, proceeds, territory. Pro feature.", {
339
+ tool("sales_report", "Download sales/downloads summary. Shows units, proceeds, territory. Pro feature.", {
267
340
  vendor_number: zod_1.z.string().optional()
268
341
  .describe("Vendor number (8-9 digits) from App Store Connect > Sales and Trends. Omit to be told where to find it."),
269
342
  frequency: zod_1.z.enum(["DAILY", "WEEKLY", "MONTHLY", "YEARLY"]).optional()
@@ -272,27 +345,27 @@ async function main() {
272
345
  .describe("Date in YYYY-MM-DD (daily) or YYYY-MM (monthly). Default: yesterday."),
273
346
  }, safe((args) => (0, sales_report_js_1.salesReport)(client, args, tier)));
274
347
  // --- Intelligence tools (Pro) ---
275
- server.tool("release_preflight", "Pre-submission audit: checks metadata, character limits, screenshots, build status. Catches rejection causes before you submit. Pro feature.", { app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID") }, safe((args) => (0, release_preflight_js_1.releasePreflight)(client, args, tier)));
276
- server.tool("daily_briefing", "Morning briefing across all apps: version status, recent reviews, rejections, action items. One call for full situational awareness. Pro feature.", { days: zod_1.z.number().optional().describe("Look back N days for reviews (default 3)") }, safe((args) => (0, daily_briefing_js_1.dailyBriefing)(client, args, tier)));
277
- server.tool("release_notes", "Extract git commits since last tag and return structured data for writing App Store 'What's New' text. Categorizes changes and provides writing guidelines. Pro feature.", {
348
+ tool("release_preflight", "Pre-submission audit: checks metadata, character limits, screenshots, build status. Catches rejection causes before you submit. Pro feature.", { app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID") }, safe((args) => (0, release_preflight_js_1.releasePreflight)(client, args, tier)));
349
+ tool("daily_briefing", "Morning briefing across all apps: version status, recent reviews, rejections, action items. One call for full situational awareness. Pro feature.", { days: zod_1.z.number().optional().describe("Look back N days for reviews (default 3)") }, safe((args) => (0, daily_briefing_js_1.dailyBriefing)(client, args, tier)));
350
+ tool("release_notes", "Extract git commits since last tag and return structured data for writing App Store 'What's New' text. Categorizes changes and provides writing guidelines. Pro feature.", {
278
351
  project_path: zod_1.z.string().optional().describe("Path to git project (default: current directory)"),
279
352
  since_tag: zod_1.z.string().optional().describe("Git tag to diff from (default: latest tag)"),
280
- max_commits: zod_1.z.number().optional().describe("Max commits to include (default 50)"),
353
+ max_commits: zod_1.z.number().optional().describe("Max commits to include (default 50, at most 500)"),
281
354
  }, safe((args) => (0, release_notes_js_1.releaseNotes)(args, tier)));
282
- server.tool("keyword_insights", "Analyze your app's keywords against search competition. Shows difficulty, competing apps, and budget usage. Uses iTunes Search API. Pro feature.", {
355
+ tool("keyword_insights", "Analyze your app's keywords against search competition. Shows difficulty, competing apps, and budget usage. Uses iTunes Search API. Pro feature.", {
283
356
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
284
357
  extra_keywords: zod_1.z.string().optional().describe("Extra comma-separated keywords to analyze beyond current metadata"),
285
358
  }, safe((args) => (0, keyword_insights_js_1.keywordInsights)(client, args, tier)));
286
- server.tool("competitor_snapshot", "Look up any app on the App Store: ratings, reviews, version, price, category, release notes. Search by name or App Store ID. Pro feature.", {
359
+ tool("competitor_snapshot", "Look up any app on the App Store: ratings, reviews, version, price, category, release notes. Search by name or App Store ID. Pro feature.", {
287
360
  query: zod_1.z.string().describe('App name (e.g. "Medisafe") or numeric App Store ID'),
288
361
  country: zod_1.z.string().optional().describe("Two-letter country code (default: us)"),
289
362
  }, safe((args) => (0, competitor_snapshot_js_1.competitorSnapshot)(args, tier)));
290
- server.tool("metadata_diff", "Compare metadata between your live and pending app versions. Shows what changed in descriptions, keywords, and release notes across locales. Pro feature.", {
363
+ tool("metadata_diff", "Compare metadata between your live and pending app versions. Shows what changed in descriptions, keywords, and release notes across locales. Pro feature.", {
291
364
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
292
365
  }, safe((args) => (0, metadata_diff_js_1.metadataDiff)(client, args, tier)));
293
366
  // --- Sampling-powered tools (Pro) ---
294
367
  server.registerTool("triage_reviews", {
295
- title: "Triage reviews into themes (Sampling)",
368
+ ...(0, tool_meta_js_1.toolMeta)("triage_reviews"),
296
369
  description: "Pull recent App Store reviews and use MCP Sampling to cluster them into 3 to 5 themes with counts, representative quotes, and action buckets (bug, missing_feature, pricing, ux, content). Sampling uses your own MCP client's model, so there is no extra cost from this server. Pro feature.",
297
370
  inputSchema: {
298
371
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
@@ -314,7 +387,7 @@ async function main() {
314
387
  }
315
388
  });
316
389
  server.registerTool("draft_review_response", {
317
- title: "Draft a public response to a review (Sampling + Elicitation)",
390
+ ...(0, tool_meta_js_1.toolMeta)("draft_review_response"),
318
391
  description: "Draft a public reply to a single App Store review via MCP Sampling, in the review's locale. Uses Elicitation (if your client supports it) to ask for tone. NEVER auto-posts. Always returns a draft that you must post via App Store Connect yourself. Pro feature.",
319
392
  inputSchema: {
320
393
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
@@ -340,7 +413,7 @@ async function main() {
340
413
  }
341
414
  });
342
415
  // --- Control / write tools (Pro, gated) ---
343
- server.tool("update_version_metadata", "Edit App Store metadata on the editable version: description, keywords, what's-new, promotional text, marketing/support/privacy-policy URLs, plus app name and subtitle. Validates Apple character limits before writing. Pro feature.", {
416
+ tool("update_version_metadata", "Edit App Store metadata on the editable version: description, keywords, what's-new, promotional text, marketing/support/privacy-policy URLs, plus app name and subtitle. Validates Apple character limits before writing. Pro feature.", {
344
417
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
345
418
  locale: zod_1.z.string().optional().describe("Locale to edit (e.g. en-US). Default: first/primary locale."),
346
419
  description: zod_1.z.string().optional().describe("App description (max 4000 chars)"),
@@ -353,61 +426,61 @@ async function main() {
353
426
  subtitle: zod_1.z.string().optional().describe("App subtitle (max 30 chars)"),
354
427
  privacy_policy_url: zod_1.z.string().optional().describe("Privacy policy URL (shown on the App Store listing)"),
355
428
  }, safe((args) => (0, update_version_metadata_js_1.updateVersionMetadata)(client, args, tier)));
356
- server.tool("create_version", "Create a new editable App Store version to prepare your next release. Needs confirm:true, because Apple only allows deleting an app's very first version, so this cannot be undone. Pro feature.", {
429
+ tool("create_version", "Create a new editable App Store version to prepare your next release. Needs confirm:true, because Apple only allows deleting an app's very first version, so this cannot be undone. Pro feature.", {
357
430
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
358
431
  version_string: zod_1.z.string().describe("Version number, e.g. 2.5.0"),
359
432
  platform: zod_1.z.enum(["IOS", "MAC_OS", "TV_OS", "VISION_OS"]).optional().describe("Platform (default IOS)"),
360
433
  copyright: zod_1.z.string().optional().describe("Copyright line, e.g. 2026 Your Company"),
361
434
  confirm: zod_1.z.boolean().optional().describe("Required. Creating a version on a live app record cannot be undone."),
362
435
  }, safe((args) => (0, version_control_js_1.createVersion)(client, args, tier)));
363
- server.tool("submit_for_review", "Submit the editable version to Apple App Review. First submits any READY_TO_SUBMIT in-app purchases/subscriptions, then the version. If the app's FIRST in-app purchase is detected (which Apple requires be bundled with the version in the website), it ABORTS without submitting and returns the manual steps, so nothing is orphaned. Outward-facing action: requires confirm:true. Pro feature.", {
436
+ tool("submit_for_review", "Submit the editable version to Apple App Review. First submits any READY_TO_SUBMIT in-app purchases/subscriptions, then the version. If the app's FIRST in-app purchase is detected (which Apple requires be bundled with the version in the website), it ABORTS without submitting and returns the manual steps, so nothing is orphaned. Outward-facing action: requires confirm:true. Pro feature.", {
364
437
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
365
438
  platform: zod_1.z.enum(["IOS", "MAC_OS", "TV_OS", "VISION_OS"]).optional().describe("Platform (default IOS)"),
366
439
  confirm: zod_1.z.boolean().optional().describe("Must be true to actually submit to App Review."),
367
440
  }, safe((args) => (0, version_control_js_1.submitForReview)(client, args, tier)));
368
- server.tool("list_builds", "List recent builds for an app with processing state (VALID = ready to use). Pro feature.", {
441
+ tool("list_builds", "List recent builds for an app with processing state (VALID = ready to use). Pro feature.", {
369
442
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
370
443
  limit: zod_1.z.number().optional().describe("Max builds (default 10, max 50)"),
371
444
  }, safe((args) => (0, builds_js_1.listBuilds)(client, args, tier)));
372
- server.tool("wait_for_build", "Poll until the newest uploaded build finishes processing (VALID), so the ship flow is one call. Blocks for up to 30 minutes by default; if you should not hold the session that long, call list_builds yourself instead. Pro feature.", {
445
+ tool("wait_for_build", "Poll until the newest uploaded build finishes processing (VALID), so the ship flow is one call. Blocks for up to 30 minutes by default; if you should not hold the session that long, call list_builds yourself instead. Pro feature.", {
373
446
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
374
447
  max_wait_seconds: zod_1.z.number().optional().describe("Max seconds to wait (default 1800, cap 3600)"),
375
448
  poll_seconds: zod_1.z.number().optional().describe("Seconds between polls (default 30, min 10)"),
376
449
  }, safe((args) => (0, builds_js_1.waitForBuild)(client, args, tier)));
377
- server.tool("attach_build", "Attach a build to the editable version (defaults to the newest processed build). Pro feature.", {
450
+ tool("attach_build", "Attach a build to the editable version (defaults to the newest processed build). Pro feature.", {
378
451
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
379
452
  build_id: zod_1.z.string().optional().describe("Specific build ID (from list_builds). Omit for newest VALID build."),
380
453
  }, safe((args) => (0, builds_js_1.attachBuild)(client, args, tier)));
381
- server.tool("upload_screenshots", "Upload screenshots to a version localization for a device display type (e.g. APP_IPHONE_67). Handles Apple's reserve/upload/commit flow. Pro feature.", {
454
+ tool("upload_screenshots", "Upload screenshots to a version localization for a device display type (e.g. APP_IPHONE_67). Handles Apple's reserve/upload/commit flow. Pro feature.", {
382
455
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
383
456
  display_type: zod_1.z.string().describe("Device display type, e.g. APP_IPHONE_67, APP_IPHONE_65, APP_IPAD_PRO_129"),
384
457
  files: zod_1.z.array(zod_1.z.string()).describe("Absolute paths to PNG/JPEG screenshot files, in order"),
385
458
  locale: zod_1.z.string().optional().describe("Locale (e.g. en-US). Default: first/primary locale."),
386
459
  }, safe((args) => (0, screenshots_js_1.uploadScreenshots)(client, args, tier)));
387
- server.tool("release_version", "Release an approved version (state PENDING_DEVELOPER_RELEASE) to the public App Store. Outward-facing: requires confirm:true. Pro feature.", {
460
+ tool("release_version", "Release an approved version (state PENDING_DEVELOPER_RELEASE) to the public App Store. Outward-facing: requires confirm:true. Pro feature.", {
388
461
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
389
462
  confirm: zod_1.z.boolean().optional().describe("Must be true to actually release."),
390
463
  }, safe((args) => (0, release_control_js_1.releaseVersion)(client, args, tier)));
391
- server.tool("manage_phased_release", "Control the 7-day phased rollout: start, pause, resume, or complete (release to 100%). Pro feature.", {
464
+ tool("manage_phased_release", "Control the 7-day phased rollout: start, pause, resume, or complete (release to 100%). Pro feature.", {
392
465
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
393
466
  action: zod_1.z.enum(["start", "pause", "resume", "complete"]).describe("Phased release action"),
394
467
  confirm: zod_1.z.boolean().optional().describe("Required. These change how a live version reaches the public; complete is irreversible."),
395
468
  }, safe((args) => (0, release_control_js_1.managePhasedRelease)(client, args, tier)));
396
- server.tool("list_beta_groups", "List TestFlight beta groups for an app. Pro feature.", { app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID") }, safe((args) => (0, testflight_js_1.listBetaGroups)(client, args, tier)));
397
- server.tool("assign_build_to_group", "Assign a build to a TestFlight beta group so testers can install it (defaults to newest processed build). Needs confirm:true: Apple notifies every tester immediately and the notification cannot be recalled. Pro feature.", {
469
+ tool("list_beta_groups", "List TestFlight beta groups for an app. Pro feature.", { app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID") }, safe((args) => (0, testflight_js_1.listBetaGroups)(client, args, tier)));
470
+ tool("assign_build_to_group", "Assign a build to a TestFlight beta group so testers can install it (defaults to newest processed build). Needs confirm:true: Apple notifies every tester immediately and the notification cannot be recalled. Pro feature.", {
398
471
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
399
472
  group_id: zod_1.z.string().describe("Beta group ID (from list_beta_groups)"),
400
473
  build_id: zod_1.z.string().optional().describe("Specific build ID. Omit for newest VALID build."),
401
474
  confirm: zod_1.z.boolean().optional().describe("Required. Every tester in the group is notified immediately."),
402
475
  }, safe((args) => (0, testflight_js_1.assignBuildToGroup)(client, args, tier)));
403
- server.tool("invite_beta_tester", "Invite an external tester by email and add them to a beta group. Needs confirm:true: Apple emails a real person from your account and it cannot be recalled. Pro feature.", {
476
+ tool("invite_beta_tester", "Invite an external tester by email and add them to a beta group. Needs confirm:true: Apple emails a real person from your account and it cannot be recalled. Pro feature.", {
404
477
  group_id: zod_1.z.string().describe("Beta group ID (from list_beta_groups)"),
405
478
  email: zod_1.z.string().describe("Tester email address"),
406
479
  first_name: zod_1.z.string().optional().describe("Tester first name"),
407
480
  last_name: zod_1.z.string().optional().describe("Tester last name"),
408
481
  confirm: zod_1.z.boolean().optional().describe("Required. Sends a real email to this address, immediately."),
409
482
  }, safe((args) => (0, testflight_js_1.inviteBetaTester)(client, args, tier)));
410
- server.tool("build_and_archive", "Build, archive, and export a signed .ipa via xcodebuild (requires Xcode on this Mac). Needs a scheme and an ExportOptions.plist. Pro feature.", {
483
+ tool("build_and_archive", "Build, archive, and export a signed .ipa via xcodebuild (requires Xcode on this Mac). Needs a scheme and an ExportOptions.plist. Pro feature.", {
411
484
  project_path: zod_1.z.string().describe("Path to .xcodeproj or .xcworkspace"),
412
485
  scheme: zod_1.z.string().describe("Xcode scheme to build"),
413
486
  export_options_plist: zod_1.z.string().describe("Path to ExportOptions.plist (method app-store-connect)"),
@@ -415,25 +488,25 @@ async function main() {
415
488
  configuration: zod_1.z.string().optional().describe("Build configuration (default Release)"),
416
489
  output_dir: zod_1.z.string().optional().describe("Output directory (default ./build)"),
417
490
  }, safe((args) => (0, local_build_js_1.buildAndArchive)(args, tier)));
418
- server.tool("upload_binary", "Upload a signed .ipa to App Store Connect via altool, using your API key. Outward-facing: requires confirm:true. Pro feature.", {
491
+ tool("upload_binary", "Upload a signed .ipa to App Store Connect via altool, using your API key. Outward-facing: requires confirm:true. Pro feature.", {
419
492
  ipa_path: zod_1.z.string().describe("Absolute path to the .ipa to upload"),
420
493
  platform: zod_1.z.string().optional().describe("Platform: ios, macos, or tvos (default ios)"),
421
494
  confirm: zod_1.z.boolean().optional().describe("Must be true to actually upload."),
422
495
  }, safe((args) => (0, local_build_js_1.uploadBinary)({ keyId: config.keyId, issuerId: config.issuerId }, args, tier)));
423
- server.tool("set_age_rating", "Set the app's age-rating content declarations (Apple computes 4+/9+/12+/17+). Pass a declarations map, e.g. { medicalOrTreatmentInformation: \"INFREQUENT_OR_MILD\" }. Pro feature.", {
496
+ tool("set_age_rating", "Set the app's age-rating content declarations (Apple computes 4+/9+/12+/17+). Pass a declarations map, e.g. { medicalOrTreatmentInformation: \"INFREQUENT_OR_MILD\" }. Pro feature.", {
424
497
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
425
498
  declarations: zod_1.z
426
499
  .record(zod_1.z.string(), zod_1.z.union([zod_1.z.string(), zod_1.z.boolean()]))
427
500
  .describe("Map of declaration key to value. Frequency keys take NONE/INFREQUENT_OR_MILD/FREQUENT_OR_INTENSE (also INFREQUENT/FREQUENT for the few keys Apple uses those on); capability keys take true/false."),
428
501
  }, safe((args) => (0, age_rating_js_1.setAgeRating)(client, args, tier)));
429
- server.tool("set_privacy_nutrition", "Configure the App Privacy nutrition label. Apple does not expose this via API; returns the exact steps + deep link. Pass data_not_collected:true for the 'Data Not Collected' path. Pro feature.", {
502
+ tool("set_privacy_nutrition", "Configure the App Privacy nutrition label. Apple does not expose this via API; returns the exact steps + deep link. Pass data_not_collected:true for the 'Data Not Collected' path. Pro feature.", {
430
503
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
431
504
  data_not_collected: zod_1.z.boolean().optional().describe("Set true if the app collects no data at all."),
432
505
  }, safe((args) => (0, privacy_js_1.setPrivacyNutrition)(args, tier)));
433
- server.tool("set_eu_trader_status", "Declare EU Digital Services Act trader status. Not API-addressable; returns the exact steps + deep link. Pro feature.", {
506
+ tool("set_eu_trader_status", "Declare EU Digital Services Act trader status. Not API-addressable; returns the exact steps + deep link. Pro feature.", {
434
507
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
435
508
  }, safe((args) => (0, eu_trader_js_1.setEUTraderStatus)(args, tier)));
436
- server.tool("create_subscription", "Create (idempotently) an auto-renewable subscription inside a group, with USA price and an optional free trial. Sets territory availability automatically. Pro feature.", {
509
+ tool("create_subscription", "Create (idempotently) an auto-renewable subscription inside a group, with USA price and an optional free trial. Sets territory availability automatically. Pro feature.", {
437
510
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
438
511
  group_reference_name: zod_1.z.string().describe("Subscription group reference name (created if absent)"),
439
512
  group_display_name: zod_1.z.string().describe("Customer-facing group name"),
@@ -452,7 +525,7 @@ async function main() {
452
525
  family_sharable: zod_1.z.boolean().optional().describe("Allow Family Sharing of this subscription (default false)."),
453
526
  review_note: zod_1.z.string().optional().describe("Notes for App Review: how to reach the paywall, test instructions"),
454
527
  }, safe((args) => (0, iap_js_1.createSubscription)(client, args, tier)));
455
- server.tool("create_iap", "Create (idempotently) a one-time in-app purchase (non-consumable or consumable) with USA price. Pro feature.", {
528
+ tool("create_iap", "Create (idempotently) a one-time in-app purchase (non-consumable or consumable) with USA price. Pro feature.", {
456
529
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
457
530
  product_id: zod_1.z.string().describe("IAP product ID, e.g. com.app.lifetime"),
458
531
  reference_name: zod_1.z.string().describe("Internal reference name"),
@@ -464,12 +537,12 @@ async function main() {
464
537
  family_sharable: zod_1.z.boolean().optional().describe("Allow Family Sharing of this purchase (default false)."),
465
538
  review_note: zod_1.z.string().optional().describe("Notes for App Review: how to reach the paywall, test instructions"),
466
539
  }, safe((args) => (0, iap_js_1.createIAP)(client, args, tier)));
467
- server.tool("set_iap_review_screenshot", "Upload the App Review screenshot a subscription or in-app purchase needs to leave MISSING_METADATA. Resolves the product by product_id automatically. Pro feature.", {
540
+ tool("set_iap_review_screenshot", "Upload the App Review screenshot a subscription or in-app purchase needs to leave MISSING_METADATA. Resolves the product by product_id automatically. Pro feature.", {
468
541
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
469
542
  product_id: zod_1.z.string().describe("Product ID of the subscription or IAP"),
470
543
  file: zod_1.z.string().describe("Absolute path to a PNG/JPEG review screenshot"),
471
544
  }, safe((args) => (0, review_screenshot_js_1.setIapReviewScreenshot)(client, args, tier)));
472
- server.tool("set_app_metadata", "Set submission-required app basics: primary/secondary category (appCategory ids like HEALTH_AND_FITNESS), copyright, content-rights declaration, and export compliance (encryption). Each applied only if provided. Pro feature.", {
545
+ tool("set_app_metadata", "Set submission-required app basics: primary/secondary category (appCategory ids like HEALTH_AND_FITNESS), copyright, content-rights declaration, and export compliance (encryption). Each applied only if provided. Pro feature.", {
473
546
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
474
547
  primary_category: zod_1.z.string().optional().describe("Primary appCategory id, e.g. HEALTH_AND_FITNESS"),
475
548
  secondary_category: zod_1.z.string().optional().describe("Secondary appCategory id"),
@@ -483,11 +556,11 @@ async function main() {
483
556
  .optional()
484
557
  .describe("Export compliance: true if the app uses non-exempt encryption (most apps: false)"),
485
558
  }, safe((args) => (0, submission_js_1.setAppMetadata)(client, args, tier)));
486
- server.tool("set_app_price", "Set the app's base price by creating its price schedule (USA base, auto-equalized). price_usd: 0 for free. Required before submission. Pro feature.", {
559
+ tool("set_app_price", "Set the app's base price by creating its price schedule (USA base, auto-equalized). price_usd: 0 for free. Required before submission. Pro feature.", {
487
560
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
488
561
  price_usd: zod_1.z.number().describe("0 for a free app, or a USA price tier in dollars"),
489
562
  }, safe((args) => (0, submission_js_1.setAppPrice)(client, args, tier)));
490
- server.tool("set_review_contact", "Set the App Review contact and optional demo account on the editable version. Required before submission. Pro feature.", {
563
+ tool("set_review_contact", "Set the App Review contact and optional demo account on the editable version. Required before submission. Pro feature.", {
491
564
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
492
565
  first_name: zod_1.z.string().describe("Contact first name"),
493
566
  last_name: zod_1.z.string().describe("Contact last name"),
@@ -501,7 +574,7 @@ async function main() {
501
574
  .optional()
502
575
  .describe("Pass false to declare that no demo account is needed. Omit to leave the existing setting alone; passing demo_account_name sets it to true."),
503
576
  }, safe((args) => (0, submission_js_1.setReviewContact)(client, args, tier)));
504
- server.tool("set_app_availability", "Set the app's country/region availability. Requires an explicit choice: a territories list, or all_territories:true, or [] to take the app off sale worldwide. Pro feature.", {
577
+ tool("set_app_availability", "Set the app's country/region availability. Requires an explicit choice: a territories list, or all_territories:true, or [] to take the app off sale worldwide. Pro feature.", {
505
578
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
506
579
  territories: zod_1.z
507
580
  .array(zod_1.z.string())
@@ -516,7 +589,7 @@ async function main() {
516
589
  .optional()
517
590
  .describe("Auto-include future new territories (default true)"),
518
591
  }, safe((args) => (0, availability_js_1.setAppAvailability)(client, args, tier)));
519
- server.tool("setup_app_store_signing", "Prepare App Store binary signing without the cloud-signing permission many API keys lack: downloads the app's IOS_APP_STORE provisioning profiles (app + extensions), installs them, and writes a manual-signing ExportOptions.plist for build_and_archive. Needs an Apple Distribution certificate already in the keychain. Pro feature.", {
592
+ tool("setup_app_store_signing", "Prepare App Store binary signing without the cloud-signing permission many API keys lack: downloads the app's IOS_APP_STORE provisioning profiles (app + extensions), installs them, and writes a manual-signing ExportOptions.plist for build_and_archive. Needs an Apple Distribution certificate already in the keychain. Pro feature.", {
520
593
  app_id: zod_1.z.string().regex(/^\d+$/, "App ID must be numeric").describe("App Store Connect app ID"),
521
594
  output_plist: zod_1.z.string().optional().describe("Where to write ExportOptions.plist (default ./ExportOptions.plist)"),
522
595
  }, safe((args) => (0, signing_js_1.setupAppStoreSigning)(client, args, tier)));