@capivv/mcp-server 0.5.47 → 0.5.48

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/dist/client.d.ts CHANGED
@@ -54,6 +54,19 @@ export declare class CapivvClient {
54
54
  * "store says zero territories" from "this product type isn't read-
55
55
  * supported yet."
56
56
  */
57
+ /**
58
+ * V0.5.48 — issue #18 Primitive 3 follow-up. Upload the Apple
59
+ * promotional-offer signing key. Distinct from the ASC API key
60
+ * the customer set via the dashboard's Apple integration flow —
61
+ * promotional offers use a separate .p8 generated under
62
+ * Users and Access → Keys → In-App Purchase.
63
+ */
64
+ setApplePromotionalOfferKey(input: {
65
+ key_id: string;
66
+ private_key: string;
67
+ }): Promise<{
68
+ ok: boolean;
69
+ }>;
57
70
  listStorePrices(productId: string): Promise<{
58
71
  product_id: string;
59
72
  apple_store_product_id?: string;
package/dist/client.js CHANGED
@@ -151,6 +151,16 @@ export class CapivvClient {
151
151
  * "store says zero territories" from "this product type isn't read-
152
152
  * supported yet."
153
153
  */
154
+ /**
155
+ * V0.5.48 — issue #18 Primitive 3 follow-up. Upload the Apple
156
+ * promotional-offer signing key. Distinct from the ASC API key
157
+ * the customer set via the dashboard's Apple integration flow —
158
+ * promotional offers use a separate .p8 generated under
159
+ * Users and Access → Keys → In-App Purchase.
160
+ */
161
+ async setApplePromotionalOfferKey(input) {
162
+ return this.post(`/dashboard/integrations/apple/promotional-offer-key`, input);
163
+ }
154
164
  async listStorePrices(productId) {
155
165
  return this.get(`/dashboard/products/${encodeURIComponent(productId)}/store-prices`);
156
166
  }
@@ -49,6 +49,7 @@ import { registerCreateExperimentTool } from './create-experiment.js';
49
49
  import { registerUpdateExperimentTool } from './update-experiment.js';
50
50
  import { registerUpdateVariantTool } from './update-variant.js';
51
51
  import { registerListStorePricesTool } from './list-store-prices.js';
52
+ import { registerSetApplePromotionalOfferKeyTool } from './set-apple-promotional-offer-key.js';
52
53
  import { registerStartExperimentTool } from './start-experiment.js';
53
54
  import { registerStopExperimentTool } from './stop-experiment.js';
54
55
  import { registerGetExperimentSummaryTool } from './get-experiment-summary.js';
@@ -165,6 +166,7 @@ export function registerAllTools(server, client) {
165
166
  registerUpdateExperimentTool(server, client);
166
167
  registerUpdateVariantTool(server, client);
167
168
  registerListStorePricesTool(server, client);
169
+ registerSetApplePromotionalOfferKeyTool(server, client);
168
170
  registerStartExperimentTool(server, client);
169
171
  registerStopExperimentTool(server, client);
170
172
  registerGetExperimentSummaryTool(server, client);
@@ -0,0 +1,25 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { CapivvClient } from '../client.js';
3
+ /**
4
+ * V0.5.48 — issue #18 Primitive 3 follow-up. Upload the Apple
5
+ * promotional-offer signing key so capivv can issue signed offer
6
+ * payloads for pricing-A/B experiments without per-arm SKU explosion
7
+ * (the v0.5.44 Primitive 3 surface).
8
+ *
9
+ * Customer flow:
10
+ * 1. App Store Connect → Users and Access → Keys → In-App Purchase.
11
+ * 2. Generate a new "Subscription Key" (this is the .p8 file).
12
+ * 3. Note the Key ID shown next to it.
13
+ * 4. Open the .p8 file, copy the full contents including the
14
+ * BEGIN PRIVATE KEY / END PRIVATE KEY lines.
15
+ * 5. Call this tool with key_id + private_key.
16
+ *
17
+ * The backend probe-parses the key with a dummy sign call before
18
+ * persisting, so a paste error returns a clear error here rather
19
+ * than failing 24h later when the SDK first asks for a signature.
20
+ *
21
+ * Distinct from the ASC API key set via capivv_connect_apple_integration —
22
+ * Apple scopes signing authority separately so loss of one doesn't
23
+ * compromise the other.
24
+ */
25
+ export declare function registerSetApplePromotionalOfferKeyTool(server: McpServer, client: CapivvClient): void;
@@ -0,0 +1,38 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * V0.5.48 — issue #18 Primitive 3 follow-up. Upload the Apple
4
+ * promotional-offer signing key so capivv can issue signed offer
5
+ * payloads for pricing-A/B experiments without per-arm SKU explosion
6
+ * (the v0.5.44 Primitive 3 surface).
7
+ *
8
+ * Customer flow:
9
+ * 1. App Store Connect → Users and Access → Keys → In-App Purchase.
10
+ * 2. Generate a new "Subscription Key" (this is the .p8 file).
11
+ * 3. Note the Key ID shown next to it.
12
+ * 4. Open the .p8 file, copy the full contents including the
13
+ * BEGIN PRIVATE KEY / END PRIVATE KEY lines.
14
+ * 5. Call this tool with key_id + private_key.
15
+ *
16
+ * The backend probe-parses the key with a dummy sign call before
17
+ * persisting, so a paste error returns a clear error here rather
18
+ * than failing 24h later when the SDK first asks for a signature.
19
+ *
20
+ * Distinct from the ASC API key set via capivv_connect_apple_integration —
21
+ * Apple scopes signing authority separately so loss of one doesn't
22
+ * compromise the other.
23
+ */
24
+ export function registerSetApplePromotionalOfferKeyTool(server, client) {
25
+ server.tool('capivv_set_apple_promotional_offer_key', "Upload Apple's promotional-offer signing key (.p8) so capivv can sign per-cohort promotional offers for pricing-A/B experiments (variant.config.promotional_offer_config). Distinct from the ASC API key — generated separately in App Store Connect under Users and Access → Keys → In-App Purchase.", {
26
+ key_id: z
27
+ .string()
28
+ .min(1)
29
+ .describe('The Key ID Apple shows next to the generated .p8 file (e.g. "ABC123XYZ"). NOT the same as the ASC API Key ID — separate value.'),
30
+ private_key: z
31
+ .string()
32
+ .min(1)
33
+ .describe('Full contents of the .p8 file Apple generated, including the "-----BEGIN PRIVATE KEY-----" and "-----END PRIVATE KEY-----" lines. The backend probe-parses this before persisting.'),
34
+ }, async (input) => {
35
+ const result = await client.setApplePromotionalOfferKey(input);
36
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
37
+ });
38
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capivv/mcp-server",
3
- "version": "0.5.47",
3
+ "version": "0.5.48",
4
4
  "description": "MCP server for managing Capivv subscription platform via AI assistants",
5
5
  "type": "module",
6
6
  "bin": {