@pofky/asc-mcp 1.11.2 → 1.12.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 +19 -14
- package/USER_GUIDE.md +27 -23
- package/dist/client.d.ts +9 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +18 -2
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +8 -2
- package/dist/errors.js.map +1 -1
- package/dist/gate.js +1 -1
- package/dist/gate.js.map +1 -1
- package/dist/image-size.d.ts +6 -0
- package/dist/image-size.d.ts.map +1 -0
- package/dist/image-size.js +36 -0
- package/dist/image-size.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +68 -11
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.ts.map +1 -1
- package/dist/instructions.js +2 -1
- package/dist/instructions.js.map +1 -1
- package/dist/tool-meta.d.ts +5 -0
- package/dist/tool-meta.d.ts.map +1 -1
- package/dist/tool-meta.js +6 -1
- package/dist/tool-meta.js.map +1 -1
- package/dist/tools/age-rating.d.ts +14 -3
- package/dist/tools/age-rating.d.ts.map +1 -1
- package/dist/tools/age-rating.js +84 -11
- package/dist/tools/age-rating.js.map +1 -1
- package/dist/tools/app-details.d.ts.map +1 -1
- package/dist/tools/app-details.js +20 -2
- package/dist/tools/app-details.js.map +1 -1
- package/dist/tools/builds.d.ts +1 -0
- package/dist/tools/builds.d.ts.map +1 -1
- package/dist/tools/builds.js +13 -5
- package/dist/tools/builds.js.map +1 -1
- package/dist/tools/bundle-id.d.ts +30 -0
- package/dist/tools/bundle-id.d.ts.map +1 -0
- package/dist/tools/bundle-id.js +96 -0
- package/dist/tools/bundle-id.js.map +1 -0
- package/dist/tools/guide.d.ts.map +1 -1
- package/dist/tools/guide.js +9 -5
- package/dist/tools/guide.js.map +1 -1
- package/dist/tools/local-build.d.ts +8 -0
- package/dist/tools/local-build.d.ts.map +1 -1
- package/dist/tools/local-build.js +55 -8
- package/dist/tools/local-build.js.map +1 -1
- package/dist/tools/screenshots.d.ts +12 -1
- package/dist/tools/screenshots.d.ts.map +1 -1
- package/dist/tools/screenshots.js +104 -3
- package/dist/tools/screenshots.js.map +1 -1
- package/dist/tools/signing.d.ts +2 -0
- package/dist/tools/signing.d.ts.map +1 -1
- package/dist/tools/signing.js +49 -4
- package/dist/tools/signing.js.map +1 -1
- package/dist/tools/submission.d.ts.map +1 -1
- package/dist/tools/submission.js +20 -1
- package/dist/tools/submission.js.map +1 -1
- package/dist/tools/testflight-setup.d.ts +52 -0
- package/dist/tools/testflight-setup.d.ts.map +1 -0
- package/dist/tools/testflight-setup.js +198 -0
- package/dist/tools/testflight-setup.js.map +1 -0
- package/dist/tools/testflight.d.ts +0 -1
- package/dist/tools/testflight.d.ts.map +1 -1
- package/dist/tools/testflight.js +49 -3
- package/dist/tools/testflight.js.map +1 -1
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# asc-mcp
|
|
2
2
|
|
|
3
|
-
> **Ship
|
|
3
|
+
> **Ship your iOS app from your coding agent, from a new bundle id to App Store review.** An MCP server for App Store Connect: 44 tools that register the bundle id, create the signing profile, archive and upload the build, set up TestFlight, write the metadata, age rating and screenshots, create in-app purchases, submit and release, plus an intelligence layer that audits a version before you submit and summarizes your reviews. Every step Apple's API cannot do is flagged before you reach it. 6 slash-command workflows and a bundled Claude Skill. Not another API wrapper. A fastlane alternative for AI agents.
|
|
4
|
+
|
|
5
|
+
**New in 1.12:** a brand-new app's first steps now run in the chat too: bundle id, App Store signing profile, TestFlight groups and internal testers. This release was built by taking a new iOS app from a new bundle id to TestFlight through asc-mcp itself; each Apple trap it hit on the way is fixed or named in the reply. Creating the app record itself stays on Apple's website, and `asc_guide` tells you when.
|
|
4
6
|
|
|
5
7
|
[asc-mcp.pages.dev](https://asc-mcp.pages.dev) · [npm](https://www.npmjs.com/package/@pofky/asc-mcp) · [Pricing: 7-day free trial, then $9/month, VAT included (sales tax added in the US, Canada and India)](https://asc-mcp.pages.dev/#pricing)
|
|
6
8
|
|
|
@@ -14,7 +16,7 @@ claude mcp add asc-mcp -- npx -y @pofky/asc-mcp # Claude Code. Other clients:
|
|
|
14
16
|
|
|
15
17
|
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.)
|
|
16
18
|
|
|
17
|
-
Then ask your agent: **"start my asc-mcp trial, my email is you@example.com"**. All
|
|
19
|
+
Then ask your agent: **"start my asc-mcp trial, my email is you@example.com"**. All 44 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.
|
|
18
20
|
|
|
19
21
|
### In plain words
|
|
20
22
|
|
|
@@ -45,7 +47,7 @@ No context switching. No portal. Just ask.
|
|
|
45
47
|
|
|
46
48
|
Maintained successor to [JoshuaRileyDev/app-store-connect-mcp-server](https://github.com/JoshuaRileyDev/app-store-connect-mcp-server) (archived Feb 2026). Different angle, same API surface plus more.
|
|
47
49
|
|
|
48
|
-
Other ASC MCP servers wrap the API and give you 80 to 982 raw endpoints. This one gives you
|
|
50
|
+
Other ASC MCP servers wrap the API and give you 80 to 982 raw endpoints. This one gives you 44 opinionated tools, 6 slash-command Prompts, and a Claude Skill that all think. The read tools summarize and audit; the Pro control tools actually drive App Store Connect, from editing metadata to submitting and releasing, with the same API key. Two tools use MCP Sampling: your own client's model does the LLM work, so there is no extra cost from this server.
|
|
49
51
|
|
|
50
52
|
**Why full control is possible without fastlane:** per [fastlane's docs](https://docs.fastlane.tools/app-store-connect-api/), `deliver` and `pilot` can authenticate with an App Store Connect API key, the same kind of key this server uses with your `.p8`. The release steps you would script with them are tools 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.
|
|
51
53
|
|
|
@@ -70,7 +72,7 @@ In Cursor, Windsurf, Cline or Claude Desktop, add the block under "Manual config
|
|
|
70
72
|
|
|
71
73
|
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
74
|
|
|
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
|
|
75
|
+
**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 44 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
76
|
|
|
75
77
|
### Other ways to install
|
|
76
78
|
|
|
@@ -120,7 +122,7 @@ Works with **Claude Code**, **Cursor**, **Windsurf**, **Cline**, and any MCP-com
|
|
|
120
122
|
|
|
121
123
|
| Tool | What it does |
|
|
122
124
|
|------|-------------|
|
|
123
|
-
| `asc_start_trial` | **7 days of everything, no card.** Ask your agent to run it with your email. Unlocks all
|
|
125
|
+
| `asc_start_trial` | **7 days of everything, no card.** Ask your agent to run it with your email. Unlocks all 44 tools in the running session, no restart, nothing to cancel. |
|
|
124
126
|
| `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. |
|
|
125
127
|
| `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. |
|
|
126
128
|
| `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). |
|
|
@@ -147,37 +149,40 @@ $9 per month, VAT included; in the US, Canada and India sales tax is added at ch
|
|
|
147
149
|
|
|
148
150
|
### Control & Ship (Pro)
|
|
149
151
|
|
|
150
|
-
These tools write to App Store Connect. Every
|
|
152
|
+
These tools write to App Store Connect. Every write that is hard to take back (register a bundle id, create a signing profile or beta group, invite a tester, replace screenshots, upload a binary, submit, release) previews what it would do and acts only with an explicit `confirm: true`, so nothing leaves your machine by accident.
|
|
151
153
|
|
|
152
154
|
| Tool | What it does |
|
|
153
155
|
|------|-------------|
|
|
154
156
|
| `create_version` | Create a new editable App Store version for your next release |
|
|
155
157
|
| `update_version_metadata` | Edit description, keywords, what's-new, promo text, URLs, app name, subtitle. Validates Apple's character limits and refuses over-limit writes |
|
|
156
|
-
| `upload_screenshots` | Upload screenshots for a device display type
|
|
158
|
+
| `upload_screenshots` | Upload screenshots for a device display type. Refuses pixel sizes Apple rejects before reserving anything, `replace: true` swaps the whole set, and the reply reports Apple's processing state |
|
|
157
159
|
| `list_builds` | List recent builds and their processing state (VALID = ready) |
|
|
158
|
-
| `wait_for_build` | Poll until
|
|
160
|
+
| `wait_for_build` | Poll until the build you just uploaded (by build number) finishes processing, so the chain never attaches an older build |
|
|
159
161
|
| `attach_build` | Attach a build to the editable version (defaults to newest processed build) |
|
|
160
162
|
| `submit_for_review` | Submit the version to App Review (modern reviewSubmissions flow). `confirm: true` required |
|
|
161
163
|
| `release_version` | Release an approved version to the public App Store. `confirm: true` required |
|
|
162
164
|
| `manage_phased_release` | Start, pause, resume, or complete the 7-day phased rollout |
|
|
163
165
|
| `list_beta_groups` | List your TestFlight beta groups |
|
|
166
|
+
| `create_beta_group` | Create an internal or external TestFlight group (idempotent by name) |
|
|
167
|
+
| `set_beta_test_info` | Set TestFlight feedback email, description, URLs, What to Test and the Beta App Review contact |
|
|
164
168
|
| `assign_build_to_group` | Push a build to a beta group so testers can install it |
|
|
165
|
-
| `invite_beta_tester` |
|
|
169
|
+
| `invite_beta_tester` | Add a tester to a group: any email for an external group, an App Store Connect user on your account for an internal one |
|
|
166
170
|
| `set_app_metadata` | Set primary/secondary category, copyright, content-rights, and export-compliance (encryption) in one call |
|
|
167
171
|
| `set_app_price` | Set the base price by creating the price schedule (`price_usd: 0` for free), auto-equalized to all territories |
|
|
168
172
|
| `set_app_availability` | Make the app available in all App Store territories (or a subset), with auto-include for future ones |
|
|
169
173
|
| `set_review_contact` | Set the App Review contact and optional demo account on the version |
|
|
170
|
-
| `set_age_rating` | Set the
|
|
174
|
+
| `set_age_rating` | Set the age-rating declaration, including Apple's newest required questions. Lists every value written, defaults included, and reads back the rating Apple computed on the 4+/9+/13+/16+/18+ scale |
|
|
171
175
|
| `set_privacy_nutrition` | Guidance + deep link for the App Privacy nutrition labels (not API-addressable) |
|
|
172
176
|
| `set_eu_trader_status` | Guidance + deep link for the EU DSA trader status (not API-addressable) |
|
|
173
177
|
| `create_iap` | Create a non-consumable/consumable IAP with localization, availability, and an auto-equalized price |
|
|
174
178
|
| `create_subscription` | Create a subscription group, sub, localization, availability, price, and free trial |
|
|
175
179
|
| `set_iap_review_screenshot` | Attach the App Review screenshot to a subscription or IAP |
|
|
176
|
-
| `
|
|
177
|
-
| `
|
|
180
|
+
| `register_bundle_id` | Register a new app's bundle id in your developer account, the first step of a brand-new app. Says so plainly when another Apple account already owns the id |
|
|
181
|
+
| `setup_app_store_signing` | Create the App Store provisioning profile if the app has none, install it and write a manual-signing `ExportOptions.plist` (works with a least-privilege API key) |
|
|
182
|
+
| `build_and_archive` | Build, archive, and export a signed `.ipa` via xcodebuild (needs Xcode on your Mac). Runs a generator such as `xcodegen generate` first with `pre_build_command`, and always returns the `.ipa` this run produced |
|
|
178
183
|
| `upload_binary` | Upload the `.ipa` to App Store Connect via altool, using your API key. `confirm: true` required |
|
|
179
184
|
|
|
180
|
-
The whole flow chains: `setup_app_store_signing` to `build_and_archive` to `upload_binary` to `wait_for_build` (blocks until VALID) to `attach_build` to `update_version_metadata` to `upload_screenshots` to `set_app_metadata`/`set_app_price`/`set_app_availability`/`set_age_rating`/`set_review_contact` to `release_preflight` to `submit_for_review` to `release_version`. The `/asc-ship-release` slash command drives it for you.
|
|
185
|
+
The whole flow chains, from a brand-new app: `register_bundle_id` to `setup_app_store_signing` to `build_and_archive` to `upload_binary` to `wait_for_build` (blocks until VALID) to `create_beta_group`/`invite_beta_tester` for TestFlight to `attach_build` to `update_version_metadata` to `upload_screenshots` to `set_app_metadata`/`set_app_price`/`set_app_availability`/`set_age_rating`/`set_review_contact` to `release_preflight` to `submit_for_review` to `release_version`. The `/asc-ship-release` slash command drives it for you.
|
|
181
186
|
|
|
182
187
|
`release_preflight` is the check to run before you submit: it reads every API-addressable field, loads the support, privacy and terms links in the record, and with `project_path` checks privacy manifests, required-reason APIs, listed SDKs and purpose strings on your machine. Every rule ends in PASS, WARN, FAIL or UNKNOWN, and any UNKNOWN withholds the clean verdict. Project files are checked only with `project_path`, and the verdict says when they were not. It ends with the manual steps for the few things Apple only allows in the website (first-IAP bundling, App Privacy nutrition labels, EU trader status). It is not a prediction of App Review's decision.
|
|
183
188
|
|
|
@@ -300,7 +305,7 @@ Lead with the most impactful change. Keep under 4000 chars.
|
|
|
300
305
|
|
|
301
306
|
| | Raw API wrappers (free) | This server |
|
|
302
307
|
|---|---|---|
|
|
303
|
-
| **Tool count** | 80 to 982 |
|
|
308
|
+
| **Tool count** | 80 to 982 | 44 opinionated tools (read + control) |
|
|
304
309
|
| **MCP Prompts (slash commands)** | No | Yes, 6 pre-built workflows |
|
|
305
310
|
| **MCP Sampling (zero server-side LLM cost)** | No | Yes, review triage + response drafts |
|
|
306
311
|
| **Claude Skill bundled** | No | Yes, one-line install |
|
package/USER_GUIDE.md
CHANGED
|
@@ -44,24 +44,25 @@ Manual interruptions you must do yourself:
|
|
|
44
44
|
When: Brand-new app, never been on the store. The hardest flow because of first-time-only Apple constraints.
|
|
45
45
|
|
|
46
46
|
Steps:
|
|
47
|
+
1. `register_bundle_id` - registers the explicit bundle id in the Developer account (idempotent; confirm:true to create). The app record's bundle id picker only lists registered ids.
|
|
47
48
|
MANUAL: the app RECORD must already exist. `POST /v1/apps` is forbidden for API keys, so create the app (name, bundle ID, SKU, primary language) once in App Store Connect > Apps > +. App Groups are portal-only too.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
2. `list_apps` to get the numeric app_id.
|
|
50
|
+
3. Build + upload a binary so a build exists to attach (see topic:binary), or upload via Xcode/Transporter. Then `wait_for_build` until VALID.
|
|
51
|
+
4. `set_app_metadata` - primary/secondary category, copyright, content rights, export compliance (most apps: uses_non_exempt_encryption=false).
|
|
52
|
+
5. `set_app_price` - price_usd:0 for free, or an exact USA price point. Required before submit. Changing a price the app already has needs confirm:true.
|
|
53
|
+
6. `update_version_metadata` - description, keywords, what's-new (note: what's-new is NOT editable on a first 1.0 with no prior release; the tool drops it and reports it skipped), promo text, marketing/support/privacy-policy URLs, name, subtitle. Char limits validated.
|
|
54
|
+
7. `set_app_availability` - all_territories:true, or a list of territories. Turning territories off on an app already set up needs confirm:true.
|
|
55
|
+
8. `set_age_rating` - pass only the declarations that apply; the tool fetches, merges the full V2 set, and submits (it is NOT a partial PATCH).
|
|
56
|
+
9. `set_review_contact` - name, phone, email, demo account if the app needs login. Required before submit.
|
|
57
|
+
10. `attach_build` - newest VALID build by default.
|
|
58
|
+
11. `upload_screenshots` per display type: APP_IPHONE_67 at minimum, plus APP_IPAD_PRO_3GEN_129 if the app runs on iPad. See topic:screenshots.
|
|
58
59
|
MANUAL: App Privacy nutrition label. Not in the API. Run `set_privacy_nutrition` for the exact checklist + deep link, then set it in the ASC website.
|
|
59
60
|
MANUAL: EU DSA trader status. Not in the API. Run `set_eu_trader_status` for steps + deep link; it's a legal decision, set it in the website.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
12. If the app has in-app purchases or subscriptions, create them now (topic:iap / topic:subscriptions). The FIRST ones must be submitted WITH the version (next step).
|
|
62
|
+
13. `release_preflight` with `project_path` if you have the Xcode project - fix every FAIL, confirm anything UNKNOWN by hand, and re-run. It ends with the manual steps for this app's state.
|
|
63
|
+
14. MANUAL (if first IAPs exist): the app's very first in-app purchases CANNOT be bundled with the version via the API. In the ASC website, open the version, Add for Review, tick the products, and submit them together. `submit_for_review` detects this and ABORTS rather than orphaning the version. After the first release is live, later IAPs submit via the API fine.
|
|
64
|
+
15. `submit_for_review` with confirm:true (only if there are no first-IAPs blocking; otherwise submit in the website per the step above).
|
|
65
|
+
16. After approval: `release_version` (confirm:true) to go live now, or `manage_phased_release` start for a 7-day rollout.
|
|
65
66
|
|
|
66
67
|
Manual interruptions you must do yourself:
|
|
67
68
|
- App record + App Group creation - ASC website / Developer portal only.
|
|
@@ -160,12 +161,14 @@ When: Getting a build to testers before App Review.
|
|
|
160
161
|
|
|
161
162
|
Steps:
|
|
162
163
|
1. Upload a build (topic:binary), `wait_for_build` to VALID.
|
|
163
|
-
2. `list_beta_groups` to find
|
|
164
|
-
3. `
|
|
165
|
-
4. `
|
|
164
|
+
2. `list_beta_groups` to find a group. None yet: `create_beta_group` (internal: true for your own team, false for outside testers; idempotent by name; confirm:true to create).
|
|
165
|
+
3. Add testers with `invite_beta_tester` (confirm:true). External group: any email + name, Apple sends the TestFlight invite. Internal group: the email of an App Store Connect user on the account; the tool checks it against the account's users first (needs an Admin key).
|
|
166
|
+
4. `set_beta_test_info` - feedback email, description, marketing and privacy URLs, What to Test for the build, Beta App Review contact. Every value comes from the human; without confirm:true it previews.
|
|
167
|
+
5. `assign_build_to_group` - newest VALID build by default (not needed for a group created with has_access_to_all_builds).
|
|
166
168
|
|
|
167
169
|
Manual interruptions you must do yourself:
|
|
168
|
-
- Beta App Review (
|
|
170
|
+
- Beta App Review (external groups' first build) is submitted from the TestFlight tab of the ASC website once the test information above is set.
|
|
171
|
+
- Export compliance for a build that uses encryption, if Apple asks, is answered in the ASC website.
|
|
169
172
|
|
|
170
173
|
---
|
|
171
174
|
|
|
@@ -174,11 +177,12 @@ Manual interruptions you must do yourself:
|
|
|
174
177
|
When: You need a build on App Store Connect and want to do it from the agent.
|
|
175
178
|
|
|
176
179
|
Steps:
|
|
180
|
+
1. `register_bundle_id` - for a brand-new app, register its explicit bundle id first (idempotent; confirm:true to create). The app record and the profile both need it.
|
|
177
181
|
MANUAL: an Apple Distribution certificate must already exist in your login keychain. Certificate creation and cloud signing are not available to least-privilege API keys.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
+
2. `setup_app_store_signing` - downloads the app's IOS_APP_STORE provisioning profiles (app + extensions), installs them (a new app with none gets one created from the account's distribution certificates with confirm:true), and writes a manual-signing ExportOptions.plist. This sidesteps the cloud-signing permission most API keys lack.
|
|
183
|
+
3. `build_and_archive` - xcodebuild archive + export using that ExportOptions.plist. Requires Xcode on this Mac. Give it the .xcodeproj/.xcworkspace, scheme, and the generated plist.
|
|
184
|
+
4. `upload_binary` confirm:true - uploads the .ipa via altool with your API key.
|
|
185
|
+
5. `wait_for_build` until the build is VALID, then `attach_build`.
|
|
182
186
|
|
|
183
187
|
Manual interruptions you must do yourself:
|
|
184
188
|
- Building requires the local Xcode toolchain; the API cannot compile.
|
package/dist/client.d.ts
CHANGED
|
@@ -27,4 +27,13 @@ export declare class ASCAPIError extends Error {
|
|
|
27
27
|
body: string;
|
|
28
28
|
constructor(status: number, path: string, body: string);
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Translate Apple's terse HTTP errors into something a newcomer can act on.
|
|
32
|
+
* Returns "" when the raw detail is already clear enough (e.g. validation 422s
|
|
33
|
+
* carry their own message).
|
|
34
|
+
*/
|
|
35
|
+
/** Endpoints for bundle ids, capabilities, certificates and profiles: no app version exists behind them. */
|
|
36
|
+
export declare function isSigningFamily(path: string): boolean;
|
|
37
|
+
/** Endpoints where a 409 really can mean the version or submission is in the wrong state. */
|
|
38
|
+
export declare function isVersionFamily(path: string): boolean;
|
|
30
39
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAIzD;;;GAGG;AACH,qBAAa,SAAS;IACR,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,SAAS;IAErC,wDAAwD;IAClD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IA6BpF,8EAA8E;IACxE,KAAK,CAAC,CAAC,EACX,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,EACnC,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,GACb,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IA4BjC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;IAGnC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;IAGpC,GAAG,CAAC,CAAC,EAAE,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AAE,IAAI,EAAE,OAAO;IAGpC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM;IAInB,+CAA+C;IACzC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,SAAK,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IA2CtG;;;OAGG;IACG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAiCjE;AAED,qBAAa,WAAY,SAAQ,KAAK;IAE3B,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;gBAFZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM;CAUtB;AAED;;;;GAIG;AACH,4GAA4G;AAC5G,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,6FAA6F;AAC7F,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD"}
|
package/dist/client.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ASCAPIError = exports.ASCClient = void 0;
|
|
4
|
+
exports.isSigningFamily = isSigningFamily;
|
|
5
|
+
exports.isVersionFamily = isVersionFamily;
|
|
4
6
|
const auth_js_1 = require("./auth.js");
|
|
5
7
|
const BASE_URL = "https://api.appstoreconnect.apple.com";
|
|
6
8
|
/**
|
|
@@ -134,7 +136,7 @@ class ASCAPIError extends Error {
|
|
|
134
136
|
body;
|
|
135
137
|
constructor(status, path, body) {
|
|
136
138
|
const detail = tryParseErrorDetail(body);
|
|
137
|
-
const hint = friendlyHint(status, body);
|
|
139
|
+
const hint = friendlyHint(status, body, path);
|
|
138
140
|
super(`ASC API error ${status} on ${path}: ${detail}` +
|
|
139
141
|
(hint ? `\n\nWhat this usually means: ${hint}` : ""));
|
|
140
142
|
this.status = status;
|
|
@@ -149,7 +151,15 @@ exports.ASCAPIError = ASCAPIError;
|
|
|
149
151
|
* Returns "" when the raw detail is already clear enough (e.g. validation 422s
|
|
150
152
|
* carry their own message).
|
|
151
153
|
*/
|
|
152
|
-
|
|
154
|
+
/** Endpoints for bundle ids, capabilities, certificates and profiles: no app version exists behind them. */
|
|
155
|
+
function isSigningFamily(path) {
|
|
156
|
+
return /^\/v1\/(bundleIds|bundleIdCapabilities|certificates|profiles)(\/|\?|$|\s)/.test(path);
|
|
157
|
+
}
|
|
158
|
+
/** Endpoints where a 409 really can mean the version or submission is in the wrong state. */
|
|
159
|
+
function isVersionFamily(path) {
|
|
160
|
+
return /^\/v1\/(appStoreVersions|appStoreVersionSubmissions|reviewSubmissions|reviewSubmissionItems|appStoreVersionPhasedReleases|appStoreVersionReleaseRequests|builds|appInfos|appInfoLocalizations|appStoreVersionLocalizations|appStoreReviewDetails|appScreenshotSets|appScreenshots)(\/|\?|$|\s)/.test(path);
|
|
161
|
+
}
|
|
162
|
+
function friendlyHint(status, body, path = "") {
|
|
153
163
|
switch (status) {
|
|
154
164
|
case 401:
|
|
155
165
|
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. asc_setup_check (or `npx @pofky/asc-mcp doctor` in a terminal) pinpoints which one.";
|
|
@@ -169,6 +179,12 @@ function friendlyHint(status, body) {
|
|
|
169
179
|
if (/ENTITY_ERROR\.RELATIONSHIP|ENTITY_ERROR\.ATTRIBUTE_REQUIRED|required/i.test(body) && !/STATE_ERROR/.test(body)) {
|
|
170
180
|
return "Something the request needs is missing or points at the wrong resource. The detail above names it.";
|
|
171
181
|
}
|
|
182
|
+
if (isSigningFamily(path)) {
|
|
183
|
+
return "Apple refused this signing request (bundle id, certificate or profile). The detail above says why; nothing was changed.";
|
|
184
|
+
}
|
|
185
|
+
if (path && !isVersionFamily(path)) {
|
|
186
|
+
return "Apple refused this because of a conflict with the resource's current state or an existing resource. The detail above says which; nothing was changed.";
|
|
187
|
+
}
|
|
172
188
|
return "State conflict: the version/product isn't in a state that allows this. For example, you can only edit/submit a version in PREPARE_FOR_SUBMISSION or a rejected state. Check current state with `app_details` or `review_status`.";
|
|
173
189
|
case 429:
|
|
174
190
|
return "Rate limited by Apple. Wait a minute and retry.";
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AA8LA,0CAEC;AAGD,0CAEC;AArMD,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,EAAE,MAA+B;QACxD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,QAAQ,GAAG,IAAI,EAAE,CAAC,CAAC;QAC1C,IAAI,MAAM,EAAE,CAAC;YACX,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;gBAClD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,IAAA,kBAAQ,EAC1B,IAAI,CAAC,MAAM,CAAC,KAAK,EACjB,IAAI,CAAC,MAAM,CAAC,QAAQ,EACpB,IAAI,CAAC,MAAM,CAAC,cAAc,CAC3B,C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pH,OAAO,oGAAoG,CAAC;YAC9G,CAAC;YACD,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1B,OAAO,yHAAyH,CAAC;YACnI,CAAC;YACD,IAAI,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;gBACnC,OAAO,uJAAuJ,CAAC;YACjK,CAAC;YACD,OAAO,kOAAkO,CAAC;QAC5O,KAAK,GAAG;YACN,OAAO,iDAAiD,CAAC;QAC3D;YACE,IAAI,MAAM,IAAI,GAAG;gBAAE,OAAO,mFAAmF,CAAC;YAC9G,OAAO,EAAE,CAAC;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"}
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,8DAA8D;AAC9D,eAAO,MAAM,UAAU,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,8DAA8D;AAC9D,eAAO,MAAM,UAAU,4CAA4C,CAAC;AA8CpE;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAoBjD"}
|
package/dist/errors.js
CHANGED
|
@@ -37,13 +37,19 @@ function isKeyFile(err) {
|
|
|
37
37
|
return true;
|
|
38
38
|
return /^ERR_OSSL|ERR_CRYPTO|DECODER|asn1|PEM|unsupported key|private key/i.test(`${code} ${err.message}`);
|
|
39
39
|
}
|
|
40
|
-
function nextForApple(status) {
|
|
40
|
+
function nextForApple(status, path = "") {
|
|
41
41
|
if (status === 401 || status === 403) {
|
|
42
42
|
return "Next: call asc_setup_check, which tests the key and Issuer ID against Apple and names the exact fix. If it says the key was revoked or lacks a role, the user creates a new key (App Manager or Admin) at " +
|
|
43
43
|
`${connect_js_1.INTEGRATIONS_URL}, then restarts the MCP client.`;
|
|
44
44
|
}
|
|
45
45
|
if (status === 404)
|
|
46
46
|
return "Next: call list_apps to get the right app id, then retry with it.";
|
|
47
|
+
if (status === 409 && (0, client_js_1.isSigningFamily)(path)) {
|
|
48
|
+
return "Next: the detail above names what Apple objects to. Fix that value (or pick a different identifier or name) and call the same tool again; nothing was changed.";
|
|
49
|
+
}
|
|
50
|
+
if (status === 409 && !(0, client_js_1.isVersionFamily)(path)) {
|
|
51
|
+
return "Next: the detail above names what Apple objects to. Fix it and retry, or call asc_setup_check if it is unclear.";
|
|
52
|
+
}
|
|
47
53
|
if (status === 409) {
|
|
48
54
|
return "Next: call review_status or app_details to see the version's current state; the detail above names what Apple objects to.";
|
|
49
55
|
}
|
|
@@ -63,7 +69,7 @@ function nextForApple(status) {
|
|
|
63
69
|
function explainError(err) {
|
|
64
70
|
const msg = err instanceof Error ? err.message : String(err);
|
|
65
71
|
if (err instanceof client_js_1.ASCAPIError)
|
|
66
|
-
return `Error: ${msg}\n\n${nextForApple(err.status)}`;
|
|
72
|
+
return `Error: ${msg}\n\n${nextForApple(err.status, err.path)}`;
|
|
67
73
|
if (isNetwork(err)) {
|
|
68
74
|
return (`Error: could not reach App Store Connect from this computer (${msg}${codeOf(err) ? `, ${codeOf(err)}` : ""}).\n\n` +
|
|
69
75
|
"Next: the user checks the internet connection, VPN or proxy; then retry. If this call was a change, check it with the matching read tool before retrying.");
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAwDH,oCAoBC;AA1ED,2CAA4E;AAC5E,6CAAgD;AAEhD,8DAA8D;AACjD,QAAA,UAAU,GAAG,yCAAyC,CAAC;AAEpE,MAAM,aAAa,GAAG,0GAA0G,CAAC;AAEjI,SAAS,MAAM,CAAC,GAAY;IAC1B,MAAM,CAAC,GAAG,GAA4D,CAAC;IACvE,OAAO,MAAM,CAAC,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,SAAS,CAAC,GAAY;IAC7B,IAAI,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1C,IAAI,GAAG,CAAC,IAAI,KAAK,cAAc,IAAI,GAAG,CAAC,IAAI,KAAK,YAAY;QAAE,OAAO,IAAI,CAAC;IAC1E,OAAO,GAAG,CAAC,OAAO,KAAK,cAAc,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC9G,CAAC;AAED,iFAAiF;AACjF,SAAS,SAAS,CAAC,GAAY;IAC7B,IAAI,CAAC,CAAC,GAAG,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CAAC,GAAY;IACvC,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7D,IAAI,GAAG,YAAY,uBAAW;QAAE,OAAO,UAAU,GAAG,OAAO,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;IAChG,IAAI,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;QACnB,OAAO,CACL,gEAAgE,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ;YACnH,2JAA2J,CAC5J,CAAC;IACJ,CAAC;IACD,IAAI,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;QACnB,OAAO,CACL,0EAA0E,GAAG,QAAQ;YACrF,oKAAoK;YACpK,GAAG,6BAAgB,iHAAiH,CACrI,CAAC;IACJ,CAAC;IACD,OAAO,CACL,UAAU,GAAG,MAAM;QACnB,2JAA2J,kBAAU,GAAG,CACzK,CAAC;AACJ,CAAC"}
|
package/dist/gate.js
CHANGED
|
@@ -214,7 +214,7 @@ function requirePro(tier, capability, tool) {
|
|
|
214
214
|
` ${upgradeUrl(tool)}\n` +
|
|
215
215
|
` (direct link: ${exports.CHECKOUT_URL})\n\n` +
|
|
216
216
|
"Or free for 7 days, no card: call the `asc_start_trial` tool with the user's email. " +
|
|
217
|
-
|
|
217
|
+
`It unlocks all ${tool_meta_js_1.TOOL_COUNT} tools in this session immediately, no restart.\n`) +
|
|
218
218
|
`\n${keyAdvice()}`);
|
|
219
219
|
}
|
|
220
220
|
/**
|
package/dist/gate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate.js","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":";;;AAyBA,gCAGC;AAsFD,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@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readImageSize = readImageSize;
|
|
4
|
+
/** Pixel size from a PNG or JPEG header. No native deps; null when unreadable. */
|
|
5
|
+
function readImageSize(buf) {
|
|
6
|
+
// PNG: 8-byte signature, then IHDR with width and height as big-endian u32.
|
|
7
|
+
if (buf.length >= 24 && buf.readUInt32BE(0) === 0x89504e47 && buf.toString("ascii", 12, 16) === "IHDR") {
|
|
8
|
+
return { width: buf.readUInt32BE(16), height: buf.readUInt32BE(20) };
|
|
9
|
+
}
|
|
10
|
+
// JPEG: walk the segments to a start-of-frame marker.
|
|
11
|
+
if (buf.length > 4 && buf[0] === 0xff && buf[1] === 0xd8) {
|
|
12
|
+
let i = 2;
|
|
13
|
+
while (i + 9 < buf.length) {
|
|
14
|
+
if (buf[i] !== 0xff) {
|
|
15
|
+
i++;
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
const marker = buf[i + 1];
|
|
19
|
+
if (marker === 0xff) {
|
|
20
|
+
i++;
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if (marker === 0xd8 || (marker >= 0xd0 && marker <= 0xd7) || marker === 0x01) {
|
|
24
|
+
i += 2;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
const len = buf.readUInt16BE(i + 2);
|
|
28
|
+
const isSof = marker >= 0xc0 && marker <= 0xcf && marker !== 0xc4 && marker !== 0xc8 && marker !== 0xcc;
|
|
29
|
+
if (isSof)
|
|
30
|
+
return { height: buf.readUInt16BE(i + 5), width: buf.readUInt16BE(i + 7) };
|
|
31
|
+
i += 2 + len;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=image-size.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-size.js","sourceRoot":"","sources":["../src/image-size.ts"],"names":[],"mappings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IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,IAAI,CAAC;YACxG,IAAI,KAAK;gBAAE,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACtF,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAqDA;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,MAOzB,CAAC"}
|