@capivv/mcp-server 0.5.39 → 0.5.41

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
@@ -47,6 +47,29 @@ export declare class CapivvClient {
47
47
  base_currency?: string;
48
48
  base_country_code?: string;
49
49
  }): Promise<Product>;
50
+ /**
51
+ * V0.5.40 — issue #19. Read current per-territory prices from connected
52
+ * store(s) for a product. Returns `{ apple: [...], google: [...] }`
53
+ * plus `*_supported_for_product` flags so callers can distinguish
54
+ * "store says zero territories" from "this product type isn't read-
55
+ * supported yet."
56
+ */
57
+ listStorePrices(productId: string): Promise<{
58
+ product_id: string;
59
+ apple_store_product_id?: string;
60
+ apple: Array<{
61
+ territory: string;
62
+ currency: string;
63
+ customer_price: string;
64
+ }>;
65
+ apple_supported_for_product: boolean;
66
+ google: Array<{
67
+ territory: string;
68
+ currency: string;
69
+ customer_price: string;
70
+ }>;
71
+ google_supported_for_product: boolean;
72
+ }>;
50
73
  deleteProduct(id: string): Promise<void>;
51
74
  deleteRule(id: string): Promise<void>;
52
75
  activateRule(id: string): Promise<Rule>;
package/dist/client.js CHANGED
@@ -144,6 +144,16 @@ export class CapivvClient {
144
144
  async updateProduct(id, data) {
145
145
  return this.patch(`/dashboard/products/${encodeURIComponent(id)}`, data);
146
146
  }
147
+ /**
148
+ * V0.5.40 — issue #19. Read current per-territory prices from connected
149
+ * store(s) for a product. Returns `{ apple: [...], google: [...] }`
150
+ * plus `*_supported_for_product` flags so callers can distinguish
151
+ * "store says zero territories" from "this product type isn't read-
152
+ * supported yet."
153
+ */
154
+ async listStorePrices(productId) {
155
+ return this.get(`/dashboard/products/${encodeURIComponent(productId)}/store-prices`);
156
+ }
147
157
  async deleteProduct(id) {
148
158
  await this.delete(`/dashboard/products/${encodeURIComponent(id)}`);
149
159
  }
@@ -33,7 +33,7 @@ export function registerCreateExperimentTool(server, client) {
33
33
  config: z
34
34
  .record(z.string(), z.unknown())
35
35
  .optional()
36
- .describe('Variant-specific overrides (paywall config, price, etc.)'),
36
+ .describe('Variant-specific overrides. Two well-known conventions: (1) paywall template overrides — for entity_type=paywall experiments, any key here is deep-merged into the served paywall template (issue #16, v0.5.37). (2) pricing-A/B product override — set `product_override.external_id` (and optionally `product_override.product_id`) to a pre-created store SKU; the SDK helper `Capivv.getAssignedProductForExperiment` reads this to charge a different price per arm without paywall changes (#18 Primitive 1, v0.5.40). Any other custom keys flow through verbatim — the app reads them via `Capivv.getVariantForExperiment().config`.'),
37
37
  }))
38
38
  .describe('Variants to create with the experiment'),
