@absolutejs/mcp 0.24.0 → 0.26.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 CHANGED
@@ -6,6 +6,18 @@ This file is generated by `absolute-changelog` from the entries in
6
6
  `changelog/`. Edit an entry, not this file — and add new ones under
7
7
  `changelog/unreleased/`.
8
8
 
9
+ ## 0.26.0 — 2026-09-13
10
+
11
+ ### Added
12
+
13
+ - **Resolve shared commerce policy from authenticated registered callback channels without per-account canary bindings.** (`registeredMcpProfiles`, `registeredMcpCommerce`)
14
+
15
+ ## 0.25.0 — 2026-09-13
16
+
17
+ ### Added
18
+
19
+ - **Add estimate-based background work admission while preserving exact-ID recovery and hard charge caps.** (`McpBackgroundWorkEstimate`, `createBackgroundWorkTools`)
20
+
9
21
  ## 0.24.0 — 2026-09-13
10
22
 
11
23
  ### Added
package/changelog.json CHANGED
@@ -2,6 +2,34 @@
2
2
  "contract": 1,
3
3
  "name": "@absolutejs/mcp",
4
4
  "releases": [
5
+ {
6
+ "changes": [
7
+ {
8
+ "kind": "added",
9
+ "summary": "Resolve shared commerce policy from authenticated registered callback channels without per-account canary bindings.",
10
+ "symbols": [
11
+ "registeredMcpProfiles",
12
+ "registeredMcpCommerce"
13
+ ]
14
+ }
15
+ ],
16
+ "date": "2026-09-13",
17
+ "version": "0.26.0"
18
+ },
19
+ {
20
+ "changes": [
21
+ {
22
+ "kind": "added",
23
+ "summary": "Add estimate-based background work admission while preserving exact-ID recovery and hard charge caps.",
24
+ "symbols": [
25
+ "McpBackgroundWorkEstimate",
26
+ "createBackgroundWorkTools"
27
+ ]
28
+ }
29
+ ],
30
+ "date": "2026-09-13",
31
+ "version": "0.25.0"
32
+ },
5
33
  {
6
34
  "changes": [
7
35
  {
package/dist/index.js CHANGED
@@ -2917,11 +2917,32 @@ var createBackgroundWorkTools = (options) => {
2917
2917
  }
2918
2918
  }
2919
2919
  };
2920
+ const estimate = options.estimate;
2921
+ if (estimate)
2922
+ tools.estimate_background_work = {
2923
+ description: "Estimate service credits for a background plan without reserving credits or starting work. The minimum admits one step; the total estimates the whole plan. Actual usage varies. Get the user's approval for the maximum before starting; never silently increase it.",
2924
+ annotations: { readOnlyHint: true },
2925
+ commerce: { action: "paid_access", categories: ["usage_credits"] },
2926
+ inputSchema: options.inputSchema,
2927
+ handler: async (input) => {
2928
+ const value = await estimate(input);
2929
+ if (![value.minimumCredits, value.estimatedCredits, value.totalSteps].every(Number.isSafeInteger) || value.minimumCredits < 1 || value.estimatedCredits < value.minimumCredits || value.totalSteps < 1 || typeof value.assumptions !== "string" || !value.assumptions)
2930
+ throw new Error("Invalid background work estimate");
2931
+ const summary = {
2932
+ minimumCredits: value.minimumCredits,
2933
+ estimatedCredits: value.estimatedCredits,
2934
+ totalSteps: value.totalSteps,
2935
+ assumptions: value.assumptions,
2936
+ message: "Estimate only, not a quote or guarantee. No credits reserved and no work started. Admission is checked again at start and before each step; work can stop with partial results. The approved maximum charge is never increased."
2937
+ };
2938
+ return { content: [{ type: "text", text: JSON.stringify(summary) }], structuredContent: summary };
2939
+ }
2940
+ };
2920
2941
  const start = options.start;
2921
2942
  if (start)
2922
2943
  tools.start_background_work = budgetedMcpTool({
2923
2944
  tool: {
2924
- description: `${options.description} Launch bounded background work only after the user agrees to the plan and maximum credits. Return the requestId promptly; poll get_background_work for progress.`,
2945
+ description: `${options.description} Use estimate_background_work when available before asking for a budget. Launch bounded background work only after the user agrees to the plan and maximum credits. Return the requestId promptly; poll get_background_work for progress.`,
2925
2946
  inputSchema: options.inputSchema,
2926
2947
  handler: async () => {
2927
2948
  throw new Error("Background work must use durable dispatch");
@@ -2931,6 +2952,37 @@ var createBackgroundWorkTools = (options) => {
2931
2952
  });
2932
2953
  return tools;
2933
2954
  };
2955
+ // src/registeredCommerce.ts
2956
+ var registeredMcpProfiles = (redirectUris) => {
2957
+ if (!redirectUris.length)
2958
+ return ["unknown"];
2959
+ const classify = (value) => {
2960
+ try {
2961
+ const url = new URL(value);
2962
+ if (url.username || url.password)
2963
+ return "unknown";
2964
+ if (url.protocol === "https:" && ["claude.ai", "claude.com"].includes(url.hostname))
2965
+ return "claude-interactive";
2966
+ if (url.protocol === "https:" && ["chatgpt.com", "chat.openai.com"].includes(url.hostname))
2967
+ return "chatgpt-plugin";
2968
+ if (["http:", "https:"].includes(url.protocol) && ["127.0.0.1", "[::1]", "localhost"].includes(url.hostname))
2969
+ return "direct-mcp";
2970
+ if (["vscode:", "vscode-insiders:", "cursor:", "windsurf:"].includes(url.protocol))
2971
+ return "direct-mcp";
2972
+ if (url.origin === "https://vscode.dev" && url.pathname === "/redirect")
2973
+ return "direct-mcp";
2974
+ return "unknown";
2975
+ } catch {
2976
+ return "unknown";
2977
+ }
2978
+ };
2979
+ return [...new Set(redirectUris.map(classify))];
2980
+ };
2981
+ var registeredMcpCommerce = (options) => ({
2982
+ profiles: registeredMcpProfiles(options.redirectUris),
2983
+ reviews: options.reviews,
2984
+ capabilities: options.capabilities
2985
+ });
2934
2986
  export {
2935
2987
  COMMERCE_POLICY_SOURCES,
2936
2988
  COMMERCE_POLICY_VERSION,
@@ -2978,6 +3030,8 @@ export {
2978
3030
  projectWorkPreview,
2979
3031
  protectedResourceMetadata,
2980
3032
  publicMcpTask,
3033
+ registeredMcpCommerce,
3034
+ registeredMcpProfiles,
2981
3035
  verifyBearer,
2982
3036
  withMcpApp
2983
3037
  };
@@ -1,5 +1,11 @@
1
1
  import { type McpCreditWorkRequest } from "./budgetedTool";
2
2
  import type { McpTool, McpToolRegistry, McpToolResult } from "./types";
3
+ export type McpBackgroundWorkEstimate = {
4
+ minimumCredits: number;
5
+ estimatedCredits: number;
6
+ totalSteps: number;
7
+ assumptions: string;
8
+ };
3
9
  /** Public output only. Adapters must scope reads to the authenticated account. */
4
10
  export type McpBackgroundWorkSnapshot = {
5
11
  status: "queued" | "running" | "completed" | "stopped" | "failed" | "unknown";
@@ -16,6 +22,7 @@ export declare const createBackgroundWorkResult: (requestId: string, work: McpBa
16
22
  export declare const createBackgroundWorkTools: (options: {
17
23
  description: string;
18
24
  inputSchema: McpTool["inputSchema"];
25
+ estimate?: (input: unknown) => Promise<McpBackgroundWorkEstimate>;
19
26
  start?: (request: McpCreditWorkRequest) => Promise<McpBackgroundWorkSnapshot>;
20
27
  read: (requestId: string) => Promise<McpBackgroundWorkSnapshot | null>;
21
28
  }) => McpToolRegistry;
@@ -55,3 +55,5 @@ export { createSetupSelectionTools, projectSetupSelection, type SetupSelection,
55
55
  export { createActionWorkflowTools, projectActionReview, projectActionJob, type ActionReview, type ActionConfirmation, type ActionJob, } from "./actionWorkflow";
56
56
  export { createCreditWorkResult, type McpCreditWorkSnapshot, } from "./creditWorkResult";
57
57
  export { createBackgroundWorkTools, createBackgroundWorkResult, type McpBackgroundWorkSnapshot } from "./backgroundWork";
58
+ export type { McpBackgroundWorkEstimate } from "./backgroundWork";
59
+ export { registeredMcpProfiles, registeredMcpCommerce } from "./registeredCommerce";
@@ -0,0 +1,12 @@
1
+ import type { CommerceContext, CommerceProfile, CommerceReview } from "./commerce";
2
+ /** Classify the callback channel from the authenticated OAuth registration.
3
+ * This identifies a transport/distribution shape, not a verified vendor or plan.
4
+ * Never pass tool arguments, clientInfo names, or unbound request metadata. */
5
+ export declare const registeredMcpProfiles: (redirectUris: readonly string[]) => CommerceProfile[];
6
+ /** Every authenticated account shares deployment policy; account ownership and
7
+ * available credit checks remain separate. Mixed callback profiles intersect. */
8
+ export declare const registeredMcpCommerce: (options: {
9
+ redirectUris: readonly string[];
10
+ reviews: readonly CommerceReview[];
11
+ capabilities?: CommerceContext["capabilities"];
12
+ }) => CommerceContext;
@@ -368,3 +368,18 @@ bounded work until their reservation and recovery lifecycle is implemented.
368
368
  This documentation update changes no runtime API, profile, feature flag or
369
369
  published package version. It is available in the shared repository and will
370
370
  ship with the next package release through the existing documentation allowlist.
371
+
372
+ ### Background research estimates
373
+
374
+ `createBackgroundWorkTools({ estimate, start, read, ... })` optionally exposes
375
+ `estimate_background_work`. Its adapter returns minimum credits for one step,
376
+ estimated total credits, total steps and explicit assumptions. Public output is
377
+ identical in text and structured hosts, and omits adapter-private fields. No
378
+ provider work or reservation belongs in the estimate adapter.
379
+
380
+ Estimates use `paid_access` commerce policy, so a restricted host cannot use this
381
+ as a pricing/purchase workaround. Obtain user agreement to the exact plan and
382
+ maximum before start. Server-side start must reevaluate admission atomically;
383
+ never silently raise a maximum. Saved-work reads remain separate and credit-free.
384
+ An estimate is advisory, not an expiring quote or guaranteed cost. Bind input,
385
+ account and maximum durably; exact-ID recovery must not depend on current pricing.
@@ -0,0 +1,61 @@
1
+ # Account-independent service access
2
+
3
+ Reviewed September 13, 2026; re-review by October 13, 2026.
4
+ This supersedes the per-account canary condition for the general-access deployment,
5
+ not the published host restrictions or the requirement for explicit payment approval.
6
+
7
+ ## Scope and decision
8
+
9
+ A customer account is not a distribution channel. Authenticated customers may use
10
+ an independently operated service against their existing service-credit entitlement,
11
+ without buying its portal subscription or being individually allowlisted. Each
12
+ operation still needs account authorization, an explicit maximum, durable metering
13
+ and recovery. Customer charges must never exceed the approved maximum.
14
+
15
+ Native, directly configured MCP connections may return a user-requested link to
16
+ the service's own HTTPS checkout. Card entry and confirmation happen on that page;
17
+ the MCP tool neither collects card data nor charges. Organizational policies may
18
+ block a user's connector; this service does not bypass those controls or certify
19
+ compliance with a customer's private contract. This is a scoped operator
20
+ interpretation, not vendor certification or a statement that every marketplace
21
+ allows commerce.
22
+
23
+ ## Evidence and limits
24
+
25
+ - [MCP authorization](https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization)
26
+ binds access to OAuth scopes and resource owners. The authenticated registration's
27
+ redirect destinations classify a native callback or hosted channel. They do not
28
+ attest a vendor identity, host account plan or marketplace listing.
29
+ - [VS Code MCP documentation](https://code.visualstudio.com/docs/agent-customization/mcp-servers)
30
+ documents direct connections and user/server trust. [GitHub additional terms](https://docs.github.com/en/site-policy/github-terms/github-terms-for-additional-products-and-features)
31
+ distinguish individual and organizational agreements. [Individual terms](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service)
32
+ and [Copilot product terms](https://github.com/customer-terms/github-copilot-product-specific-terms)
33
+ leave users responsible for their use. Our inference is that separately requested
34
+ merchant service work is not resale of the host's own service. Keep independent
35
+ service billing separate and obey the host's access/data controls.
36
+ - [Claude interactive connectors](https://support.claude.com/en/articles/13454812-use-interactive-connectors-in-claude)
37
+ support third-party service accounts. Existing-credit access is separate from
38
+ purchases. In-connector payment operations remain blocked; this release does not
39
+ grant Claude credit-checkout links while that path remains unqualified.
40
+ - [OpenAI plugin guidelines](https://developers.openai.com/plugins/app-guidelines#commerce-and-monetization)
41
+ allow existing paid entitlements while prohibiting digital-credit sales and
42
+ transactional links. Existing work is not a new credit purchase. Keep pricing
43
+ promotions, top-up links, saved-card charges, subscriptions and auto-refill hidden
44
+ from that hosted profile; explain unavailable entitlements without an upsell.
45
+
46
+ ## Shared implementation
47
+
48
+ `registeredMcpProfiles` and `registeredMcpCommerce` classify only callback URIs
49
+ loaded by the server for the authenticated OAuth client. Loopback/native callbacks
50
+ select the direct channel, recognized hosted origins select their restricted
51
+ profile, and unknown or mixed channels fail closed/intersect. Never classify from
52
+ `clientInfo`, a model name, a tool argument, or an unverified query parameter.
53
+ A native callback is not proof of Microsoft, Anthropic or OpenAI affiliation.
54
+ Marketplace deployments must select their marketplace profile explicitly rather
55
+ than reusing a native/direct review. Do not advertise an untested host as tested.
56
+
57
+ The package does not grant access by itself: the deployment supplies dated reviews,
58
+ capabilities, authentication, entitlement checks, rate limits and billing. Restrictive
59
+ published rules override these reviews. Account IDs are used to scope data and
60
+ charges, not to select an eligible customer cohort. Expired review evidence closes
61
+ paid tools while status/recovery remains available.
package/package.json CHANGED
@@ -90,5 +90,5 @@
90
90
  "canary:checkout": "bun canary/checkout.ts"
91
91
  },
92
92
  "types": "./dist/src/index.d.ts",
93
- "version": "0.24.0"
93
+ "version": "0.26.0"
94
94
  }