@withpica/mcp-server 2.33.0 → 2.39.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/CHANGELOG.md +261 -0
- package/dist/apps/release.d.ts +2 -0
- package/dist/apps/release.d.ts.map +1 -0
- package/dist/apps/release.js +69 -0
- package/dist/apps/release.js.map +1 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +16 -0
- package/dist/resources/index.js.map +1 -1
- package/dist/server-instructions.d.ts +28 -0
- package/dist/server-instructions.d.ts.map +1 -1
- package/dist/server-instructions.js +34 -0
- package/dist/server-instructions.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +11 -2
- package/dist/server.js.map +1 -1
- package/dist/tools/app-tools.d.ts.map +1 -1
- package/dist/tools/app-tools.js +39 -18
- package/dist/tools/app-tools.js.map +1 -1
- package/dist/tools/credits.d.ts +23 -0
- package/dist/tools/credits.d.ts.map +1 -1
- package/dist/tools/credits.js +199 -0
- package/dist/tools/credits.js.map +1 -1
- package/dist/tools/discovery.d.ts.map +1 -1
- package/dist/tools/discovery.js +24 -2
- package/dist/tools/discovery.js.map +1 -1
- package/dist/tools/index.d.ts +15 -6
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +64 -9
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/metadata.d.ts.map +1 -1
- package/dist/tools/metadata.js +39 -0
- package/dist/tools/metadata.js.map +1 -1
- package/dist/tools/public-filter.d.ts.map +1 -1
- package/dist/tools/public-filter.js +2 -0
- package/dist/tools/public-filter.js.map +1 -1
- package/dist/tools/recording-attribution-hints.d.ts +24 -0
- package/dist/tools/recording-attribution-hints.d.ts.map +1 -0
- package/dist/tools/recording-attribution-hints.js +27 -0
- package/dist/tools/recording-attribution-hints.js.map +1 -0
- package/dist/tools/recordings.d.ts.map +1 -1
- package/dist/tools/recordings.js +30 -3
- package/dist/tools/recordings.js.map +1 -1
- package/dist/tools/release-rich.d.ts +31 -0
- package/dist/tools/release-rich.d.ts.map +1 -0
- package/dist/tools/release-rich.js +240 -0
- package/dist/tools/release-rich.js.map +1 -0
- package/dist/tools/signup.d.ts +26 -0
- package/dist/tools/signup.d.ts.map +1 -0
- package/dist/tools/signup.js +265 -0
- package/dist/tools/signup.js.map +1 -0
- package/dist/tools/subscription.d.ts +60 -0
- package/dist/tools/subscription.d.ts.map +1 -0
- package/dist/tools/subscription.js +440 -0
- package/dist/tools/subscription.js.map +1 -0
- package/package.json +3 -3
- package/server.json +2 -2
- package/dist/__mocks__/mppx-mcp-sdk-server.d.ts +0 -6
- package/dist/__mocks__/mppx-mcp-sdk-server.d.ts.map +0 -1
- package/dist/__mocks__/mppx-mcp-sdk-server.js +0 -6
- package/dist/__mocks__/mppx-mcp-sdk-server.js.map +0 -1
- package/dist/__mocks__/mppx-server.d.ts +0 -12
- package/dist/__mocks__/mppx-server.d.ts.map +0 -1
- package/dist/__mocks__/mppx-server.js +0 -12
- package/dist/__mocks__/mppx-server.js.map +0 -1
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any -- ToolExecutor signature uses Record<string, any> */
|
|
3
|
+
/**
|
|
4
|
+
* Subscription Tools — ADR-210 Phase 2.
|
|
5
|
+
*
|
|
6
|
+
* Two MCP tools that surface the explicit billing read + action layer
|
|
7
|
+
* complementing the ambient `_meta.session_state.billing_slice` shipped
|
|
8
|
+
* in Phase 1:
|
|
9
|
+
*
|
|
10
|
+
* - pica_subscription_status (read; readOnlyHint=true)
|
|
11
|
+
* Wraps `GET /api/admin/subscription`, flattens the response into
|
|
12
|
+
* the 9-field shape ADR-210 § Phase 2 specifies, and composes a
|
|
13
|
+
* templated `summary` line the agent uses verbatim.
|
|
14
|
+
*
|
|
15
|
+
* - pica_subscription_manage (action; readOnlyHint=false)
|
|
16
|
+
* Single-verb dispatcher over the existing
|
|
17
|
+
* `POST /api/admin/subscription` (subscribe / upgrade) and
|
|
18
|
+
* `POST /api/admin/subscription/portal` (manage / cancel) routes.
|
|
19
|
+
* Returns a `resource_link` content block (universal MCP floor)
|
|
20
|
+
* and uses `elicitation/create url` only when the client
|
|
21
|
+
* advertises `capabilities.elicitation.url` per ADR-200 Phase 1
|
|
22
|
+
* (capability-gated; `feedback_mcp_sdk_capability_gates_elicitation.md`).
|
|
23
|
+
*
|
|
24
|
+
* No new Stripe SDK calls — both routes are reused as-is.
|
|
25
|
+
*/
|
|
26
|
+
import { randomUUID } from "node:crypto";
|
|
27
|
+
import { clientSupportsUrlElicitation } from "@withpica/mcp-utils";
|
|
28
|
+
// ADR-205 D7: enterprise is sales-led, not bookable through Checkout.
|
|
29
|
+
// Mirror the route-layer allowlist here for a better tool-side error
|
|
30
|
+
// message before the request leaves the agent.
|
|
31
|
+
const VALID_PAID_TIERS = [
|
|
32
|
+
"solo",
|
|
33
|
+
"indie",
|
|
34
|
+
"pro",
|
|
35
|
+
"established",
|
|
36
|
+
];
|
|
37
|
+
const VALID_ACTIONS = [
|
|
38
|
+
"subscribe",
|
|
39
|
+
"upgrade",
|
|
40
|
+
"manage",
|
|
41
|
+
"cancel",
|
|
42
|
+
];
|
|
43
|
+
/**
|
|
44
|
+
* Compose the flat 9-field response from the existing GET admin route's
|
|
45
|
+
* shape. Mirrors `getOrgBillingSlice`'s "no meaningful cap" rule for
|
|
46
|
+
* `capacity_pct` (0 whenever current_tier is null OR enterprise) and
|
|
47
|
+
* carries through `overflow.recommendedTier` (already
|
|
48
|
+
* `inferTierFromCount`-derived) per Stage 1 Q2.
|
|
49
|
+
*
|
|
50
|
+
* Exported for unit tests.
|
|
51
|
+
*/
|
|
52
|
+
export function flattenStatus(status) {
|
|
53
|
+
const trialEndsAt = status.trialEndsAt;
|
|
54
|
+
const trialDaysRemaining = status.billingState === "trial" && trialEndsAt
|
|
55
|
+
? Math.max(0, Math.ceil((new Date(trialEndsAt).getTime() - Date.now()) / 86_400_000))
|
|
56
|
+
: null;
|
|
57
|
+
const capacityUsed = status.overflow?.currentCount ?? 0;
|
|
58
|
+
const capacityLimit = status.overflow?.capacity ?? null;
|
|
59
|
+
const recommendedTier = status.overflow?.recommendedTier ?? null;
|
|
60
|
+
// Same rule `getOrgBillingSlice` uses — `capacity_pct` is 0 whenever
|
|
61
|
+
// there's no meaningful cap to compare against (trial / enterprise /
|
|
62
|
+
// no overflow row). Avoids fabricating a meaningful percentage from
|
|
63
|
+
// the trial-time inferred recommended tier.
|
|
64
|
+
const hasMeaningfulCap = status.tier !== null &&
|
|
65
|
+
status.tier !== "enterprise" &&
|
|
66
|
+
capacityLimit !== null &&
|
|
67
|
+
capacityLimit > 0;
|
|
68
|
+
const capacityPct = hasMeaningfulCap
|
|
69
|
+
? Math.round((capacityUsed / capacityLimit) * 100)
|
|
70
|
+
: 0;
|
|
71
|
+
return {
|
|
72
|
+
billing_state: status.billingState,
|
|
73
|
+
trial_days_remaining: trialDaysRemaining,
|
|
74
|
+
trial_ends_at: trialEndsAt,
|
|
75
|
+
current_tier: status.tier,
|
|
76
|
+
capacity_used: capacityUsed,
|
|
77
|
+
capacity_limit: capacityLimit,
|
|
78
|
+
capacity_pct: capacityPct,
|
|
79
|
+
recommended_tier: recommendedTier,
|
|
80
|
+
summary: composeSummary({
|
|
81
|
+
billing_state: status.billingState,
|
|
82
|
+
trial_days_remaining: trialDaysRemaining,
|
|
83
|
+
current_tier: status.tier,
|
|
84
|
+
capacity_used: capacityUsed,
|
|
85
|
+
capacity_limit: capacityLimit,
|
|
86
|
+
recommended_tier: recommendedTier,
|
|
87
|
+
}),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Server-side template per Stage 1 Q1 option A. Predictable wording,
|
|
92
|
+
* less variance across connectors. Phase 2.5 may add agent
|
|
93
|
+
* paraphrasing if telemetry shows demand.
|
|
94
|
+
*
|
|
95
|
+
* Exported for unit tests.
|
|
96
|
+
*/
|
|
97
|
+
export function composeSummary(fields) {
|
|
98
|
+
const { billing_state, trial_days_remaining, current_tier, capacity_used, capacity_limit, recommended_tier, } = fields;
|
|
99
|
+
const slotsClause = `${capacity_used} active work${capacity_used === 1 ? "" : "s"}`;
|
|
100
|
+
if (billing_state === "trial") {
|
|
101
|
+
let daysClause;
|
|
102
|
+
if (trial_days_remaining === null) {
|
|
103
|
+
daysClause = "your trial";
|
|
104
|
+
}
|
|
105
|
+
else if (trial_days_remaining === 0) {
|
|
106
|
+
daysClause = "the final day of your trial";
|
|
107
|
+
}
|
|
108
|
+
else if (trial_days_remaining === 1) {
|
|
109
|
+
daysClause = "1 day left of your trial";
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
daysClause = `a ${trial_days_remaining}-day window of your trial`;
|
|
113
|
+
}
|
|
114
|
+
const tierHint = recommended_tier
|
|
115
|
+
? ` Today's catalogue fits the ${recommended_tier} tier.`
|
|
116
|
+
: "";
|
|
117
|
+
return `You're on ${daysClause}. ${slotsClause} so far.${tierHint}`;
|
|
118
|
+
}
|
|
119
|
+
if (billing_state === "hibernated") {
|
|
120
|
+
return `Your trial has ended and the catalogue is read-only. Subscribe to restore writes (${slotsClause} currently held).`;
|
|
121
|
+
}
|
|
122
|
+
// active
|
|
123
|
+
if (current_tier === "enterprise") {
|
|
124
|
+
return `On the enterprise plan (unbounded). ${slotsClause}.`;
|
|
125
|
+
}
|
|
126
|
+
const limitClause = capacity_limit === null
|
|
127
|
+
? slotsClause
|
|
128
|
+
: `${capacity_used} of ${capacity_limit} slots used`;
|
|
129
|
+
const tierClause = current_tier
|
|
130
|
+
? `Currently on ${current_tier}.`
|
|
131
|
+
: "Tier unclassified.";
|
|
132
|
+
return `${tierClause} ${limitClause}.`;
|
|
133
|
+
}
|
|
134
|
+
export class SubscriptionTools {
|
|
135
|
+
pica;
|
|
136
|
+
constructor(pica) {
|
|
137
|
+
this.pica = pica;
|
|
138
|
+
}
|
|
139
|
+
getTools() {
|
|
140
|
+
return [
|
|
141
|
+
{
|
|
142
|
+
definition: {
|
|
143
|
+
name: "pica_subscription_status",
|
|
144
|
+
description: "Read the org's current billing posture. Use when the user asks " +
|
|
145
|
+
"'what's my plan?', 'how many days left on the trial?', 'any " +
|
|
146
|
+
"room left in my tier?', or before nudging them to upgrade. " +
|
|
147
|
+
"Returns billing_state (trial / active / hibernated), trial " +
|
|
148
|
+
"days remaining, current tier, capacity (used / limit / %), " +
|
|
149
|
+
"the smallest tier the catalogue fits today, and a one-line " +
|
|
150
|
+
"summary the agent can use verbatim. ADR-210 Phase 2 — " +
|
|
151
|
+
"complement to the ambient _meta.session_state.billing_slice; " +
|
|
152
|
+
"use this tool when an explicit answer is needed.",
|
|
153
|
+
inputSchema: {
|
|
154
|
+
type: "object",
|
|
155
|
+
properties: {},
|
|
156
|
+
additionalProperties: false,
|
|
157
|
+
},
|
|
158
|
+
annotations: {
|
|
159
|
+
readOnlyHint: true,
|
|
160
|
+
destructiveHint: false,
|
|
161
|
+
idempotentHint: true,
|
|
162
|
+
openWorldHint: false,
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
executor: this.status.bind(this),
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
definition: {
|
|
169
|
+
name: "pica_subscription_manage",
|
|
170
|
+
description: "Mint a Stripe-hosted URL for a billing action. " +
|
|
171
|
+
"action='subscribe' or 'upgrade' opens Stripe Checkout for the " +
|
|
172
|
+
"given tier (one of solo / indie / pro / established — " +
|
|
173
|
+
"enterprise is sales-led). action='manage' or 'cancel' opens " +
|
|
174
|
+
"the Stripe Billing Portal where the customer can update " +
|
|
175
|
+
"payment methods, change tier, or cancel. Returns the URL, " +
|
|
176
|
+
"an ISO expires_at, and `surface` ('checkout' or 'portal'). " +
|
|
177
|
+
"ADR-210 Phase 2 — wraps the existing /api/admin/subscription " +
|
|
178
|
+
"POST + /portal routes; no new Stripe SDK calls. Subscribe / " +
|
|
179
|
+
"upgrade without `tier` returns an error referencing " +
|
|
180
|
+
"pica_subscription_status so the agent can read recommended_tier first.",
|
|
181
|
+
inputSchema: {
|
|
182
|
+
type: "object",
|
|
183
|
+
properties: {
|
|
184
|
+
action: {
|
|
185
|
+
type: "string",
|
|
186
|
+
enum: [...VALID_ACTIONS],
|
|
187
|
+
description: "subscribe / upgrade open Stripe Checkout (require tier); " +
|
|
188
|
+
"manage / cancel open Stripe Billing Portal (no tier).",
|
|
189
|
+
},
|
|
190
|
+
tier: {
|
|
191
|
+
type: "string",
|
|
192
|
+
enum: [...VALID_PAID_TIERS],
|
|
193
|
+
description: "Required for subscribe / upgrade. Solo: 250 active works. " +
|
|
194
|
+
"Indie: 1,000. Pro: 4,000. Established: 15,000.",
|
|
195
|
+
},
|
|
196
|
+
currency: {
|
|
197
|
+
type: "string",
|
|
198
|
+
enum: ["gbp", "usd", "eur"],
|
|
199
|
+
description: "Optional. Defaults to gbp. Honoured only on subscribe / upgrade.",
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
required: ["action"],
|
|
203
|
+
additionalProperties: false,
|
|
204
|
+
},
|
|
205
|
+
annotations: {
|
|
206
|
+
readOnlyHint: false,
|
|
207
|
+
destructiveHint: false,
|
|
208
|
+
idempotentHint: false,
|
|
209
|
+
openWorldHint: true,
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
executor: this.manage.bind(this),
|
|
213
|
+
},
|
|
214
|
+
];
|
|
215
|
+
}
|
|
216
|
+
async status(_args) {
|
|
217
|
+
const status = await this.pica.subscription.getStatus();
|
|
218
|
+
if (!status) {
|
|
219
|
+
// STRIPE_SECRET_KEY unset on this deployment — preview/dev path.
|
|
220
|
+
return {
|
|
221
|
+
content: [
|
|
222
|
+
{
|
|
223
|
+
type: "text",
|
|
224
|
+
text: "Billing is not configured on this deployment. " +
|
|
225
|
+
"Subscription status is unavailable.",
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
structuredContent: {
|
|
229
|
+
kind: "pica.card.subscription_status",
|
|
230
|
+
version: 1,
|
|
231
|
+
data: { billing_unavailable: true },
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
const flat = flattenStatus(status);
|
|
236
|
+
return {
|
|
237
|
+
content: [{ type: "text", text: flat.summary }],
|
|
238
|
+
structuredContent: {
|
|
239
|
+
kind: "pica.card.subscription_status",
|
|
240
|
+
version: 1,
|
|
241
|
+
data: flat,
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
async manage(args, ctx) {
|
|
246
|
+
const action = args.action;
|
|
247
|
+
if (!action || !VALID_ACTIONS.includes(action)) {
|
|
248
|
+
return {
|
|
249
|
+
content: [
|
|
250
|
+
{
|
|
251
|
+
type: "text",
|
|
252
|
+
text: `Error: action must be one of ${VALID_ACTIONS.join(", ")}.`,
|
|
253
|
+
},
|
|
254
|
+
],
|
|
255
|
+
structuredContent: {
|
|
256
|
+
kind: "pica.error.invalid_argument",
|
|
257
|
+
version: 1,
|
|
258
|
+
data: {
|
|
259
|
+
argument: "action",
|
|
260
|
+
valid: [...VALID_ACTIONS],
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
isError: true,
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
const isCheckoutAction = action === "subscribe" || action === "upgrade";
|
|
267
|
+
if (isCheckoutAction) {
|
|
268
|
+
const tier = args.tier;
|
|
269
|
+
if (!tier) {
|
|
270
|
+
// Stage 1 Q3 / coordinator-pinned: return a recoverable error
|
|
271
|
+
// with `next_tool` so the agent can chain to status first
|
|
272
|
+
// rather than auto-pick a tier.
|
|
273
|
+
return {
|
|
274
|
+
content: [
|
|
275
|
+
{
|
|
276
|
+
type: "text",
|
|
277
|
+
text: `subscribe and upgrade require a tier. Call ` +
|
|
278
|
+
`pica_subscription_status to see the recommended tier ` +
|
|
279
|
+
`for this org's current capacity, then retry with that tier.`,
|
|
280
|
+
},
|
|
281
|
+
],
|
|
282
|
+
structuredContent: {
|
|
283
|
+
kind: "pica.error.missing_argument",
|
|
284
|
+
version: 1,
|
|
285
|
+
data: {
|
|
286
|
+
argument: "tier",
|
|
287
|
+
next_tool: "pica_subscription_status",
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
isError: true,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
if (!VALID_PAID_TIERS.includes(tier)) {
|
|
294
|
+
return {
|
|
295
|
+
content: [
|
|
296
|
+
{
|
|
297
|
+
type: "text",
|
|
298
|
+
text: `Error: tier must be one of ${VALID_PAID_TIERS.join(", ")}. ` +
|
|
299
|
+
`Enterprise is sales-led — contact PICA directly.`,
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
structuredContent: {
|
|
303
|
+
kind: "pica.error.invalid_argument",
|
|
304
|
+
version: 1,
|
|
305
|
+
data: {
|
|
306
|
+
argument: "tier",
|
|
307
|
+
valid: [...VALID_PAID_TIERS],
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
isError: true,
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
try {
|
|
314
|
+
const result = await this.pica.subscription.mintCheckout({
|
|
315
|
+
tier,
|
|
316
|
+
currency: typeof args.currency === "string" ? args.currency : "gbp",
|
|
317
|
+
});
|
|
318
|
+
return this.buildLinkResult({
|
|
319
|
+
url: result.checkoutUrl,
|
|
320
|
+
expiresAt: result.expiresAt,
|
|
321
|
+
surface: "checkout",
|
|
322
|
+
name: `Subscribe to PICA (${tier})`,
|
|
323
|
+
description: `Open Stripe Checkout to subscribe to the ${tier} tier.`,
|
|
324
|
+
ctx,
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
catch (err) {
|
|
328
|
+
const message = err instanceof Error ? err.message : "checkout mint failed";
|
|
329
|
+
return {
|
|
330
|
+
content: [
|
|
331
|
+
{ type: "text", text: `Could not mint checkout: ${message}` },
|
|
332
|
+
],
|
|
333
|
+
structuredContent: {
|
|
334
|
+
kind: "pica.error.checkout_mint_failed",
|
|
335
|
+
version: 1,
|
|
336
|
+
data: { error: message },
|
|
337
|
+
},
|
|
338
|
+
isError: true,
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
// manage / cancel → portal
|
|
343
|
+
try {
|
|
344
|
+
const result = await this.pica.subscription.mintPortal();
|
|
345
|
+
return this.buildLinkResult({
|
|
346
|
+
url: result.portalUrl,
|
|
347
|
+
expiresAt: result.expiresAt,
|
|
348
|
+
surface: "portal",
|
|
349
|
+
name: action === "cancel"
|
|
350
|
+
? "Cancel subscription"
|
|
351
|
+
: "Manage subscription",
|
|
352
|
+
description: action === "cancel"
|
|
353
|
+
? "Open the Stripe Billing Portal to cancel your subscription."
|
|
354
|
+
: "Open the Stripe Billing Portal to update payment, change tier, or cancel.",
|
|
355
|
+
ctx,
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
catch (err) {
|
|
359
|
+
const message = err instanceof Error ? err.message : "portal mint failed";
|
|
360
|
+
return {
|
|
361
|
+
content: [
|
|
362
|
+
{
|
|
363
|
+
type: "text",
|
|
364
|
+
text: `Could not open billing portal: ${message}`,
|
|
365
|
+
},
|
|
366
|
+
],
|
|
367
|
+
structuredContent: {
|
|
368
|
+
kind: "pica.error.portal_mint_failed",
|
|
369
|
+
version: 1,
|
|
370
|
+
data: {
|
|
371
|
+
error: message,
|
|
372
|
+
// The route returns "No Stripe customer found — subscribe first"
|
|
373
|
+
// when the org has no stripeCustomerId; surface a recovery hint
|
|
374
|
+
// so the agent can chain.
|
|
375
|
+
next_tool: message.toLowerCase().includes("subscribe first") ||
|
|
376
|
+
message.toLowerCase().includes("no stripe customer")
|
|
377
|
+
? "pica_subscription_manage"
|
|
378
|
+
: undefined,
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
isError: true,
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Universal-floor return per ADR-200 Phase 1: every successful manage
|
|
387
|
+
* response carries a `resource_link` so any compliant MCP client can
|
|
388
|
+
* render or open the URL. Clients that advertise
|
|
389
|
+
* `capabilities.elicitation.url` additionally receive a server-issued
|
|
390
|
+
* elicitation/create request — the gate is mandatory because
|
|
391
|
+
* `elicitInput` with `mode: "url"` throws synchronously against
|
|
392
|
+
* non-supporters (`feedback_mcp_sdk_capability_gates_elicitation.md`).
|
|
393
|
+
*/
|
|
394
|
+
async buildLinkResult(opts) {
|
|
395
|
+
const { url, expiresAt, surface, name, description, ctx } = opts;
|
|
396
|
+
const summary = surface === "checkout"
|
|
397
|
+
? `${name} ready. Open ${url} to complete checkout. Link expires ${expiresAt}.`
|
|
398
|
+
: `${name} ready. Open ${url} to manage your subscription. Link expires ${expiresAt}.`;
|
|
399
|
+
const content = [
|
|
400
|
+
{ type: "text", text: summary },
|
|
401
|
+
{
|
|
402
|
+
type: "resource_link",
|
|
403
|
+
uri: url,
|
|
404
|
+
name,
|
|
405
|
+
description,
|
|
406
|
+
mimeType: "text/html",
|
|
407
|
+
},
|
|
408
|
+
];
|
|
409
|
+
// Capability-gated elicitation/create url — silently degrade on
|
|
410
|
+
// decline / cancel / timeout; the resource_link in the response
|
|
411
|
+
// remains usable.
|
|
412
|
+
if (clientSupportsUrlElicitation(ctx?.server)) {
|
|
413
|
+
try {
|
|
414
|
+
await ctx.server.elicitInput({
|
|
415
|
+
mode: "url",
|
|
416
|
+
url,
|
|
417
|
+
elicitationId: `pica-subscription-${surface}-${randomUUID()}`,
|
|
418
|
+
message: description,
|
|
419
|
+
}, { timeout: 60_000 });
|
|
420
|
+
}
|
|
421
|
+
catch {
|
|
422
|
+
// User declined / cancelled / elicitation timed out. Not an error
|
|
423
|
+
// — the resource_link below is the universal-floor fallback.
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
return {
|
|
427
|
+
content,
|
|
428
|
+
structuredContent: {
|
|
429
|
+
kind: "pica.card.subscription_link",
|
|
430
|
+
version: 1,
|
|
431
|
+
data: {
|
|
432
|
+
url,
|
|
433
|
+
expires_at: expiresAt,
|
|
434
|
+
surface,
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
//# sourceMappingURL=subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.js","sourceRoot":"","sources":["../../src/tools/subscription.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,0GAA0G;AAE1G;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAOzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAQnE,sEAAsE;AACtE,qEAAqE;AACrE,+CAA+C;AAC/C,MAAM,gBAAgB,GAA2B;IAC/C,MAAM;IACN,OAAO;IACP,KAAK;IACL,aAAa;CACd,CAAC;AAEF,MAAM,aAAa,GAAG;IACpB,WAAW;IACX,SAAS;IACT,QAAQ;IACR,QAAQ;CACA,CAAC;AAeX;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAkC;IAElC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;IACvC,MAAM,kBAAkB,GACtB,MAAM,CAAC,YAAY,KAAK,OAAO,IAAI,WAAW;QAC5C,CAAC,CAAC,IAAI,CAAC,GAAG,CACN,CAAC,EACD,IAAI,CAAC,IAAI,CACP,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,UAAU,CAC5D,CACF;QACH,CAAC,CAAC,IAAI,CAAC;IAEX,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE,YAAY,IAAI,CAAC,CAAC;IACxD,MAAM,aAAa,GAAG,MAAM,CAAC,QAAQ,EAAE,QAAQ,IAAI,IAAI,CAAC;IACxD,MAAM,eAAe,GAAG,MAAM,CAAC,QAAQ,EAAE,eAAe,IAAI,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IAAI,gBAAgB,GAAG,8CAA8C,SAAS,GAAG,CAAC;QAE3F,MAAM,OAAO,GAAG;YACd,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,OAAO,EAAE;YACxC;gBACE,IAAI,EAAE,eAAwB;gBAC9B,GAAG,EAAE,GAAG;gBACR,IAAI;gBACJ,WAAW;gBACX,QAAQ,EAAE,WAAW;aACtB;SACF,CAAC;QAEF,gEAAgE;QAChE,gEAAgE;QAChE,kBAAkB;QAClB,IAAI,4BAA4B,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC;YAC9C,IAAI,CAAC;gBACH,MAAM,GAAI,CAAC,MAAO,CAAC,WAAW,CAC5B;oBACE,IAAI,EAAE,KAAc;oBACpB,GAAG;oBACH,aAAa,EAAE,qBAAqB,OAAO,IAAI,UAAU,EAAE,EAAE;oBAC7D,OAAO,EAAE,WAAW;iBACrB,EACD,EAAE,OAAO,EAAE,MAAM,EAAE,CACpB,CAAC;YACJ,CAAC;YAAC,MAAM,CAAC;gBACP,kEAAkE;gBAClE,6DAA6D;YAC/D,CAAC;QACH,CAAC;QAED,OAAO;YACL,OAAO;YACP,iBAAiB,EAAE;gBACjB,IAAI,EAAE,6BAA6B;gBACnC,OAAO,EAAE,CAAC;gBACV,IAAI,EAAE;oBACJ,GAAG;oBACH,UAAU,EAAE,SAAS;oBACrB,OAAO;iBACR;aACF;SACF,CAAC;IACJ,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@withpica/mcp-server",
|
|
3
3
|
"mcpName": "io.github.withpica/pica",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.39.0",
|
|
5
5
|
"description": "MCP Server for PICA Platform - enables AI assistants to interact with PICA",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
34
|
-
"@withpica/mcp-sdk": "^1.
|
|
35
|
-
"@withpica/mcp-utils": "^1.
|
|
34
|
+
"@withpica/mcp-sdk": "^1.17.0",
|
|
35
|
+
"@withpica/mcp-utils": "^1.12.0",
|
|
36
36
|
"mppx": "^0.5.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/withpica/pica",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.39.0",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@withpica/mcp-server",
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.39.0",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mppx-mcp-sdk-server.d.ts","sourceRoot":"","sources":["../../src/__mocks__/mppx-mcp-sdk-server.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS;;;;CAErB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
-
// Mock for mppx/mcp-sdk/server — used in test environment where mppx is not installed
|
|
3
|
-
export const Transport = {
|
|
4
|
-
mcpSdk: () => ({ name: "mcp-sdk" }),
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=mppx-mcp-sdk-server.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mppx-mcp-sdk-server.js","sourceRoot":"","sources":["../../src/__mocks__/mppx-mcp-sdk-server.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,sFAAsF;AAEtF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;CACpC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const Mppx: {
|
|
2
|
-
create: () => {
|
|
3
|
-
charge: () => Promise<{
|
|
4
|
-
success: boolean;
|
|
5
|
-
}>;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export declare const stripe: {
|
|
9
|
-
charge: () => Promise<{}>;
|
|
10
|
-
};
|
|
11
|
-
export declare const Transport: {};
|
|
12
|
-
//# sourceMappingURL=mppx-server.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mppx-server.d.ts","sourceRoot":"","sources":["../../src/__mocks__/mppx-server.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI;;;;;;CAIhB,CAAC;AAEF,eAAO,MAAM,MAAM;;CAElB,CAAC;AAEF,eAAO,MAAM,SAAS,IAAK,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
-
// Mock for mppx/server — used in test environment where mppx is not installed
|
|
3
|
-
export const Mppx = {
|
|
4
|
-
create: () => ({
|
|
5
|
-
charge: async () => ({ success: true }),
|
|
6
|
-
}),
|
|
7
|
-
};
|
|
8
|
-
export const stripe = {
|
|
9
|
-
charge: async () => ({}),
|
|
10
|
-
};
|
|
11
|
-
export const Transport = {};
|
|
12
|
-
//# sourceMappingURL=mppx-server.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mppx-server.js","sourceRoot":"","sources":["../../src/__mocks__/mppx-server.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,8EAA8E;AAE9E,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;QACb,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;KACxC,CAAC;CACH,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC"}
|