@pofky/asc-mcp 1.10.2 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,12 +20,14 @@ For the grown-ups: the toy is your app, the office is App Store Connect, and the
20
20
 
21
21
  **Claude Desktop, one click:** download the latest [`asc-mcp.mcpb`](https://github.com/pofky/asc-mcp/releases/latest) and open it. Claude asks for your Issuer ID and lets you pick your `.p8` with a file picker. No JSON, no restart hunt.
22
22
 
23
- **Everything else** (Claude Code, Cursor, Windsurf, Cline), one command:
23
+ **Everything else** (Claude Code, Cursor, Windsurf, Cline): add the server, then finish setup in the chat.
24
24
 
25
25
  ```bash
26
- npx @pofky/asc-mcp init --write # finds your .p8, asks for your Issuer ID, writes your MCP config
26
+ claude mcp add asc-mcp -- npx -y @pofky/asc-mcp # Claude Code. Other clients: the JSON block under "Manual config"
27
27
  ```
28
28
 
29
+ Create an API key at [App Store Connect > Integrations](https://appstoreconnect.apple.com/access/integrations/api) and download it, then tell your agent: **"connect asc-mcp, my Issuer ID is <the UUID on that page>"**. It calls `asc_connect`, which finds the downloaded `.p8`, files it in Apple's standard folder, tests it against Apple and unlocks every tool in the same chat. No terminal, no config file, no restart. (`npx @pofky/asc-mcp init --write` does the same from a terminal.)
30
+
29
31
  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 (VAT included; in the US, Canada and India sales tax is added at checkout). Six tools stay free, and two of those (the setup check and the playbook) need nothing but Node. The Pro tools that only read (reviews, sales, builds, TestFlight groups, preflight, briefing, keywords, competitors, metadata diff, release notes) also work 5 times in total on your machine with no license, as a preview.
30
32
 
31
33
  | You say | What happens |
@@ -47,30 +49,32 @@ Other ASC MCP servers wrap the API and give you 80 to 982 raw endpoints. This on
47
49
 
48
50
  **Why full control is possible without fastlane:** fastlane's `deliver` and `pilot` are just calls to the same App Store Connect REST API this server authenticates against with your `.p8`. So nearly everything you would script with fastlane is a tool here, no Ruby toolchain required. The only step that needs your Mac is building and signing the binary, which `build_and_archive` and `upload_binary` drive via Xcode.
49
51
 
50
- ## Setup (3 minutes)
52
+ ## Setup (about 5 minutes)
53
+
54
+ **You need:** an Apple Developer account, Node 18 or newer, and an AI coding app that supports MCP (Claude Code, Claude Desktop, Cursor, Windsurf, Cline or any other MCP client). MCP is the standard way these apps plug in extra tools; asc-mcp is one of those tools, and it runs on your own computer.
51
55
 
52
- **Step 1.** Create an API key in [App Store Connect > Integrations > App Store Connect API](https://appstoreconnect.apple.com/access/integrations/api) (Admin or App Manager role), then grab three things from that same page:
56
+ **Step 1. Create an App Store Connect API key.** Open [App Store Connect > Integrations > App Store Connect API](https://appstoreconnect.apple.com/access/integrations/api) and generate a key with the Admin or App Manager role. From that same page you need two things:
53
57
 
54
- - **Issuer ID** (`ASC_ISSUER_ID`): the UUID shown at the top of the page, with a copy button next to it.
55
- - **Key ID** (`ASC_KEY_ID`): the 10-character ID next to your key, also in the filename `AuthKey_XXXXXXXXXX.p8`.
56
- - **`.p8` file** (`ASC_PRIVATE_KEY_PATH`): click **Download** and point this at the saved file. Apple lets you download it only once, so keep it safe.
58
+ - **The `.p8` file.** Click **Download**. Apple lets you download it only once, so keep it safe. Its name, `AuthKey_XXXXXXXXXX.p8`, contains the Key ID.
59
+ - **The Issuer ID.** The UUID shown at the top of the page, with a copy button next to it.
57
60
 
58
- **Step 2.** Install:
61
+ **Step 2. Add the server to your agent.** In Claude Code:
59
62
 
60
63
  ```bash
61
- npm install -g @pofky/asc-mcp
64
+ claude mcp add asc-mcp -- npx -y @pofky/asc-mcp
62
65
  ```
63
66
 
64
- No global install needed if you prefer `npx` (see the manual config below).
67
+ In Cursor, Windsurf, Cline or Claude Desktop, add the block under "Manual config" below; the `env` part can stay out. Start a new chat. asc-mcp shows three setup tools until it is connected.
65
68
 
66
- **Fastest setup (recommended).** Drop your `.p8` into Apple's standard path `~/.appstoreconnect/private_keys/` (the file is named `AuthKey_XXXXXXXXXX.p8`, and the Key ID is in the filename). Then run:
69
+ **Step 3. Connect in the chat.** Tell your agent: "connect asc-mcp, my Issuer ID is <the UUID>". It calls `asc_connect`, which looks for `AuthKey_*.p8` in `~/.appstoreconnect/private_keys`, `~/Downloads` and `~/Desktop`, moves it into `~/.appstoreconnect/private_keys` (Apple's standard folder), tests the pair against App Store Connect, saves the Issuer ID in `~/.asc-mcp/credentials.json` and unlocks every tool in the same chat. A wrong Issuer ID is refused before any file moves. If your client keeps showing only the setup tools, restart it once; it starts connected. Then ask: "List my App Store Connect apps".
67
70
 
68
- ```bash
69
- npx @pofky/asc-mcp init --write # auto-detects the key, asks for your Issuer ID, and writes the config for you
70
- # or: npx @pofky/asc-mcp init # same, but prints the block to paste yourself
71
- ```
71
+ Prefer a terminal? `npx @pofky/asc-mcp init --write` finds the key, asks for the Issuer ID and writes your Claude Desktop / Claude Code config (with a backup). `npx @pofky/asc-mcp doctor` checks the key, the Issuer ID, a live connection and your license; in the chat the same check is `asc_setup_check`.
72
72
 
73
- `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).
73
+ **Step 4. Start the trial.** Ask your agent: "start my asc-mcp trial" and give it your email. It calls `asc_start_trial`, which unlocks all 41 tools for 7 days with no card and nothing to cancel. The key works 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. Without a trial, six tools stay free with no time limit, and most Pro tools that only read work 5 times in total as a preview.
74
+
75
+ ### Other ways to install
76
+
77
+ **Claude Desktop, no terminal.** Download the `.mcpb` bundle from the [latest release](https://github.com/pofky/asc-mcp/releases/latest) and open it. Claude asks for your Issuer ID and lets you pick the `.p8` with a file picker.
74
78
 
75
79
  **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:
76
80
 
@@ -78,19 +82,19 @@ npx @pofky/asc-mcp init --write # auto-detects the key, asks for your Issuer
78
82
  /plugin install asc-mcp --marketplace pofky/asc-mcp
79
83
  ```
80
84
 
81
- The plugin lives in [`plugin/`](plugin/), and its README says what it runs and sends.
85
+ The plugin lives in [`plugin/`](plugin/), and its README says what it runs and sends. In your agent, the `/asc-start` command walks a first-time user through setup.
82
86
 
83
- **Running it from an agent, or any pipe.** There is no terminal to answer questions in, so pass what would have been asked:
87
+ **Running init from an agent, or any pipe.** There is no terminal to answer questions in, so pass what would have been asked:
84
88
 
85
89
  ```bash
86
90
  npx @pofky/asc-mcp init --write --issuer <your-issuer-uuid> # add --config <path> if you keep several client configs
87
91
  ```
88
92
 
89
- It prints the paste-ready block either way, and it never invents a value: if the Issuer ID is missing it says so instead of writing a config that fails at Apple's auth. `--key-path`, `--key-id` and `--license` are there for the same reason, and every one of them also reads from the matching `ASC_*` environment variable.
93
+ It never invents a value: if the Issuer ID is missing it says so instead of writing a config that fails at Apple's auth. `--key-path`, `--key-id` and `--license` are there for the same reason, and every one of them also reads from the matching `ASC_*` environment variable. Already paid? `--license <key>` adds your Pro key to the config.
90
94
 
91
- **Stuck?** Run `npx @pofky/asc-mcp doctor` (or ask your agent to call `asc_setup_check`). It checks your key, Issuer ID, a live connection to App Store Connect, and your license, and prints the exact fix for anything wrong. In your agent, the `/asc-start` command walks a first-time user through all of this.
95
+ **Global install.** `npm install -g @pofky/asc-mcp`, then use `asc-mcp` where the examples say `npx -y @pofky/asc-mcp`.
92
96
 
93
- **Manual setup.** Add to your agent's MCP config (Claude Desktop config, or `~/.claude.json` for Claude Code). Use `npx` for zero-install, or `asc-mcp` if you installed globally:
97
+ **Manual config.** Add to your agent's MCP config (Claude Desktop config, or `~/.claude.json` for Claude Code):
94
98
 
95
99
  ```json
96
100
  {
@@ -106,11 +110,7 @@ It prints the paste-ready block either way, and it never invents a value: if the
106
110
  }
107
111
  ```
108
112
 
109
- With the `.p8` in `~/.appstoreconnect/private_keys/`, `ASC_ISSUER_ID` is the only required env var (Key ID and key path are auto-detected). Add `ASC_LICENSE_KEY` to unlock Pro.
110
-
111
- **Step 3.** Ask your agent: "List my App Store Connect apps"
112
-
113
- **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.
113
+ With the `.p8` in `~/.appstoreconnect/private_keys/`, `ASC_ISSUER_ID` is the only required env var (Key ID and key path are auto-detected). Add `ASC_LICENSE_KEY` to unlock Pro. A key kept elsewhere: set `ASC_PRIVATE_KEY_PATH` to the file and `ASC_KEY_ID` to its 10-character ID.
114
114
 
115
115
  Works with **Claude Code**, **Cursor**, **Windsurf**, **Cline**, and any MCP-compatible client.
116
116
 
@@ -121,6 +121,7 @@ Works with **Claude Code**, **Cursor**, **Windsurf**, **Cline**, and any MCP-com
121
121
  | Tool | What it does |
122
122
  |------|-------------|
123
123
  | `asc_start_trial` | **7 days of everything, no card.** Ask your agent to run it with your email. Unlocks all 41 tools in the running session, no restart, nothing to cancel. |
124
+ | `asc_connect` | **Setup from the chat.** Only present until you are connected. Takes your Issuer ID, finds the downloaded `.p8`, files it, tests it against Apple and unlocks every tool in the running session. |
124
125
  | `asc_setup_check` | **Run first if anything's off.** Checks your key, Issuer ID, a live App Store Connect connection, and license tier, and prints the exact fix for each failure. |
125
126
  | `asc_guide` | **Start here.** The in-agent playbook for every flow (first release, update, IAP, subscriptions, reviews, TestFlight, binary), with each manual App Store Connect website step flagged inline. See also [USER_GUIDE.md](USER_GUIDE.md) and [LIMITATIONS.md](LIMITATIONS.md). |
126
127
  | `list_apps` | List all your apps with name, bundle ID, SKU and App ID |
package/USER_GUIDE.md CHANGED
@@ -27,15 +27,15 @@ Outward-facing tools (submit_for_review, release_version, upload_binary) require
27
27
  When: Before anything else, once per machine.
28
28
 
29
29
  Steps:
30
- 1. Create an API key: App Store Connect > Users and Access > Integrations > App Store Connect API > generate a key with the App Manager role. Download the .p8 (one time only).
31
- 2. Drop the .p8 into ~/.appstoreconnect/private_keys/ (Apple's standard path). The 10-char Key ID is read from the filename, so that one file is enough.
32
- 3. Run `npx @pofky/asc-mcp init` in a terminal. It auto-detects the key, asks for your Issuer ID (the UUID at the top of the Integrations page) and an optional Pro license key, and prints a paste-ready MCP config block.
33
- 4. Paste the block into your client config and restart the client. Claude Code global: ~/.claude.json. Claude Desktop: Library/Application Support/Claude/claude_desktop_config.json. Per project: .mcp.json in the project root. Or re-run `init --write` and let it write whichever you pick.
30
+ 1. Create an API key: App Store Connect > Users and Access > Integrations > App Store Connect API > generate a key with the Admin or App Manager role. Download the .p8 (one time only).
31
+ 2. Add the server to the client (Claude Code: `claude mcp add asc-mcp -- npx -y @pofky/asc-mcp`; other clients: an `npx -y @pofky/asc-mcp` entry in their MCP config). Until it is connected it shows three setup tools.
32
+ 3. Give the agent the Issuer ID (the UUID above the keys list on the Integrations page). It calls `asc_connect`, which finds the .p8 in ~/.appstoreconnect/private_keys, ~/Downloads or ~/Desktop, moves it into ~/.appstoreconnect/private_keys, tests it against Apple, saves the Issuer ID in ~/.asc-mcp/credentials.json and unlocks every tool in the running session. If the client keeps showing only the setup tools, restart it once.
33
+ 4. From a terminal instead: `npx @pofky/asc-mcp init --write` finds the key, asks for the Issuer ID and writes the client config (Claude Code ~/.claude.json, Claude Desktop claude_desktop_config.json, or .mcp.json per project), then restart the client.
34
34
  5. Verify with `list_apps`. If it returns your apps, you are connected.
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
- - 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 (VAT included; in the US, Canada and India sales tax is added at checkout) (ASC_LICENSE_KEY).
38
+ - Free with no time limit: three read tools (list_apps, app_details, review_status), plus asc_setup_check, asc_guide and asc_start_trial. Most Pro tools that only read work 5 times in total as a preview. 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 (VAT included; in the US, Canada and India sales tax is added at checkout) (ASC_LICENSE_KEY).
39
39
 
40
40
  ---
41
41
 
package/dist/client.js CHANGED
@@ -150,7 +150,7 @@ function friendlyHint(status, body) {
150
150
  case 401:
151
151
  return "Authentication failed. Your Issuer ID, Key ID, or .p8 likely don't match. Re-check the Issuer ID (UUID on the Integrations page) and that the .p8 matches the Key ID. Run `npx @pofky/asc-mcp doctor` to pinpoint it.";
152
152
  case 403:
153
- return "Your API key authenticated but lacks permission for this action. Its role is probably too low (needs App Manager or higher), or this specific capability (e.g. cloud signing, creating an app record) is not available to API keys at all. See `asc_guide topic:limitations`.";
153
+ return "Your API key authenticated but lacks permission for this action. The id may not belong to an app in this account (check it with list_apps), the key's role may be too low (needs App Manager or higher), or this specific capability (e.g. cloud signing, creating an app record) is not available to API keys at all. See `asc_guide topic:limitations`.";
154
154
  case 404:
155
155
  return "The resource wasn't found. Double-check the app_id / product_id (use `list_apps`), or the resource may not exist yet for this app.";
156
156
  case 409:
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AAGrC,MAAM,QAAQ,GAAG,uCAAuC,CAAC;AAEzD;;;GAGG;AACH,MAAa,SAAS;IACA;IAApB,YAAoB,MAAiB;QAAjB,WAAM,GAAN,MAAM,CAAW;IAAG,CAAC;IAEzC,wDAAwD;IACxD,KAAK,CAAC,GAAG,CAAI,IAAY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;IACd,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY;IACvC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;YAC/B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QACjC,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;YAC9B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAChC,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,WAAW;IACb,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Finishing setup inside the conversation (tasks/0004).
3
+ *
4
+ * A new install starts in setup mode, and the way out used to be: move the
5
+ * downloaded .p8 with a terminal command, find a JSON config file the user had
6
+ * never seen, add an Issuer ID to it, and restart the client. Installs went up
7
+ * while trial starts went to zero (Nov 2026), which is the shape of a wall at
8
+ * that step. `asc_connect` takes the one value nothing can discover, the Issuer
9
+ * ID, does the rest on this machine, and the server unlocks in the running
10
+ * session.
11
+ *
12
+ * What it saves is `~/.asc-mcp/credentials.json`: the Issuer ID, and the key's
13
+ * path only when the key is not in Apple's standard folder. No secret is in it.
14
+ * Environment variables always win over it, so an install configured the old
15
+ * way behaves exactly as before.
16
+ */
17
+ /** Where Apple's page shows the Issuer ID and lets you create a key. */
18
+ export declare const INTEGRATIONS_URL = "https://appstoreconnect.apple.com/access/integrations/api";
19
+ export declare function credentialsPath(): string;
20
+ export declare function isIssuerId(value: string): boolean;
21
+ /**
22
+ * Fill ASC_ISSUER_ID and ASC_PRIVATE_KEY_PATH from credentials.json where the
23
+ * environment leaves them unset or empty. A plugin or bundle with a blank field
24
+ * passes an empty string, which counts as unset. Returns true if anything was
25
+ * taken from the file.
26
+ */
27
+ export declare function loadSavedCredentials(): boolean;
28
+ /** AuthKey_*.p8 files in the usual download folders. */
29
+ export declare function findDownloadedKeys(dirs?: string[]): string[];
30
+ export interface LiveCheck {
31
+ ok: boolean;
32
+ status: number;
33
+ /** Apps in the account, when Apple reports a total. */
34
+ apps?: number;
35
+ error?: string;
36
+ }
37
+ /** One authenticated request to Apple, the same one `asc_setup_check` makes. */
38
+ export declare function liveCheck(keyId: string, issuerId: string, keyPath: string): Promise<LiveCheck>;
39
+ export interface ConnectInput {
40
+ issuer_id: string;
41
+ key_path?: string;
42
+ }
43
+ export type ConnectResult = {
44
+ ok: true;
45
+ config: {
46
+ keyId: string;
47
+ issuerId: string;
48
+ privateKeyPath: string;
49
+ };
50
+ apps?: number;
51
+ /** Lines describing what happened to the user's files. */
52
+ notes: string[];
53
+ saved: boolean;
54
+ } | {
55
+ ok: false;
56
+ message: string;
57
+ };
58
+ /**
59
+ * Find the key, file it, prove the pair works against Apple, then save. Nothing
60
+ * is saved unless Apple accepted the pair.
61
+ */
62
+ export declare function connectAccount(input: ConnectInput, check?: typeof liveCheck): Promise<ConnectResult>;
63
+ //# sourceMappingURL=connect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAkBH,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,8DAA8D,CAAC;AAW5F,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAiBD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEjD;AAgBD;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAiB9C;AAcD,wDAAwD;AACxD,wBAAgB,kBAAkB,CAAC,IAAI,WAAiB,GAAG,MAAM,EAAE,CAYlE;AAgCD,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,gFAAgF;AAChF,wBAAsB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAgBpG;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,aAAa,GACrB;IACE,EAAE,EAAE,IAAI,CAAC;IACT,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB,GACD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC;;;GAGG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,YAAY,EACnB,KAAK,GAAE,OAAO,SAAqB,GAClC,OAAO,CAAC,aAAa,CAAC,CAuGxB"}
@@ -0,0 +1,278 @@
1
+ "use strict";
2
+ /**
3
+ * Finishing setup inside the conversation (tasks/0004).
4
+ *
5
+ * A new install starts in setup mode, and the way out used to be: move the
6
+ * downloaded .p8 with a terminal command, find a JSON config file the user had
7
+ * never seen, add an Issuer ID to it, and restart the client. Installs went up
8
+ * while trial starts went to zero (Nov 2026), which is the shape of a wall at
9
+ * that step. `asc_connect` takes the one value nothing can discover, the Issuer
10
+ * ID, does the rest on this machine, and the server unlocks in the running
11
+ * session.
12
+ *
13
+ * What it saves is `~/.asc-mcp/credentials.json`: the Issuer ID, and the key's
14
+ * path only when the key is not in Apple's standard folder. No secret is in it.
15
+ * Environment variables always win over it, so an install configured the old
16
+ * way behaves exactly as before.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.INTEGRATIONS_URL = void 0;
20
+ exports.credentialsPath = credentialsPath;
21
+ exports.isIssuerId = isIssuerId;
22
+ exports.loadSavedCredentials = loadSavedCredentials;
23
+ exports.findDownloadedKeys = findDownloadedKeys;
24
+ exports.liveCheck = liveCheck;
25
+ exports.connectAccount = connectAccount;
26
+ const node_fs_1 = require("node:fs");
27
+ const node_os_1 = require("node:os");
28
+ const node_path_1 = require("node:path");
29
+ const auth_js_1 = require("./auth.js");
30
+ const setup_js_1 = require("./setup.js");
31
+ /** Where Apple's page shows the Issuer ID and lets you create a key. */
32
+ exports.INTEGRATIONS_URL = "https://appstoreconnect.apple.com/access/integrations/api";
33
+ const ISSUER_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
34
+ const KEY_FILE_RE = /^AuthKey_[A-Z0-9]{10}\.p8$/i;
35
+ // Each path is computed from homedir() at call time, not at import, so a test
36
+ // (or anything else) that points HOME somewhere else is honoured.
37
+ function standardKeyDir() {
38
+ return (0, node_path_1.join)((0, node_os_1.homedir)(), ".appstoreconnect", "private_keys");
39
+ }
40
+ function credentialsPath() {
41
+ return (0, node_path_1.join)((0, node_os_1.homedir)(), ".asc-mcp", "credentials.json");
42
+ }
43
+ /** Folders a browser download of the key usually lands in. */
44
+ function downloadDirs() {
45
+ return [(0, node_path_1.join)((0, node_os_1.homedir)(), "Downloads"), (0, node_path_1.join)((0, node_os_1.homedir)(), "Desktop")];
46
+ }
47
+ function expandHome(p) {
48
+ return p === "~" || p.startsWith("~/") ? (0, node_path_1.join)((0, node_os_1.homedir)(), p.slice(2)) : (0, node_path_1.resolve)(p);
49
+ }
50
+ /** A key file the client's own settings point at, if it exists and carries Apple's name. */
51
+ function envKeyPath() {
52
+ const p = process.env.ASC_PRIVATE_KEY_PATH?.trim();
53
+ return p && (0, node_fs_1.existsSync)(expandHome(p)) && (0, setup_js_1.keyIdFromPath)(p) ? expandHome(p) : undefined;
54
+ }
55
+ function isIssuerId(value) {
56
+ return ISSUER_RE.test(value.trim());
57
+ }
58
+ function readSaved() {
59
+ try {
60
+ const parsed = JSON.parse((0, node_fs_1.readFileSync)(credentialsPath(), "utf-8"));
61
+ return parsed && typeof parsed === "object" ? parsed : null;
62
+ }
63
+ catch {
64
+ return null;
65
+ }
66
+ }
67
+ /**
68
+ * Fill ASC_ISSUER_ID and ASC_PRIVATE_KEY_PATH from credentials.json where the
69
+ * environment leaves them unset or empty. A plugin or bundle with a blank field
70
+ * passes an empty string, which counts as unset. Returns true if anything was
71
+ * taken from the file.
72
+ */
73
+ function loadSavedCredentials() {
74
+ const saved = readSaved();
75
+ if (!saved)
76
+ return false;
77
+ let used = false;
78
+ if (!process.env.ASC_ISSUER_ID?.trim() && typeof saved.issuerId === "string" && isIssuerId(saved.issuerId)) {
79
+ process.env.ASC_ISSUER_ID = saved.issuerId.trim();
80
+ used = true;
81
+ }
82
+ if (!process.env.ASC_PRIVATE_KEY_PATH?.trim() &&
83
+ typeof saved.privateKeyPath === "string" &&
84
+ (0, node_fs_1.existsSync)(saved.privateKeyPath)) {
85
+ process.env.ASC_PRIVATE_KEY_PATH = saved.privateKeyPath;
86
+ used = true;
87
+ }
88
+ return used;
89
+ }
90
+ function saveCredentials(creds) {
91
+ try {
92
+ const path = credentialsPath();
93
+ (0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(path), { recursive: true, mode: 0o700 });
94
+ (0, node_fs_1.writeFileSync)(path, JSON.stringify(creds, null, 2) + "\n", { mode: 0o600 });
95
+ (0, node_fs_1.chmodSync)(path, 0o600);
96
+ return true;
97
+ }
98
+ catch {
99
+ return false;
100
+ }
101
+ }
102
+ /** AuthKey_*.p8 files in the usual download folders. */
103
+ function findDownloadedKeys(dirs = downloadDirs()) {
104
+ const found = [];
105
+ for (const dir of dirs) {
106
+ let files;
107
+ try {
108
+ files = (0, node_fs_1.readdirSync)(dir);
109
+ }
110
+ catch {
111
+ continue;
112
+ }
113
+ for (const f of files)
114
+ if (KEY_FILE_RE.test(f))
115
+ found.push((0, node_path_1.join)(dir, f));
116
+ }
117
+ return found;
118
+ }
119
+ /**
120
+ * Put a key into Apple's standard folder, the step the README asks people to do
121
+ * with `mkdir -p` and `mv`. Never overwrites: a file of the same name already
122
+ * there is the same key (the name carries the Key ID), so that one is used and
123
+ * the download is left where it is.
124
+ */
125
+ function fileKey(src) {
126
+ const dir = standardKeyDir();
127
+ const dest = (0, node_path_1.join)(dir, (0, node_path_1.basename)(src));
128
+ if ((0, node_path_1.resolve)(src) === (0, node_path_1.resolve)(dest))
129
+ return { path: dest };
130
+ if ((0, node_fs_1.existsSync)(dest)) {
131
+ return { path: dest, note: `${dest} already existed, so it was used and ${src} was left in place.` };
132
+ }
133
+ try {
134
+ (0, node_fs_1.mkdirSync)(dir, { recursive: true, mode: 0o700 });
135
+ try {
136
+ (0, node_fs_1.renameSync)(src, dest);
137
+ }
138
+ catch {
139
+ // Different volume: rename cannot cross it.
140
+ (0, node_fs_1.copyFileSync)(src, dest);
141
+ (0, node_fs_1.unlinkSync)(src);
142
+ }
143
+ (0, node_fs_1.chmodSync)(dest, 0o600);
144
+ return { path: dest, movedFrom: src };
145
+ }
146
+ catch (err) {
147
+ const msg = err instanceof Error ? err.message : String(err);
148
+ return { path: src, note: `It could not be moved into ${dir} (${msg}), so it is used from ${src}.` };
149
+ }
150
+ }
151
+ /** One authenticated request to Apple, the same one `asc_setup_check` makes. */
152
+ async function liveCheck(keyId, issuerId, keyPath) {
153
+ try {
154
+ (0, auth_js_1.clearTokenCache)();
155
+ const token = await (0, auth_js_1.getToken)(keyId, issuerId, keyPath);
156
+ const res = await fetch("https://api.appstoreconnect.apple.com/v1/apps?limit=1", {
157
+ headers: { Authorization: `Bearer ${token}` },
158
+ signal: AbortSignal.timeout(15_000),
159
+ });
160
+ if (!res.ok)
161
+ return { ok: false, status: res.status };
162
+ const body = (await res.json().catch(() => null));
163
+ const total = body?.meta?.paging?.total;
164
+ return { ok: true, status: res.status, apps: typeof total === "number" ? total : undefined };
165
+ }
166
+ catch (err) {
167
+ (0, auth_js_1.clearTokenCache)();
168
+ return { ok: false, status: 0, error: err instanceof Error ? err.message : String(err) };
169
+ }
170
+ }
171
+ /**
172
+ * Find the key, file it, prove the pair works against Apple, then save. Nothing
173
+ * is saved unless Apple accepted the pair.
174
+ */
175
+ async function connectAccount(input, check = liveCheck) {
176
+ const issuerId = (input.issuer_id ?? "").trim();
177
+ if (!isIssuerId(issuerId)) {
178
+ return {
179
+ ok: false,
180
+ message: `That is not an Issuer ID. It is a UUID like 69a6de70-03db-47e3-e053-5b8c7c11a4d1, shown above the keys list at ${exports.INTEGRATIONS_URL} (Integrations > App Store Connect API). ` +
181
+ "It is not the Key ID (10 characters) or the Team ID. Nothing was changed.",
182
+ };
183
+ }
184
+ // 1. Which key.
185
+ let source;
186
+ let pinned = false;
187
+ let keepInPlace = false;
188
+ if (input.key_path?.trim()) {
189
+ const p = expandHome(input.key_path.trim());
190
+ if (!(0, node_fs_1.existsSync)(p)) {
191
+ return { ok: false, message: `No file at ${p}. Nothing was changed.` };
192
+ }
193
+ if (!(0, setup_js_1.keyIdFromPath)(p)) {
194
+ return {
195
+ ok: false,
196
+ message: `${(0, node_path_1.basename)(p)} is not named the way Apple names a key (AuthKey_XXXXXXXXXX.p8, where the 10 characters are the Key ID). Rename it back to that, then try again. Nothing was changed.`,
197
+ };
198
+ }
199
+ source = p;
200
+ // Only a fresh download gets filed. A key the user keeps somewhere on
201
+ // purpose may be referenced by path from other tools (fastlane, CI
202
+ // scripts), so it is used where it is and that path is saved.
203
+ const inDownloads = downloadDirs().some((d) => (0, node_path_1.resolve)((0, node_path_1.dirname)(p)) === (0, node_path_1.resolve)(d));
204
+ if (!inDownloads)
205
+ keepInPlace = true;
206
+ }
207
+ else if (envKeyPath()) {
208
+ // The client already names the key (a plugin or bundle file field, or
209
+ // ASC_PRIVATE_KEY_PATH by hand) and only the Issuer ID was missing. That
210
+ // file is used where it is: the user chose that place.
211
+ source = envKeyPath();
212
+ pinned = true;
213
+ }
214
+ else {
215
+ const standard = (0, setup_js_1.discoverPrivateKey)(standardKeyDir());
216
+ if (standard) {
217
+ source = standard.path;
218
+ }
219
+ else {
220
+ const downloads = findDownloadedKeys();
221
+ if (downloads.length > 1) {
222
+ return {
223
+ ok: false,
224
+ message: `Found ${downloads.length} API keys: ${downloads.join(", ")}. Which one goes with this Issuer ID? Call asc_connect again with key_path set to it. Nothing was changed.`,
225
+ };
226
+ }
227
+ source = downloads[0];
228
+ }
229
+ }
230
+ if (!source) {
231
+ return {
232
+ ok: false,
233
+ message: `No API key (.p8) found in ~/.appstoreconnect/private_keys, ~/Downloads or ~/Desktop. ` +
234
+ `Create one at ${exports.INTEGRATIONS_URL}: Generate API Key, any name, Access "App Manager" (or Admin), then Download. ` +
235
+ "Apple lets you download it only once. Then call asc_connect again, or pass key_path if you saved it somewhere else. Nothing was changed.",
236
+ };
237
+ }
238
+ const keyId = (0, setup_js_1.keyIdFromPath)(source);
239
+ // 2. Prove the pair before touching anything, so a wrong Issuer ID leaves the
240
+ // user's files exactly as they were.
241
+ const live = await check(keyId, issuerId, source);
242
+ if (!live.ok) {
243
+ const why = live.status === 401
244
+ ? `Apple refused this Issuer ID with key ${keyId} (401). The Issuer ID is the one shown on the same page as that key; check it was copied whole, and that the key was not revoked.`
245
+ : live.status === 403
246
+ ? `Apple accepted the key but it may not read apps (403). Give key ${keyId} the App Manager or Admin role at ${exports.INTEGRATIONS_URL}, or create a new one with that role.`
247
+ : live.status === 0
248
+ ? `Could not reach App Store Connect or sign with ${(0, node_path_1.basename)(source)}: ${live.error}. If the file was opened and saved by an editor, download a fresh key.`
249
+ : `App Store Connect answered ${live.status}. That is usually on Apple's side; try again in a minute.`;
250
+ return { ok: false, message: `${why} Nothing was saved.` };
251
+ }
252
+ // 3. File the key and save.
253
+ const filed = pinned || keepInPlace ? { path: source } : fileKey(source);
254
+ const notes = [];
255
+ if (filed.movedFrom)
256
+ notes.push(`Your key was moved from ${filed.movedFrom} to ${filed.path}, Apple's standard place for it.`);
257
+ if (filed.note)
258
+ notes.push(filed.note);
259
+ const inStandard = (0, node_path_1.dirname)((0, node_path_1.resolve)(filed.path)) === (0, node_path_1.resolve)(standardKeyDir());
260
+ const saved = saveCredentials(inStandard || pinned ? { issuerId } : { issuerId, privateKeyPath: filed.path });
261
+ process.env.ASC_ISSUER_ID = issuerId;
262
+ if (pinned) {
263
+ // Left as the client set it.
264
+ }
265
+ else if (!inStandard)
266
+ process.env.ASC_PRIVATE_KEY_PATH = filed.path;
267
+ else if (process.env.ASC_PRIVATE_KEY_PATH !== undefined && !process.env.ASC_PRIVATE_KEY_PATH.trim()) {
268
+ delete process.env.ASC_PRIVATE_KEY_PATH;
269
+ }
270
+ return {
271
+ ok: true,
272
+ config: { keyId, issuerId, privateKeyPath: filed.path },
273
+ apps: live.apps,
274
+ notes,
275
+ saved,
276
+ };
277
+ }
278
+ //# sourceMappingURL=connect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect.js","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AA8BH,0CAEC;AAiBD,gCAEC;AAsBD,oDAiBC;AAeD,gDAYC;AAyCD,8BAgBC;AAsBD,wCA0GC;AA5SD,qCAUiB;AACjB,qCAAkC;AAClC,yCAA6D;AAC7D,uCAAsD;AACtD,yCAA+D;AAE/D,wEAAwE;AAC3D,QAAA,gBAAgB,GAAG,2DAA2D,CAAC;AAE5F,MAAM,SAAS,GAAG,iEAAiE,CAAC;AACpF,MAAM,WAAW,GAAG,6BAA6B,CAAC;AAElD,8EAA8E;AAC9E,k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QACL,KAAK;KACN,CAAC;AACJ,CAAC"}
package/dist/doctor.js CHANGED
@@ -52,7 +52,7 @@ async function runDoctor() {
52
52
  name: "API key file (.p8)",
53
53
  status: "fail",
54
54
  detail: "No .p8 found in ~/.appstoreconnect/private_keys/ and ASC_PRIVATE_KEY_PATH is unset.",
55
- fix: `Create a key at ${INTEGRATIONS_URL} (role: App Manager), download the .p8 once, and drop it into ~/.appstoreconnect/private_keys/.`,
55
+ fix: `Create a key at ${INTEGRATIONS_URL} (role: Admin or App Manager) and download the .p8 once. Then give your agent the Issuer ID: asc_connect finds the download and files it. Or by hand: mkdir -p ~/.appstoreconnect/private_keys && mv ~/Downloads/AuthKey_*.p8 ~/.appstoreconnect/private_keys/`,
56
56
  });
57
57
  }
58
58
  else if (!(0, node_fs_1.existsSync)(resolvePath(keyPath))) {
@@ -90,7 +90,7 @@ async function runDoctor() {
90
90
  name: "Issuer ID",
91
91
  status: "fail",
92
92
  detail: "ASC_ISSUER_ID is unset.",
93
- fix: `Copy the Issuer ID (a UUID at the top of ${INTEGRATIONS_URL}) and set ASC_ISSUER_ID. Run \`npx @pofky/asc-mcp init\` to generate the config.`,
93
+ fix: `Copy the Issuer ID (a UUID at the top of ${INTEGRATIONS_URL}) and paste it to your agent, which saves it with asc_connect. Or run \`npx @pofky/asc-mcp init\` to generate the config.`,
94
94
  });
95
95
  }
96
96
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAiCH,sCAKC;AAcD,8BAyNC;AAKD,oCAaC;AA7RD,qCAAmD;AACnD,yCAAoC;AACpC,qCAAkC;AAClC,uCAAsD;AACtD,6CAAmF;AACnF,yCAAgD;AAChD,uCAAmD;AAiBnD;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAC,OAA2B,EAAE,GAAG,GAAG,IAAI,IAAI,EAAE;IACzE,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CA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