@aifinpay/mcp 2.11.2 → 2.12.1

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.
@@ -1,9 +1,10 @@
1
1
  import { existsSync, readFileSync } from "node:fs";
2
2
  import { homedir } from "node:os";
3
3
  import { join, resolve } from "node:path";
4
- import { validatePaymentConfig } from "../config.js";
4
+ import { DEFAULT_DAILY_USD, DEFAULT_MAX_GAS_POL, DEFAULT_MAX_USD, validatePaymentConfig } from "../config.js";
5
5
  import { independentNativeUsd } from "../native-price.js";
6
6
  import { payChain } from "../pay-chains.js";
7
+ import { dashboardRefusal, dashboardSentence, readDashboardPolicy } from "../dashboard-policy.js";
7
8
  /**
8
9
  * The one read-only checklist between "server connected" and "first payment".
9
10
  *
@@ -17,18 +18,22 @@ import { payChain } from "../pay-chains.js";
17
18
  */
18
19
  /** The smallest AIFP-1 batch the backend sells, in USD. */
19
20
  export const SMALLEST_BATCH_USD = 0.1;
20
- // The owner settings that let payable_fetch sign, as init prints them. README
21
- // "Enable native paid GET requests" shows the same block; a test keeps the two
22
- // equal and starts a server with it. The gas cap is a worst case at the current
23
- // Polygon gas price, not the fee: 0.05 POL refused every payment at ~280 gwei.
24
- export const PAYMENT_ENV = Object.freeze({
25
- AIFINPAY_PAYMENTS_ENABLED: "1",
21
+ // Optional env the owner may add to narrow the defaults; none of it is needed
22
+ // for a first payment. init prints it as a reference and README "Optional
23
+ // overrides" shows the same block; a test keeps the two equal. The gas cap is a
24
+ // worst case at the current Polygon gas price, not the fee: 0.05 POL refused
25
+ // every payment at ~280 gwei, so the default is 0.3 POL.
26
+ export const PAYMENT_OVERRIDES = Object.freeze({
26
27
  AIFINPAY_GATEWAY_ORIGINS: "https://merchant.example",
27
- AIFINPAY_GATEWAY_PATH_MODE: "direct",
28
- AIFINPAY_MAX_USD: "0.15",
29
- AIFINPAY_DAILY_USD: "1.00",
30
28
  AIFINPAY_MAX_GAS_POL: "0.3",
31
29
  });
30
+ /** How payments work with nothing set, for init's output and the tool text. */
31
+ export const PAYMENTS_DEFAULT_NOTE = `Payments are on by default within a built-in ceiling of $${DEFAULT_MAX_USD} per payment and $${DEFAULT_DAILY_USD} per 24 hours, ` +
32
+ "only through a persistent wallet, only to merchants registered with AiFinPay via a quote signed by its backend; an unfunded wallet spends nothing. " +
33
+ "AIFINPAY_MAX_USD and AIFINPAY_DAILY_USD can only lower that ceiling; AIFINPAY_PAYMENTS_ENABLED=0 turns payments off; " +
34
+ "AIFINPAY_GATEWAY_ORIGINS, when set, is the only list of payable sites.";
35
+ /** Where the owner manages the working limits once the agent is claimed. */
36
+ export const CONTROLS_NOTE = "The working limits are the dashboard Controls: once the agent is linked with agent_claim_self, the owner sets the per-payment cap, daily cap, pause and allowed merchants at https://dash.aifinpay.io, and AiFinPay enforces them on every quote and payment; this server's ceiling applies underneath.";
32
37
  export const INIT_COMMAND = "npx @aifinpay/mcp init";
33
38
  /** POSIX single quotes: the path reaches init byte for byte, spaces and quotes included. */
34
39
  function shellQuote(value) {
@@ -80,9 +85,10 @@ function lockedKeystore(config) {
80
85
  export function paymentSetupStatusTool() {
81
86
  return {
82
87
  name: "payment_setup_status",
83
- description: "Read-only checklist for paying with payable_fetch: wallet (persistent or ephemeral), whether the owner enabled payments, which owner limits are set, the wallet's native balance on the pay chain when readable, and next_step — exactly one instruction for the first unmet item. " +
84
- "First payment in five steps: (1) GET the resource and read its 402 (merchant, price, smallest batch); (2) call payment_setup_status; (3) no persistent wallet: run `npx @aifinpay/mcp init` without a terminal, put its printed env into the MCP client config, reconnect, agent_reload; (4) tell the owner the address and the amount to fund, and have the owner add the payment env (AIFINPAY_PAYMENTS_ENABLED=1, origins, USD limits, gas cap) and reconnect; (5) payable_fetch the URL. " +
85
- "Signs nothing, moves nothing, never asks the owner's limits from the model.",
88
+ description: "Read-only checklist for paying with payable_fetch: wallet (persistent or ephemeral), whether payments are on, the ceiling and each limit with its source (built-in default or the owner's env), the wallet's native balance on the pay chain when readable, the owner's dashboard Controls in `dashboard`, and next_step — exactly one instruction for the first unmet item. " +
89
+ "First payment in five steps: (1) GET the resource and read its 402 (merchant, price, smallest batch); (2) call payment_setup_status; (3) no persistent wallet: run `npx @aifinpay/mcp init` without a terminal, put its printed env into the MCP client config, then call agent_reload (no restart: payments are on by default); (4) tell the owner the address and the amount in `funding` (the smallest batch at today's rate plus the gas cap; if no rate could be read, ask for the batch price in the native currency at today's rate plus the gas cap and name no number), and offer the dashboard link so the owner can claim the agent (agent_claim_self) and set the working limits in Controls; (5) payable_fetch the URL. " +
90
+ PAYMENTS_DEFAULT_NOTE +
91
+ " Moves nothing and signs no payment: for a persistent wallet it signs one short AiFinPay read statement to fetch the owner's Controls. Never asks the owner's limits from the model.",
86
92
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
87
93
  annotations: { readOnlyHint: true, openWorldHint: true, destructiveHint: false },
88
94
  };
@@ -94,21 +100,32 @@ export async function runPaymentSetupStatus(ctx, _args) {
94
100
  function limit(env, value) {
95
101
  return value === undefined ? { env, set: false } : { env, set: true, value };
96
102
  }
103
+ /** A USD limit with its source: the owner's env when they set it, otherwise the
104
+ * built-in ceiling (a programmatic value equal to the ceiling counts as it). */
105
+ function usdLimit(config, env, value, ceiling) {
106
+ if (value === undefined)
107
+ return { env, set: false };
108
+ const source = config.ownerOverrides?.includes(env) || value !== ceiling ? "env" : "default";
109
+ return { env, set: true, value, source };
110
+ }
97
111
  function gasLimit(config, chain) {
98
112
  if (chain.name === "solana")
99
113
  return limit("AIFINPAY_MAX_FEE_LAMPORTS", config.maxFeeLamports);
100
114
  if (config.maxGas !== undefined)
101
- return limit("AIFINPAY_MAX_GAS", config.maxGas);
102
- return limit(chain.name === "polygon" ? "AIFINPAY_MAX_GAS_POL" : "AIFINPAY_MAX_GAS", config.maxGasPol);
115
+ return { ...limit("AIFINPAY_MAX_GAS", config.maxGas), source: "env" };
116
+ if (config.maxGasPol !== undefined)
117
+ return { ...limit("AIFINPAY_MAX_GAS_POL", config.maxGasPol), source: "env" };
118
+ // validatePaymentConfig applies the same default on Polygon; another chain names its own cap.
119
+ if (chain.name === "polygon")
120
+ return { env: "AIFINPAY_MAX_GAS_POL", set: true, value: DEFAULT_MAX_GAS_POL, source: "default" };
121
+ return limit("AIFINPAY_MAX_GAS", undefined);
103
122
  }
104
- /** The example block, with the owner's real origins kept when they already set some. */
105
- export function paymentEnvFor(config) {
106
- return {
107
- ...PAYMENT_ENV,
108
- ...(config.gatewayOrigins?.length ? { AIFINPAY_GATEWAY_ORIGINS: config.gatewayOrigins.join(",") } : {}),
109
- ...(config.maxAmountUsd !== undefined ? { AIFINPAY_MAX_USD: String(config.maxAmountUsd) } : {}),
110
- ...(config.dailyAmountUsd !== undefined ? { AIFINPAY_DAILY_USD: String(config.dailyAmountUsd) } : {}),
111
- };
123
+ /** "the built-in ceiling" or which part of it the owner lowered. */
124
+ function ceilingWords(limits) {
125
+ const lowered = [limits.max_usd, limits.daily_usd].filter((l) => l.source === "env").map((l) => l.env);
126
+ return lowered.length
127
+ ? `the built-in $${DEFAULT_MAX_USD} / $${DEFAULT_DAILY_USD} ceiling, lowered by the owner's ${lowered.join(" and ")}`
128
+ : "the built-in ceiling";
112
129
  }
113
130
  export async function paymentSetupStatus(ctx, options) {
114
131
  const { config } = ctx;
@@ -125,8 +142,8 @@ export async function paymentSetupStatus(ctx, options) {
125
142
  return unready(ctx, source, chain, error.message);
126
143
  }
127
144
  const limits = {
128
- max_usd: limit("AIFINPAY_MAX_USD", config.maxAmountUsd),
129
- daily_usd: limit("AIFINPAY_DAILY_USD", config.dailyAmountUsd),
145
+ max_usd: usdLimit(config, "AIFINPAY_MAX_USD", config.maxAmountUsd, DEFAULT_MAX_USD),
146
+ daily_usd: usdLimit(config, "AIFINPAY_DAILY_USD", config.dailyAmountUsd, DEFAULT_DAILY_USD),
130
147
  gas_cap: gasLimit(config, chain),
131
148
  origins: limit("AIFINPAY_GATEWAY_ORIGINS", config.gatewayOrigins),
132
149
  };
@@ -145,6 +162,7 @@ export async function paymentSetupStatus(ctx, options) {
145
162
  payments_enabled: Boolean(config.paymentsEnabled),
146
163
  pay_chain: chain.name,
147
164
  pay_asset: config.payAsset ?? chain.native,
165
+ ceiling: { max_usd: DEFAULT_MAX_USD, daily_usd: DEFAULT_DAILY_USD },
148
166
  limits,
149
167
  ...(configError ? { config_error: configError } : {}),
150
168
  balance: "unknown",
@@ -159,41 +177,47 @@ export async function paymentSetupStatus(ctx, options) {
159
177
  : `Run \`${initCommand(config.walletHome)}\` (without a terminal it prints JSON; copy its "env" into this server's env in the MCP client config), reconnect the server, then call agent_reload and payment_setup_status again.`);
160
178
  return status;
161
179
  }
162
- if (!config.paymentsEnabled || configError) {
163
- const block = JSON.stringify(paymentEnvFor(config));
164
- status.next_step =
165
- (configError && config.paymentsEnabled
166
- ? `Owner setting refused: ${configError}. `
167
- : `Payments are off until the owner enables them. `) +
168
- `Have the owner add this to the server's env in the MCP client config (their real site origin and limits, not the example), then reconnect: ${block}` +
169
- (configError && !config.paymentsEnabled ? ` Currently missing: ${configError}` : "") +
170
- // The env is read once, at start. An agent that saw agent_reload succeed
171
- // and payments stay off concluded the settings were lost, and stopped.
172
- (config.paymentsEnabled
173
- ? ""
174
- : ` If the owner has already saved these settings, this server has not been restarted since: agent_reload does not read env. Have the client restart the aifinpay MCP server, then call payment_setup_status again.`);
180
+ // The amount to fund is answered whatever the env says: step 4 ("tell the
181
+ // owner the address and the amount") must not wait on it, and the 2026-10-19
182
+ // quote priced $0.10 at 1.08 POL while the guide still said 0.5 — no fixed
183
+ // rate survives, so the tool reads one now.
184
+ const gasCap = status.limits.gas_cap.set && Number(status.limits.gas_cap.value) > 0 ? String(status.limits.gas_cap.value) : undefined;
185
+ const rpc = config.rpcUrl ?? chain.defaultRpc;
186
+ if (options.readBalance && chain.name !== "solana") {
187
+ status.funding = await funding(ctx, chain, rpc, gasCap);
188
+ // The owner's Controls are the working limits once the agent is claimed;
189
+ // read them here so the agent can name them, or offer the link if there is none.
190
+ status.dashboard = await readDashboardPolicy(ctx);
191
+ }
192
+ const withDashboard = (text) => status.dashboard ? `${text} ${dashboardSentence(status.dashboard)}` : text;
193
+ // The env is read once, at start. An agent that saw agent_reload succeed and
194
+ // payments stay off concluded the settings were lost, and stopped: say what
195
+ // the owner changes and that the client must restart the server after.
196
+ const restart = "Env is read only when the server starts and agent_reload does not read it: once the owner has saved the change, have the client restart the aifinpay MCP server (restart the client, or disable and re-enable the server), then call payment_setup_status again.";
197
+ if (!config.paymentsEnabled) {
198
+ status.next_step = withDashboard(`Payments are off: the owner set AIFINPAY_PAYMENTS_ENABLED=0 for this server (they are on by default, within ${ceilingWords(limits)}). ` +
199
+ `To turn them on, the owner removes that variable from the server's env in the MCP client config. ${restart} ${CONTROLS_NOTE}`);
175
200
  return status;
176
201
  }
177
- const gasCap = Number(status.limits.gas_cap.value);
178
- if (options.readBalance && chain.name !== "solana") {
179
- const rpc = config.rpcUrl ?? chain.defaultRpc;
202
+ if (configError) {
203
+ status.next_step = withDashboard(`Owner setting refused: ${configError}. The owner fixes it in the server's env in the MCP client config. ` + restart);
204
+ return status;
205
+ }
206
+ // Paused or expired Controls refuse every quote; funding or paying now would only fail.
207
+ const refusal = status.dashboard && dashboardRefusal(status.dashboard);
208
+ if (refusal) {
209
+ status.next_step = refusal;
210
+ return status;
211
+ }
212
+ if (status.funding) {
180
213
  try {
181
214
  const balance = await nativeBalance(ctx, rpc, ctx.agent.evmAddress);
182
215
  status.balance = { amount: formatNative(balance), asset: chain.native, chain: chain.name, rpc };
183
- const price = await independentNativeUsd({
184
- fetchImpl: (input, init) => ctx.agent.inner.fetchImpl(input, init),
185
- chain,
186
- rpc,
187
- }).catch(() => undefined);
188
- const batchNative = price ? SMALLEST_BATCH_USD / price.usd : 0;
189
- const needed = batchNative + gasCap;
216
+ const needed = status.funding.amount !== undefined ? Number(status.funding.amount) : Number(gasCap);
190
217
  if (Number(status.balance.amount) < needed) {
191
- status.next_step =
192
- `Fund ${ctx.agent.evmAddress} on ${chain.label} with about ${needed.toFixed(2)} ${chain.native}` +
193
- (price
194
- ? ` (the smallest batch is $${SMALLEST_BATCH_USD.toFixed(2)} ≈ ${batchNative.toFixed(4)} ${chain.native} plus up to ${gasCap} ${chain.native} gas; it holds ${status.balance.amount})`
195
- : ` (at least the gas cap of ${gasCap} ${chain.native} plus the batch price; it holds ${status.balance.amount})`) +
196
- `, then call payment_setup_status again.`;
218
+ status.next_step = withDashboard(status.funding.amount !== undefined
219
+ ? `Fund ${ctx.agent.evmAddress} on ${chain.label} with about ${status.funding.amount} ${chain.native} (the smallest batch is $${SMALLEST_BATCH_USD.toFixed(2)} ≈ ${status.funding.batch_native} ${chain.native} at today's rate plus up to ${gasCap} ${chain.native} gas; it holds ${status.balance.amount}), then call payment_setup_status again.`
220
+ : `Fund ${ctx.agent.evmAddress} on ${chain.label} with the batch price in ${chain.native} at today's rate plus the gas cap of ${gasCap} ${chain.native} (the rate could not be read here, so ask the owner to look it up; it holds ${status.balance.amount}), then call payment_setup_status again.`);
197
221
  return status;
198
222
  }
199
223
  }
@@ -202,14 +226,69 @@ export async function paymentSetupStatus(ctx, options) {
202
226
  }
203
227
  }
204
228
  status.ready = true;
205
- status.next_step =
206
- `Ready. Call payable_fetch({"url": "<HTTPS resource on ${config.gatewayOrigins.join(" or ")}>"}); ` +
207
- `it pays at most $${config.maxAmountUsd} per call and $${config.dailyAmountUsd} per 24 hours, with gas capped at ${status.limits.gas_cap.value} ${chain.native}.` +
208
- (status.balance === "unknown"
209
- ? ` The wallet must hold the batch price plus up to the gas cap in ${chain.native} on ${chain.label}.`
210
- : "");
229
+ const sites = config.gatewayOrigins?.length
230
+ ? `on ${config.gatewayOrigins.join(" or ")}`
231
+ : "on any https site (the owner can narrow this with AIFINPAY_GATEWAY_ORIGINS)";
232
+ status.next_step = withDashboard(`Ready. Call payable_fetch({"url": "<HTTPS resource ${sites}>"}); ` +
233
+ `it pays at most $${config.maxAmountUsd} per call and $${config.dailyAmountUsd} per 24 hours (${ceilingWords(limits)}), with gas capped at ${status.limits.gas_cap.value} ${chain.native}, and only merchants registered with AiFinPay are ever paid. ` +
234
+ CONTROLS_NOTE +
235
+ (status.balance === "unknown"
236
+ ? ` The wallet must hold the batch price plus up to the gas cap in ${chain.native} on ${chain.label}` +
237
+ (status.funding?.amount !== undefined ? ` (about ${status.funding.amount} ${chain.native} at today's rate).` : ".")
238
+ : ""));
211
239
  return status;
212
240
  }
241
+ /**
242
+ * The amount to fund, priced now. Never a fixed rate: the number comes from
243
+ * the same independent price sources payable_fetch uses, and when none
244
+ * answers the advice says so and names no number, so the agent asks the owner
245
+ * for "the batch price at today's rate plus the gas cap" instead of inventing one.
246
+ */
247
+ async function funding(ctx, chain, rpc, gasCap) {
248
+ const address = ctx.agent.evmAddress;
249
+ const base = {
250
+ address,
251
+ chain: chain.name,
252
+ asset: chain.native,
253
+ batch_usd: SMALLEST_BATCH_USD,
254
+ ...(gasCap !== undefined ? { gas_cap: gasCap } : {}),
255
+ advice: "",
256
+ };
257
+ const batch = `the smallest batch ($${SMALLEST_BATCH_USD.toFixed(2)})`;
258
+ const cap = gasCap !== undefined ? `the gas cap of ${gasCap} ${chain.native}` : "the gas cap the owner sets";
259
+ try {
260
+ const price = await independentNativeUsd({
261
+ fetchImpl: (input, init) => ctx.agent.inner.fetchImpl(input, init),
262
+ chain,
263
+ rpc,
264
+ });
265
+ const batchNative = SMALLEST_BATCH_USD / price.usd;
266
+ const funded = {
267
+ ...base,
268
+ rate_usd: price.usd,
269
+ rate_source: price.source,
270
+ batch_native: formatAmount(batchNative, 4),
271
+ };
272
+ if (gasCap === undefined) {
273
+ funded.advice = `Fund ${address} on ${chain.label} with ${batch} ≈ ${funded.batch_native} ${chain.native} at today's rate ($${formatAmount(price.usd, 4)}/${chain.native}) plus ${cap}.`;
274
+ return funded;
275
+ }
276
+ funded.amount = formatAmount(batchNative + Number(gasCap), 2);
277
+ funded.advice = `Fund ${address} on ${chain.label} with about ${funded.amount} ${chain.native}: ${batch} ≈ ${funded.batch_native} ${chain.native} at today's rate ($${formatAmount(price.usd, 4)}/${chain.native}) plus up to ${gasCap} ${chain.native} gas.`;
278
+ return funded;
279
+ }
280
+ catch (error) {
281
+ return {
282
+ ...base,
283
+ rate_error: error.message,
284
+ advice: `The ${chain.native}/USD rate could not be read here, so name no amount: ask the owner to fund ${address} on ${chain.label} with the price of ${batch} in ${chain.native} at today's rate plus ${cap}.`,
285
+ };
286
+ }
287
+ }
288
+ /** Fixed decimals for readable amounts; more for ones that would round to zero (ETH on Base). */
289
+ function formatAmount(value, decimals) {
290
+ return value.toFixed(value >= 0.01 || value === 0 ? decimals : 6);
291
+ }
213
292
  function unready(ctx, source, chain, error) {
214
293
  return {
215
294
  ready: false,
@@ -217,9 +296,10 @@ function unready(ctx, source, chain, error) {
217
296
  payments_enabled: Boolean(ctx.config.paymentsEnabled),
218
297
  pay_chain: String(ctx.config.payChain),
219
298
  pay_asset: ctx.config.payAsset ?? chain.native,
299
+ ceiling: { max_usd: DEFAULT_MAX_USD, daily_usd: DEFAULT_DAILY_USD },
220
300
  limits: {
221
- max_usd: limit("AIFINPAY_MAX_USD", ctx.config.maxAmountUsd),
222
- daily_usd: limit("AIFINPAY_DAILY_USD", ctx.config.dailyAmountUsd),
301
+ max_usd: usdLimit(ctx.config, "AIFINPAY_MAX_USD", ctx.config.maxAmountUsd, DEFAULT_MAX_USD),
302
+ daily_usd: usdLimit(ctx.config, "AIFINPAY_DAILY_USD", ctx.config.dailyAmountUsd, DEFAULT_DAILY_USD),
223
303
  gas_cap: limit("AIFINPAY_MAX_GAS", ctx.config.maxGas),
224
304
  origins: limit("AIFINPAY_GATEWAY_ORIGINS", ctx.config.gatewayOrigins),
225
305
  },
@@ -1 +1 @@
1
- {"version":3,"file":"payment-setup-status.js","sourceRoot":"","sources":["../../src/tools/payment-setup-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO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C;AAChC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aifinpay/mcp",
3
- "version": "2.11.2",
3
+ "version": "2.12.1",
4
4
  "mcpName": "io.github.daochild/aifinpay",
5
5
  "description": "AiFinPay MCP: persistent local agent wallets, owner-configured EVM and Solana payment adapters, durable budgets and receipt recovery.",
6
6
  "type": "module",
@@ -76,9 +76,9 @@
76
76
  },
77
77
  "bugs": "https://github.com/AiFinPay/sdk/issues",
78
78
  "dependencies": {
79
- "@aifinpay/agent": "^2.8.0",
80
- "@aifinpay/skill": "^2.10.1",
81
- "@modelcontextprotocol/sdk": "^1.0.0",
79
+ "@aifinpay/agent": "^2.9.0",
80
+ "@aifinpay/skill": "^2.10.2",
81
+ "@modelcontextprotocol/sdk": "^1.32.1",
82
82
  "bs58": "^6.0.0",
83
83
  "tweetnacl": "^1.0.3"
84
84
  },
package/skills/SKILL.md CHANGED
@@ -6,7 +6,7 @@ description: Pay for x402-gated APIs and sites as an agent (AIFP-1 on an owner-s
6
6
  wallet, payment history, prepaid quotas and Agent Passport records through
7
7
  the AiFinPay MCP server or SDK.
8
8
  license: MIT
9
- version: 2.10.1
9
+ version: 2.10.2
10
10
  author: AiFinPay Support
11
11
  metadata:
12
12
  hermes:
@@ -61,17 +61,17 @@ your language. There is no "install together" scenario.
61
61
 
62
62
  ## Version and release status
63
63
 
64
- Release target: MCP **2.11.1**, Node SDK **2.8.0**, Python **2.7.0**.
64
+ Release target: MCP **2.11.3**, Node SDK **2.9.0**, Python **2.7.0**.
65
65
  This skill describes that coordinated package cohort. Check the installed
66
66
  versions before using its additional-network instructions; a release target
67
67
  does not establish npm/PyPI publication or production network activation.
68
- Published baseline checked 2026-10-19: MCP **2.11.0**, Node SDK **2.8.0**.
68
+ Published baseline checked 2026-10-19: MCP **2.11.2**, Node SDK **2.8.0**.
69
69
  `payable_fetch` has shipped since MCP 2.2.0, and Base since MCP 2.5.0.
70
70
  Published packages remain usable within their documented capabilities.
71
71
 
72
72
  | Surface | Can it pay? |
73
73
  |---|---|
74
- | MCP `@aifinpay/mcp` 2.11.x | `payable_fetch`, only with a persistent wallet and every owner limit set; it is always listed and, until then, answers with the setup checklist instead of signing. `payment_setup_status` is the read-only checklist with one `next_step`. Polygon is the default; other networks require explicit `AIFINPAY_PAY_CHAIN`. The merchant and backend must authorize and serve that network. `scope: "merchant"` buys a site-wide batch. |
74
+ | MCP `@aifinpay/mcp` 2.11.x | `payable_fetch`, only with a persistent wallet and every owner limit set; it is always listed and, until then, answers with the setup checklist instead of signing. `payment_setup_status` is the read-only checklist with one `next_step` and, from 2.11.3, `funding`: the amount to fund at today's rate. Polygon is the default; other networks require explicit `AIFINPAY_PAY_CHAIN`. The merchant and backend must authorize and serve that network. `scope: "merchant"` buys a site-wide batch. |
75
75
  | Node `@aifinpay/agent` 2.8.x | `fetchPaid` with a v14 journal, gas cap and owner budgets. Select another network with `v14.chain`; select a pinned stablecoin with `v14.asset`. Native payments require an independent native/USD rate. |
76
76
  | Python `aifinpay-agent` 2.7.x | `agent.fetch_paid(url, allowed_origins=…, max_amount_usd=…, daily_amount_usd=…)`; use explicit `chain` and the chain's native gas cap for another network, or a pinned stablecoin `asset`. `agent.recover_paid(journal_path)` recovers the original transaction. |
77
77
 
@@ -192,8 +192,9 @@ step — no key handling of your own, no funding of an ephemeral address.
192
192
  example `$0.10` for 200 standard requests).
193
193
  2. **Check the setup.** Call `payment_setup_status`. It returns the wallet
194
194
  (`persistent` or ephemeral), `payments_enabled`, which owner limits are
195
- set, the balance when the RPC answers, `ready`, and `next_step` — the one
196
- thing still missing. Follow `next_step`; do not skip ahead.
195
+ set, the balance when the RPC answers, `funding` (what a persistent wallet
196
+ needs, priced now), `ready`, and `next_step` — the one thing still
197
+ missing. Follow `next_step`; do not skip ahead.
197
198
  3. **Persistent wallet.** If `wallet.persistent` is false, run the exact
198
199
  command in `next_step` (it is `npx @aifinpay/mcp init`, prefixed with
199
200
  `AIFINPAY_HOME=…` when the server uses its own wallet directory — keep
@@ -208,11 +209,17 @@ step — no key handling of your own, no funding of an ephemeral address.
208
209
  its `next_step` and start a new wallet directory. Never fund an ephemeral
209
210
  address.
210
211
  4. **Fund and enable.** Tell the owner `addresses.evm` and the amount: the
211
- batch price in the pay chain's native currency plus the gas cap (on
212
- Polygon, about `0.5 POL` covers one `$0.10` batch plus a `0.3 POL` cap).
213
- When the owner confirms funding, they add the payment settings from
214
- "Paying with payable_fetch" below — with their real origin and limits —
215
- to the same `env`. **Limits are read only when the server starts**:
212
+ batch price in the pay chain's native currency at today's rate plus the
213
+ gas cap. Take it from `payment_setup_status` — its `funding` field prices
214
+ the smallest batch now and adds the owner's gas cap into `amount`. The
215
+ rate moves (on 2026-10-19 one `$0.10` batch was 1.08 POL), so never
216
+ quote a remembered number; if `funding` has a `rate_error` and no
217
+ `amount`, ask the owner to fund "the batch price in POL at today's rate
218
+ plus the gas cap" and name no number. When the owner confirms funding,
219
+ they add the payment settings from "Paying with payable_fetch" below —
220
+ with their real origin, and USD values that are a ceiling they will not
221
+ need to revisit (the working limits are set in the dashboard, see "After
222
+ creating a wallet") — to the same `env`. **Limits are read only when the server starts**:
216
223
  `agent_reload` re-reads the keystore and nothing else, so after the env
217
224
  changes the client has to restart the `aifinpay` MCP server (restart the
218
225
  client, or disable and re-enable the server in it). Until that restart
@@ -271,21 +278,28 @@ default `scope`.
271
278
 
272
279
  ## Paying with payable_fetch
273
280
 
274
- The owner configures these MCP environment values (example limits only):
281
+ The owner configures these MCP environment values once (example values; the
282
+ USD ones are a ceiling, not a budget):
275
283
 
276
284
  ```json
277
285
  {
278
286
  "AIFINPAY_PAYMENTS_ENABLED": "1",
279
287
  "AIFINPAY_GATEWAY_ORIGINS": "https://merchant.example",
280
288
  "AIFINPAY_GATEWAY_PATH_MODE": "direct",
281
- "AIFINPAY_MAX_USD": "0.15",
282
- "AIFINPAY_DAILY_USD": "1.00",
289
+ "AIFINPAY_MAX_USD": "5",
290
+ "AIFINPAY_DAILY_USD": "20",
283
291
  "AIFINPAY_MAX_GAS_POL": "0.3"
284
292
  }
285
293
  ```
286
294
 
287
- The smallest batch is **$0.10 plus gas** on **Polygon**; keep `AIFINPAY_MAX_USD`
288
- a little above the batch you expect to buy. The gas cap has to cover the
295
+ `AIFINPAY_MAX_USD` and `AIFINPAY_DAILY_USD` are the ceiling the SDK requires
296
+ before it signs with the owner's key: set once, high enough not to need
297
+ revisiting, and left alone. The day-to-day limits — per-payment cap, daily
298
+ cap, pause, allowed sites — are the dashboard **Controls** once the agent is
299
+ claimed (see "After creating a wallet" below); the backend enforces them on
300
+ every quote and payment, with no env change and no server restart. A payment
301
+ has to pass both. The smallest batch is **$0.10 plus gas** on **Polygon**;
302
+ `AIFINPAY_MAX_USD` only has to be at or above the batch. The gas cap has to cover the
289
303
  worst-case fee: at ~280 gwei that is about 0.10 POL for a POL payment and
290
304
  0.21 POL for USDC, and a lower cap refuses before anything is signed. The fee
291
305
  charged is usually a fraction of that, but the wallet must hold the batch plus
@@ -298,8 +312,9 @@ wallet or create one with `npx @aifinpay/mcp init` (on a terminal it asks for
298
312
  a passphrase; without one it generates it and prints the `env` block to put
299
313
  into the MCP client config — the server's env needs that same
300
314
  `AIFINPAY_WALLET_PASSPHRASE`, or every start mints a new ephemeral wallet);
301
- fund its EVM address on Polygon with POL, or with USDC plus some POL. Funding a wallet does not establish
302
- unlimited spend authority. Use the owner's actual approved limits and origins,
315
+ fund its EVM address on Polygon with POL, or with USDC plus some POL, in the
316
+ amount `payment_setup_status` prices. Funding a wallet does not establish
317
+ unlimited spend authority. Use the owner's actual approved origins and ceiling,
303
318
  then call `payable_fetch({"url":"https://merchant.example/api/data"})`.
304
319
 
305
320
  For another network, the owner sets `AIFINPAY_PAY_CHAIN` to an exact name in
@@ -370,10 +385,16 @@ at https://dash.aifinpay.io → My Agents:
370
385
  `agent.sign_dashboard_claim(challenge)` (Python). These sign only
371
386
  `AiFinPay-claim:polygon:<own address>:<nonce>`.
372
387
 
373
- Keep local owner spending limits in the agent's configuration (`AIFINPAY_MAX_USD`,
374
- `AIFINPAY_DAILY_USD`). Claimed-wallet controls in the dashboard are additional
375
- backend restrictions on quotes and gateway access; they do not replace local
376
- limits or control transactions sent directly outside AiFinPay.
388
+ Once the agent is claimed, the dashboard is where the owner manages its
389
+ working limits: **Controls** on the agent's page sets the per-payment cap, the
390
+ daily cap, pause and the allowed sites, and the backend enforces that policy
391
+ on every `/v1/quote` and `/v1/pay` for the claimed agent — no env change, no
392
+ server restart. The env values (`AIFINPAY_MAX_USD`, `AIFINPAY_DAILY_USD`, the
393
+ gas cap, the origins) stay as the ceiling the SDK requires before it signs;
394
+ they do not replace the dashboard, and the dashboard does not replace them —
395
+ a payment has to pass both. Dashboard controls do not reach transactions sent
396
+ directly outside AiFinPay. After `agent_claim_self`, point the owner at
397
+ Controls rather than at the config file when they want to change a limit.
377
398
 
378
399
  Discover routes on the exact requested origin: `/.well-known/x402.json` and any
379
400
  API catalog linked by that site. A dev hostname does not imply testnet. If a
package/smithery.yaml CHANGED
@@ -1,6 +1,6 @@
1
1
  name: aifinpay
2
2
  displayName: AiFinPay
3
- description: Payment infrastructure for AI agents. A persistent non-custodial agent wallet, Agent Passport resolution, route discovery and non-signing settlement invoices; with owner-set limits, payable_fetch buys prepaid access to AIFP-1 merchants on Polygon or Base, in POL/ETH or a pinned stablecoin.
3
+ description: Payment infrastructure for AI agents. A persistent non-custodial agent wallet, Agent Passport resolution, route discovery and non-signing settlement invoices; within a built-in $5 / $20 ceiling and the owner's dashboard Controls, payable_fetch buys prepaid access to AIFP-1 merchants on Polygon or Base, in POL/ETH or a pinned stablecoin.
4
4
  version: 2.5.0
5
5
  license: MIT
6
6
  homepage: https://aifinpay.io
@@ -66,25 +66,24 @@ configSchema:
66
66
  description: Passphrase for an encrypted agent.json keystore. Without it an encrypted keystore cannot be opened and the server does not start.
67
67
  AIFINPAY_PAYMENTS_ENABLED:
68
68
  type: string
69
- title: Enable payments
70
- description: Set to "1" to register payable_fetch. Requires a persistent wallet and AIFINPAY_MAX_USD, AIFINPAY_DAILY_USD, AIFINPAY_GATEWAY_ORIGINS and a gas cap (AIFINPAY_MAX_GAS, or AIFINPAY_MAX_GAS_POL on Polygon); the server refuses to start if any is missing. Unset or "0" keeps the server read-only.
69
+ title: Payments switch
70
+ description: Payments are on unless set to "0". Only a persistent wallet (npx @aifinpay/mcp init) signs, within the built-in ceiling of $5 per payment and $20 per 24 hours and only to merchants registered with AiFinPay; an unfunded wallet spends nothing. "0" keeps the server read-only.
71
71
  AIFINPAY_MAX_USD:
72
72
  type: string
73
73
  title: Max USD per payment
74
- description: Per-payment cap for payable_fetch. Required when payments are enabled; there is no default. A tool argument can lower it for one call, never raise it.
74
+ description: Lowers the built-in $5 per-payment ceiling of payable_fetch (default 5); a higher value is refused. The working limits are the dashboard Controls. A tool argument can lower it for one call, never raise it.
75
75
  AIFINPAY_DAILY_USD:
76
76
  type: string
77
77
  title: Max USD per 24 hours
78
- description: Rolling 24-hour spending cap for payable_fetch. Required when payments are enabled.
78
+ description: Lowers the built-in $20 rolling 24-hour ceiling of payable_fetch (default 20); a higher value is refused.
79
79
  AIFINPAY_GATEWAY_ORIGINS:
80
80
  type: string
81
81
  title: Payable origins
82
- description: Comma-separated exact HTTPS origins the agent may pay (no wildcards). Required when payments are enabled.
82
+ description: Optional allowlist of comma-separated exact HTTPS origins the agent may pay (no wildcards). Unset, any https site; who is paid is decided by the AiFinPay-signed quote, never by the 402.
83
83
  AIFINPAY_GATEWAY_PATH_MODE:
84
84
  type: string
85
85
  title: Gateway path mode
86
- description: "Use gateway for merchant-slug identity or direct for full request-path identity."
87
- default: gateway
86
+ description: "Use gateway for merchant-slug identity or direct for full request-path identity. Unset, inferred per URL: gateway.aifinpay.io by slug, any other site by path."
88
87
  AIFINPAY_PAY_CHAIN:
89
88
  type: string
90
89
  title: Payment chain