39
39
  }, async (args) => {
@@ -48,6 +48,7 @@ import { registerSetCountryPriceOverrideTool } from './set-country-price-overrid
48
48
  import { registerCreateExperimentTool } from './create-experiment.js';
49
49
  import { registerUpdateExperimentTool } from './update-experiment.js';
50
50
  import { registerUpdateVariantTool } from './update-variant.js';
51
+ import { registerListStorePricesTool } from './list-store-prices.js';
51
52
  import { registerStartExperimentTool } from './start-experiment.js';
52
53
  import { registerStopExperimentTool } from './stop-experiment.js';
53
54
  import { registerGetExperimentSummaryTool } from './get-experiment-summary.js';
@@ -163,6 +164,7 @@ export function registerAllTools(server, client) {
163
164
  registerCreateExperimentTool(server, client);
164
165
  registerUpdateExperimentTool(server, client);
165
166
  registerUpdateVariantTool(server, client);
167
+ registerListStorePricesTool(server, client);
166
168
  registerStartExperimentTool(server, client);
167
169
  registerStopExperimentTool(server, client);
168
170
  registerGetExperimentSummaryTool(server, client);
@@ -0,0 +1,17 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { CapivvClient } from '../client.js';
3
+ /**
4
+ * V0.5.40 — issue #19. Read the CURRENT per-territory prices Apple has
5
+ * on file for a product so the operator can diff against a pricing
6
+ * strategy's proposed output before calling `push_prices_to_stores`.
7
+ *
8
+ * Subscriptions only in v0.5.40 (IAPs walk a different price-schedule
9
+ * graph, filed as followup). Google read parity is also followup.
10
+ *
11
+ * Pair this with `capivv_preview_pricing` to see proposed vs live in
12
+ * one operator session. Note: the operator-facing "Apple is currently
13
+ * selling X for Y" data lives at this surface; `get_product`'s new
14
+ * v0.5.40 `base_*` fields are the *capivv-side* base, not Apple's
15
+ * live tier.
16
+ */
17
+ export declare function registerListStorePricesTool(server: McpServer, client: CapivvClient): void;
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * V0.5.40 — issue #19. Read the CURRENT per-territory prices Apple has
4
+ * on file for a product so the operator can diff against a pricing
5
+ * strategy's proposed output before calling `push_prices_to_stores`.
6
+ *
7
+ * Subscriptions only in v0.5.40 (IAPs walk a different price-schedule
8
+ * graph, filed as followup). Google read parity is also followup.
9
+ *
10
+ * Pair this with `capivv_preview_pricing` to see proposed vs live in
11
+ * one operator session. Note: the operator-facing "Apple is currently
12
+ * selling X for Y" data lives at this surface; `get_product`'s new
13
+ * v0.5.40 `base_*` fields are the *capivv-side* base, not Apple's
14
+ * live tier.
15
+ */
16
+ export function registerListStorePricesTool(server, client) {
17
+ server.tool('capivv_list_store_prices', "Read the current per-country prices Apple (and eventually Google) has on file for a product. Subscriptions only in this release — IAPs and Google return empty arrays with the *_supported_for_product flags = false. Use this to diff proposed pricing-strategy output against live store tiers before pushing.", {
18
+ product_id: z.string().uuid().describe('The capivv product ID'),
19
+ }, async ({ product_id }) => {
20
+ const result = await client.listStorePrices(product_id);
21
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
22
+ });
23
+ }
@@ -29,7 +29,7 @@ export function registerUpdateVariantTool(server, client) {
29
29
  config: z
30
30
  .record(z.string(), z.unknown())
31
31
  .optional()
32
- .describe('New variant config JSON. Apps read this via Capivv.getVariantForExperiment to branch behavior. Server-side merge of this config into served paywall templates is tracked separately (capivv issue #16).'),
32
+ .describe('New variant config JSON. Apps read this via Capivv.getVariantForExperiment to branch behavior. Two well-known conventions: paywall template overrides (deep-merged into the served template, v0.5.37) and pricing-A/B `product_override.external_id` (the SDK helper Capivv.getAssignedProductForExperiment reads this to charge a different SKU per arm, v0.5.40).'),
33
33
  }, async ({ experiment_id, variant_id, ...updates }) => {
34
34
  const updated = await client.updateExperimentVariant(experiment_id, variant_id, updates);
35
35
  return { content: [{ type: 'text', text: JSON.stringify(updated, null, 2) }] };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capivv/mcp-server",
3
- "version": "0.5.39",
3
+ "version": "0.5.41",
4
4
  "description": "MCP server for managing Capivv subscription platform via AI assistants",
5
5
  "type": "module",
6
6
  "bin": {