@aifinpay/mcp 2.2.2 → 2.2.4

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.
Files changed (38) hide show
  1. package/README.md +34 -13
  2. package/bin/aifinpay-mcp.js +25 -3
  3. package/dist/directory.d.ts +55 -0
  4. package/dist/directory.d.ts.map +1 -0
  5. package/dist/directory.js +56 -0
  6. package/dist/directory.js.map +1 -0
  7. package/dist/native-price.d.ts +34 -0
  8. package/dist/native-price.d.ts.map +1 -0
  9. package/dist/native-price.js +127 -0
  10. package/dist/native-price.js.map +1 -0
  11. package/dist/server.d.ts.map +1 -1
  12. package/dist/server.js +6 -0
  13. package/dist/server.js.map +1 -1
  14. package/dist/tools/agent-address.d.ts +4 -0
  15. package/dist/tools/agent-address.d.ts.map +1 -1
  16. package/dist/tools/agent-address.js +7 -1
  17. package/dist/tools/agent-address.js.map +1 -1
  18. package/dist/tools/agent-call.d.ts +68 -0
  19. package/dist/tools/agent-call.d.ts.map +1 -0
  20. package/dist/tools/agent-call.js +129 -0
  21. package/dist/tools/agent-call.js.map +1 -0
  22. package/dist/tools/agent-claim-self.d.ts +66 -0
  23. package/dist/tools/agent-claim-self.d.ts.map +1 -0
  24. package/dist/tools/agent-claim-self.js +300 -0
  25. package/dist/tools/agent-claim-self.js.map +1 -0
  26. package/dist/tools/agent-quote.d.ts +41 -0
  27. package/dist/tools/agent-quote.d.ts.map +1 -0
  28. package/dist/tools/agent-quote.js +81 -0
  29. package/dist/tools/agent-quote.js.map +1 -0
  30. package/dist/tools/pay-with-split.d.ts +93 -0
  31. package/dist/tools/pay-with-split.d.ts.map +1 -0
  32. package/dist/tools/pay-with-split.js +138 -0
  33. package/dist/tools/pay-with-split.js.map +1 -0
  34. package/dist/tools/payable-fetch.d.ts.map +1 -1
  35. package/dist/tools/payable-fetch.js +8 -14
  36. package/dist/tools/payable-fetch.js.map +1 -1
  37. package/package.json +2 -2
  38. package/skills/SKILL.md +74 -37
package/README.md CHANGED
@@ -4,11 +4,9 @@ AiFinPay MCP server for persistent agent identity, Agent Passport resolution,
4
4
  route discovery and non-signing settlement invoices. Canonical domain:
5
5
  **aifinpay.io**.
6
6
 
7
- Source candidate **2.2.0**, paired with Node SDK **2.1.0**. The published
8
- MCP 2.1.0 remains read-only; publish the coordinated dependencies before using
9
- this candidate through npm. Source builds support owner-enabled native Polygon
10
- v1.4 purchases with `payable_fetch`. Without payment configuration, the server
11
- keeps its inspection-only tool inventory.
7
+ Version **2.2.4**. Owner-enabled native Polygon v1.4 purchases with
8
+ `payable_fetch` are released (since 2.2.0). Without payment configuration the
9
+ server keeps its inspection-only tool inventory.
12
10
 
13
11
  ## Enable native paid GET requests
14
12
 
@@ -20,7 +18,7 @@ existing configured identity. Keep its passphrase private. The owner must set:
20
18
  "AIFINPAY_PAYMENTS_ENABLED": "1",
21
19
  "AIFINPAY_GATEWAY_ORIGINS": "https://merchant.example",
22
20
  "AIFINPAY_GATEWAY_PATH_MODE": "direct",
23
- "AIFINPAY_MAX_USD": "0.12",
21
+ "AIFINPAY_MAX_USD": "0.15",
24
22
  "AIFINPAY_DAILY_USD": "1.00",
25
23
  "AIFINPAY_MAX_GAS_POL": "0.05"
26
24
  }
@@ -38,7 +36,24 @@ runtime/signer verification and owner limits. It persists the prepared transacti
38
36
  before sending, verifies the receipt, and reuses the purchased batch. No special
39
37
  merchant script, alternate contract or facilitator fallback is used. GET, native
40
38
  POL, Polygon live mode only; Amoy payment receipts and stable-token execution are
41
- not part of this candidate.
39
+ not supported. The smallest batch is $0.10 plus gas, so keep `AIFINPAY_MAX_USD`
40
+ a little above the batch you expect to buy.
41
+
42
+ ### Network access
43
+
44
+ A sandbox that allowlists outbound hosts must allow `api.aifinpay.io` (quotes and
45
+ receipts) and a Polygon RPC. The independent POL/USD rate comes from Chainlink
46
+ on Polygon over that same RPC, then `api.coinbase.com`, then `api.coingecko.com`;
47
+ one of them is enough. If none answers, `payable_fetch` stops before paying and
48
+ the error names each host it tried.
49
+
50
+ ## Link the agent to its owner's dashboard
51
+
52
+ The owner sees the agent's balance, payments and receipts at
53
+ https://dash.aifinpay.io → My Agents. There, **Claim via MCP** generates a
54
+ one-time URL; pass it to `agent_claim_self`. The tool contacts only AiFinPay
55
+ origins, signs only the claim challenge for this agent's own address, and moves
56
+ no funds. Offer this to the owner after `init`.
42
57
 
43
58
  Private recovery state lives at `AIFINPAY_HOME/payments/<evm-address>/state.json`
44
59
  (default home `~/.aifinpay`). State is mode600 in mode700 directories, atomically
@@ -54,6 +69,7 @@ state file in chat. Unconfirmed payments consume the budget conservatively.
54
69
  | Tool | Purpose |
55
70
  | ------------------------ | -------------------------------------------------------- |
56
71
  | `agent_address` | Read the current Solana, EVM and Casper addresses. |
72
+ | `agent_claim_self` | Link this agent to its owner's dashboard (one-time URL). |
57
73
  | `agent_reload` | Reload local wallet files in the current MCP connection. |
58
74
  | `agent_quota` | Read the agent's quota. |
59
75
  | `agent_passport_resolve` | Resolve the global Agent Passport identity. |
@@ -61,8 +77,8 @@ state file in chat. Unconfirmed payments consume the budget conservatively.
61
77
  | `settlement_invoice` | Prepare a non-signing settlement invoice. |
62
78
 
63
79
  `payable_fetch` appears only with valid owner payment configuration and a persistent wallet.
64
- Legacy `agent_call`, `agent_quote`, `pay_with_split`, `quote_split` and
65
- `agent_claim_self` remain unregistered.
80
+ Legacy `agent_call`, `agent_quote`, `pay_with_split` and `quote_split` remain
81
+ unregistered.
66
82
 
67
83
  ## Persistent wallet selection
68
84
 
@@ -88,15 +104,20 @@ wallet. With no configured wallet at all the server has an ephemeral identity:
88
104
 
89
105
  ## Initialize and connect
90
106
 
91
- A quote or invoice is not a completed payment. Enable the owner-configured
92
- `payable_fetch` tool only after installing the coordinated candidate dependencies.
107
+ A quote or invoice is not a completed payment. `payable_fetch` pays only with the
108
+ owner configuration above.
93
109
 
94
110
  ## Local configuration
95
111
 
96
112
  ```bash
97
- npx @aifinpay/mcp init
113
+ AIFINPAY_WALLET_PASSPHRASE='<a long passphrase>' npx @aifinpay/mcp init
98
114
  ```
99
115
 
116
+ The keystore is encrypted at rest and the MCP server needs the same
117
+ `AIFINPAY_WALLET_PASSPHRASE` to load it. For a disposable test wallet only,
118
+ `npx @aifinpay/mcp init --plaintext` writes it unencrypted (mode 600); without
119
+ either, `init` refuses rather than create an unencrypted wallet you might fund.
120
+
100
121
  Select the wallet in this order: `SEED_HASH` → `./aifinpay/agents.json` →
101
122
  legacy `AIFINPAY_AGENT_SECRET` → `~/.aifinpay/agent.json`.
102
123
  SEED_HASH means a 32-byte hex seed, passed directly to SDK `fromSeed`.
@@ -191,7 +212,7 @@ does not enable the retired signing tools in the production RC.
191
212
 
192
213
  Dev quoting does not bypass wallet signatures, issuer verification or
193
214
  receipt metering. See the bundled skill for backend prerequisites. The low-level SDK has an Amoy
194
- executor; this MCP candidate does not expose Amoy paid receipt purchases.
215
+ executor; this MCP does not expose Amoy paid receipt purchases.
195
216
 
196
217
  ## License
197
218
 
@@ -68,7 +68,8 @@ const arg = (process.argv[2] || "").toLowerCase();
68
68
  if (arg === "--help" || arg === "-h" || arg === "help") {
69
69
  process.stdout.write(`aifinpay-mcp ${VERSION}
70
70
 
71
- npx @aifinpay/mcp init create a persistent wallet and print the config
71
+ npx @aifinpay/mcp init create a persistent wallet (encrypted: set AIFINPAY_WALLET_PASSPHRASE;
72
+ unencrypted test wallet: add --plaintext) and print the config
72
73
  npx @aifinpay/mcp start the MCP server (stdio)
73
74
 
74
75
  Run init once. It writes ${KEYSTORE} with mode 600 and the server picks
@@ -171,6 +172,20 @@ if (arg === "init") {
171
172
 
172
173
  let store = readKeystore();
173
174
  let freshlyCreated = false;
175
+ // A new wallet is encrypted at rest unless the owner asks otherwise, by name.
176
+ // It used to be written in plaintext whenever AIFINPAY_WALLET_PASSPHRASE was
177
+ // unset — which is the default — so the documented one-liner produced an
178
+ // unencrypted key for a wallet people then funded. Existing keystores are
179
+ // untouched; only creating a new plaintext one needs the flag.
180
+ if (!store && !PASSPHRASE && !process.argv.includes("--plaintext")) {
181
+ process.stderr.write(
182
+ `No wallet at ${KEYSTORE}, and none will be created unencrypted by default.\n\n` +
183
+ ` Encrypted (recommended): AIFINPAY_WALLET_PASSPHRASE='<a long passphrase>' npx @aifinpay/mcp init\n` +
184
+ ` Disposable test wallet: npx @aifinpay/mcp init --plaintext\n\n` +
185
+ `Keep the passphrase: an encrypted wallet cannot be recovered without it.\n`
186
+ );
187
+ process.exit(2);
188
+ }
174
189
  if (!store) {
175
190
  mkdirSync(HOME, { recursive: true, mode: 0o700 });
176
191
  const secretB58 = Agent.new().secretB58;
@@ -208,7 +223,7 @@ if (arg === "init") {
208
223
  process.stdout.write(
209
224
  PASSPHRASE
210
225
  ? `Created ${KEYSTORE} (mode 600, ENCRYPTED). Keep AIFINPAY_WALLET_PASSPHRASE — the wallet is unrecoverable without it.\n\n`
211
- : `Created ${KEYSTORE} (mode 600, plaintext). For at-rest encryption, set AIFINPAY_WALLET_PASSPHRASE before init.\n\n`
226
+ : `Created ${KEYSTORE} (mode 600, PLAINTEXT — --plaintext). Use it for testing only; for a funded wallet, re-create it with AIFINPAY_WALLET_PASSPHRASE set.\n\n`
212
227
  );
213
228
  } else {
214
229
  process.stdout.write(`Existing wallet found at ${KEYSTORE} — keeping it.\n\n`);
@@ -259,7 +274,14 @@ if (arg === "init") {
259
274
  `Back up ${KEYSTORE}. It is the only copy. The derivation is not\n` +
260
275
  `BIP-39, so no standard wallet can recover this from a phrase.\n\n` +
261
276
  `The EVM address is used for Polygon payments. Check its balance before\n` +
262
- `funding it or paying for calls.\n`
277
+ `funding it or paying for calls.\n\n` +
278
+ `To let it pay, fund the EVM address with POL on Polygon (the smallest\n` +
279
+ `batch is $0.10 plus gas) and add to the env block above:\n` +
280
+ ` AIFINPAY_PAYMENTS_ENABLED=1 AIFINPAY_MAX_USD=0.15 AIFINPAY_DAILY_USD=1.00\n` +
281
+ ` AIFINPAY_MAX_GAS_POL=0.05 AIFINPAY_GATEWAY_ORIGINS=https://<site it may pay>\n\n` +
282
+ `See its balance, payments and receipts in your dashboard:\n` +
283
+ ` https://dash.aifinpay.io → My Agents → Claim via MCP, then give the\n` +
284
+ ` one-time URL to the agent (tool agent_claim_self).\n`
263
285
  );
264
286
  process.exit(0);
265
287
  }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * createDirectoryServer — the READ-ONLY MCP server submitted to the OpenAI
3
+ * ChatGPT App Directory. Distinct from `createServer` (the full BYO-MCP
4
+ * connector with payment execution): this one exposes ONLY the read-only
5
+ * directory tools, requires NO agent identity and NO auth, and never moves
6
+ * money — so it is reviewable under OpenAI's directory policy (Obsidian/32 /34).
7
+ *
8
+ * One codebase, two profiles: the HTTP wrapper picks this when
9
+ * AIFINPAY_MCP_PROFILE=directory.
10
+ */
11
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
12
+ export interface DirectoryServerConfig {
13
+ /** Public API base for the wrapped GET endpoints. Defaults to production. */
14
+ apiBase?: string;
15
+ /** Per-request timeout (ms). */
16
+ timeoutMs?: number;
17
+ log?: (level: "info" | "warn" | "error", msg: string) => void;
18
+ }
19
+ export declare function createDirectoryServer(config?: DirectoryServerConfig): Promise<{
20
+ server: Server<{
21
+ method: string;
22
+ params?: {
23
+ [x: string]: unknown;
24
+ _meta?: {
25
+ [x: string]: unknown;
26
+ progressToken?: string | number | undefined;
27
+ "io.modelcontextprotocol/related-task"?: {
28
+ taskId: string;
29
+ } | undefined;
30
+ } | undefined;
31
+ } | undefined;
32
+ }, {
33
+ method: string;
34
+ params?: {
35
+ [x: string]: unknown;
36
+ _meta?: {
37
+ [x: string]: unknown;
38
+ progressToken?: string | number | undefined;
39
+ "io.modelcontextprotocol/related-task"?: {
40
+ taskId: string;
41
+ } | undefined;
42
+ } | undefined;
43
+ } | undefined;
44
+ }, {
45
+ [x: string]: unknown;
46
+ _meta?: {
47
+ [x: string]: unknown;
48
+ progressToken?: string | number | undefined;
49
+ "io.modelcontextprotocol/related-task"?: {
50
+ taskId: string;
51
+ } | undefined;
52
+ } | undefined;
53
+ }>;
54
+ }>;
55
+ //# sourceMappingURL=directory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../src/directory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAYnE,MAAM,WAAW,qBAAqB;IACpC,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/D;AAwBD,wBAAsB,qBAAqB,CAAC,MAAM,GAAE,qBAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2B7E"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * createDirectoryServer — the READ-ONLY MCP server submitted to the OpenAI
3
+ * ChatGPT App Directory. Distinct from `createServer` (the full BYO-MCP
4
+ * connector with payment execution): this one exposes ONLY the read-only
5
+ * directory tools, requires NO agent identity and NO auth, and never moves
6
+ * money — so it is reviewable under OpenAI's directory policy (Obsidian/32 /34).
7
+ *
8
+ * One codebase, two profiles: the HTTP wrapper picks this when
9
+ * AIFINPAY_MCP_PROFILE=directory.
10
+ */
11
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
12
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
13
+ import { directoryTools, runDirectoryTool, DIRECTORY_API_BASE, } from "./tools/directory.js";
14
+ // Server-wide instructions returned at initialize. ChatGPT/Codex use these as a
15
+ // cross-tool guide (OpenAI readiness checklist item; the audit found it ABSENT
16
+ // on the connector server). States the read-only contract, networks, and limits.
17
+ const DIRECTORY_INSTRUCTIONS = [
18
+ "AiFinPay is payment infrastructure for AI agents. THIS server is the",
19
+ "read-only directory surface: it answers questions about the AiFinPay agent",
20
+ "economy and prices AI services — it does NOT move money, hold funds, sign",
21
+ "transactions, or execute any payment. Every tool is read-only.",
22
+ "",
23
+ "Use it to: list available AI providers and their per-call prices",
24
+ "(list_providers / provider_info / provider_status / service_coverage),",
25
+ "preview a fee-on-top cost breakdown without paying (quote_cost), read public",
26
+ "protocol stats (network_stats) and the on-chain agent leaderboard",
27
+ "(leaderboard), verify an agent's AgentPassport (verify_passport), and look up",
28
+ "a public agent profile (agent_profile).",
29
+ "",
30
+ "Networks: Polygon and Solana mainnet. Data is public on-chain / registry",
31
+ "information. To actually execute a payment, an agent uses the separate",
32
+ "AiFinPay connector or SDK — not this directory app. Requests are rate limited;",
33
+ "on HTTP 429 (rate_limit_exceeded), back off and retry.",
34
+ ].join("\n");
35
+ export async function createDirectoryServer(config = {}) {
36
+ const log = config.log ?? ((lvl, msg) => process.stderr.write(`[${lvl}] ${msg}\n`));
37
+ const ctx = {
38
+ apiBase: (config.apiBase || DIRECTORY_API_BASE).replace(/\/$/, ""),
39
+ timeoutMs: config.timeoutMs ?? 15000,
40
+ log,
41
+ };
42
+ const server = new Server({ name: "@aifinpay/mcp-directory", version: "1.0.0" }, {
43
+ capabilities: { tools: {} },
44
+ instructions: DIRECTORY_INSTRUCTIONS,
45
+ });
46
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({
47
+ tools: directoryTools(),
48
+ }));
49
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
50
+ const { name, arguments: args } = request.params;
51
+ return runDirectoryTool(ctx, name, args ?? {});
52
+ });
53
+ log("info", `[aifinpay-mcp-directory] read-only profile · api=${ctx.apiBase}`);
54
+ return { server };
55
+ }
56
+ //# sourceMappingURL=directory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directory.js","sourceRoot":"","sources":["../src/directory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CA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Ac,EAAE;KACxB,CAAC,CAAC,CAAC;IAEJ,MAAM,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QAChE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;QACjD,OAAO,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,MAAM,EAAE,oDAAoD,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/E,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Independent POL/USD rate for payable_fetch.
3
+ *
4
+ * payable_fetch values a v1.4 quote in USD with a rate it fetches itself —
5
+ * never the quote API's own — so the owner's per-payment and daily USD limits
6
+ * hold even if the quoting server is wrong. Until 2.2.4 that rate came only
7
+ * from api.coinbase.com. An agent in a sandbox that allowlists hosts (a GPT
8
+ * environment, 2026-09-23) could not reach it and every payment stopped before
9
+ * it began, with nothing to try instead.
10
+ *
11
+ * Sources, in order; the first fresh, sane answer wins:
12
+ * 1. Chainlink POL/USD on Polygon, read over the agent's own Polygon RPC —
13
+ * the host the payment already needs, so no extra allowlist entry.
14
+ * 2. api.coinbase.com spot price.
15
+ * 3. api.coingecko.com, id polygon-ecosystem-token. NOT matic-network: that
16
+ * id stopped updating in February 2026 and answers a stale, higher price.
17
+ */
18
+ export declare const CHAINLINK_POL_USD_POLYGON = "0xAB594600376Ec9fD91F8e885dADF0CE036862dE0";
19
+ export interface NativePrice {
20
+ usd: number;
21
+ observedAtMs: number;
22
+ source: "chainlink-polygon" | "coinbase" | "coingecko";
23
+ }
24
+ type FetchImpl = (input: string, init?: RequestInit) => Promise<Response>;
25
+ /**
26
+ * The first independent POL/USD rate any source gives. Throws one error naming
27
+ * every source tried, so an agent in a restricted sandbox knows what to allow.
28
+ */
29
+ export declare function independentPolUsd(opts: {
30
+ fetchImpl: FetchImpl;
31
+ polygonRpc?: string;
32
+ }): Promise<NativePrice>;
33
+ export {};
34
+ //# sourceMappingURL=native-price.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-price.d.ts","sourceRoot":"","sources":["../src/native-price.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,eAAO,MAAM,yBAAyB,+CAA+C,CAAC;AAOtF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,mBAAmB,GAAG,UAAU,GAAG,WAAW,CAAC;CACxD;AAED,KAAK,SAAS,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAsE1E;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAoBjH"}
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Independent POL/USD rate for payable_fetch.
3
+ *
4
+ * payable_fetch values a v1.4 quote in USD with a rate it fetches itself —
5
+ * never the quote API's own — so the owner's per-payment and daily USD limits
6
+ * hold even if the quoting server is wrong. Until 2.2.4 that rate came only
7
+ * from api.coinbase.com. An agent in a sandbox that allowlists hosts (a GPT
8
+ * environment, 2026-09-23) could not reach it and every payment stopped before
9
+ * it began, with nothing to try instead.
10
+ *
11
+ * Sources, in order; the first fresh, sane answer wins:
12
+ * 1. Chainlink POL/USD on Polygon, read over the agent's own Polygon RPC —
13
+ * the host the payment already needs, so no extra allowlist entry.
14
+ * 2. api.coinbase.com spot price.
15
+ * 3. api.coingecko.com, id polygon-ecosystem-token. NOT matic-network: that
16
+ * id stopped updating in February 2026 and answers a stale, higher price.
17
+ */
18
+ // Chainlink's MATIC/USD aggregator proxy on Polygon PoS. POL replaced MATIC
19
+ // 1:1 and the feed kept its name ("MATIC / USD"); 8 decimals. Read 2026-09-23:
20
+ // 0.1064, updated 3 s earlier, within 0.1% of Coinbase.
21
+ export const CHAINLINK_POL_USD_POLYGON = "0xAB594600376Ec9fD91F8e885dADF0CE036862dE0";
22
+ const LATEST_ROUND_DATA = "0xfeaf968c"; // latestRoundData()
23
+ const CHAINLINK_DECIMALS = 8;
24
+ // The feed updates on a 0.5% deviation or its heartbeat; a quiet market can
25
+ // leave it for a while. Older than this and it is not trusted as "current".
26
+ const MAX_FEED_AGE_S = 3600;
27
+ const sane = (usd) => Number.isFinite(usd) && usd > 0 && usd < 1000;
28
+ async function boundedJson(response, limit = 16 * 1024) {
29
+ const text = await response.text();
30
+ if (text.length > limit)
31
+ throw new Error("price response exceeds limit");
32
+ return JSON.parse(text);
33
+ }
34
+ async function fromChainlink(fetchImpl, rpc) {
35
+ const response = await fetchImpl(rpc, {
36
+ method: "POST",
37
+ headers: { "content-type": "application/json" },
38
+ body: JSON.stringify({
39
+ jsonrpc: "2.0",
40
+ id: 1,
41
+ method: "eth_call",
42
+ params: [{ to: CHAINLINK_POL_USD_POLYGON, data: LATEST_ROUND_DATA }, "latest"],
43
+ }),
44
+ signal: AbortSignal.timeout(10_000),
45
+ redirect: "manual",
46
+ });
47
+ if (!response.ok)
48
+ throw new Error(`rpc ${response.status}`);
49
+ const body = (await boundedJson(response));
50
+ const hex = typeof body.result === "string" ? body.result.replace(/^0x/, "") : "";
51
+ // (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
52
+ if (hex.length < 64 * 5)
53
+ throw new Error("malformed latestRoundData");
54
+ const word = (i) => BigInt("0x" + hex.slice(i * 64, (i + 1) * 64));
55
+ const answer = word(1);
56
+ const updatedAt = Number(word(3));
57
+ if (answer <= 0n || answer >= 2n ** 255n)
58
+ throw new Error("non-positive answer");
59
+ const ageS = Math.floor(Date.now() / 1000) - updatedAt;
60
+ if (ageS > MAX_FEED_AGE_S)
61
+ throw new Error(`feed is ${ageS}s old`);
62
+ const usd = Number(answer) / 10 ** CHAINLINK_DECIMALS;
63
+ if (!sane(usd))
64
+ throw new Error("implausible answer");
65
+ return { usd, observedAtMs: Date.now(), source: "chainlink-polygon" };
66
+ }
67
+ async function fromCoinbase(fetchImpl) {
68
+ const response = await fetchImpl("https://api.coinbase.com/v2/prices/POL-USD/spot", {
69
+ signal: AbortSignal.timeout(10_000),
70
+ redirect: "manual",
71
+ });
72
+ if (!response.ok)
73
+ throw new Error(`http ${response.status}`);
74
+ const data = (await boundedJson(response));
75
+ const usd = Number(data.data?.amount);
76
+ if (data.data?.base !== "POL" || data.data?.currency !== "USD" || !sane(usd)) {
77
+ throw new Error("invalid response");
78
+ }
79
+ return { usd, observedAtMs: Date.now(), source: "coinbase" };
80
+ }
81
+ async function fromCoinGecko(fetchImpl) {
82
+ const response = await fetchImpl("https://api.coingecko.com/api/v3/simple/price?ids=polygon-ecosystem-token&vs_currencies=usd&include_last_updated_at=true", { signal: AbortSignal.timeout(10_000), redirect: "manual" });
83
+ if (!response.ok)
84
+ throw new Error(`http ${response.status}`);
85
+ const data = (await boundedJson(response));
86
+ const entry = data["polygon-ecosystem-token"];
87
+ const usd = Number(entry?.usd);
88
+ const ageS = Math.floor(Date.now() / 1000) - Number(entry?.last_updated_at ?? 0);
89
+ if (!sane(usd))
90
+ throw new Error("invalid response");
91
+ if (!(ageS <= MAX_FEED_AGE_S))
92
+ throw new Error(`price is ${ageS}s old`);
93
+ return { usd, observedAtMs: Date.now(), source: "coingecko" };
94
+ }
95
+ /**
96
+ * The first independent POL/USD rate any source gives. Throws one error naming
97
+ * every source tried, so an agent in a restricted sandbox knows what to allow.
98
+ */
99
+ export async function independentPolUsd(opts) {
100
+ const attempts = [];
101
+ const rpc = opts.polygonRpc;
102
+ if (rpc)
103
+ attempts.push([`Chainlink on Polygon via ${hostOf(rpc)}`, () => fromChainlink(opts.fetchImpl, rpc)]);
104
+ attempts.push(["api.coinbase.com", () => fromCoinbase(opts.fetchImpl)]);
105
+ attempts.push(["api.coingecko.com", () => fromCoinGecko(opts.fetchImpl)]);
106
+ const failures = [];
107
+ for (const [label, attempt] of attempts) {
108
+ try {
109
+ return await attempt();
110
+ }
111
+ catch (e) {
112
+ failures.push(`${label}: ${e instanceof Error ? e.message : String(e)}`);
113
+ }
114
+ }
115
+ throw new Error("Independent POL/USD price unavailable — nothing was paid. Tried " +
116
+ failures.join("; ") +
117
+ ". Allow outbound access to one of these hosts.");
118
+ }
119
+ function hostOf(url) {
120
+ try {
121
+ return new URL(url).host;
122
+ }
123
+ catch {
124
+ return "the configured RPC";
125
+ }
126
+ }
127
+ //# sourceMappingURL=native-price.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-price.js","sourceRoot":"","sources":["../src/native-price.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,4EAA4E;AAC5E,+EAA+E;AAC/E,wDAAwD;AACxD,MAAM,CAAC,MAAM,yBAAyB,GAAG,4CAA4C,CAAC;AACtF,MAAM,iBAAiB,GAAG,YAAY,CAAC,CAAC,oBAAoB;AAC5D,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,4EAA4E;AAC5E,4EAA4E;AAC5E,MAAM,cAAc,GAAG,IAAI,CAAC;AAU5B,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC;AAE5E,KAAK,UAAU,WAAW,CAAC,QAAkB,EAAE,KAAK,GAAG,EAAE,GAAG,IAAI;IAC9D,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,IAAI,IAAI,CAAC,MAAM,GAAG,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,8B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,CAAC,IAAI,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,oBAAoB,CAAC;IAC9B,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAQnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAQ7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AA0BvD;gFACgF;AAChF,wBAAsB,YAAY,CAAC,MAAM,GAAE,SAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4KxD;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,SAAS,CAAC;IAClB,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9D"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAQnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAS7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AA0BvD;gFACgF;AAChF,wBAAsB,YAAY,CAAC,MAAM,GAAE,SAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiLxD;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,SAAS,CAAC;IAClB,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9D"}
package/dist/server.js CHANGED
@@ -6,6 +6,7 @@ import { loadWalletIdentity } from "./identity.js";
6
6
  import { agentHistoryTool, runAgentHistory } from "./tools/agent-history.js";
7
7
  import { devPaymentQuoteTool, runDevPaymentQuote } from "./tools/dev-payment-quote.js";
8
8
  import { agentAddressTool, runAgentAddress } from "./tools/agent-address.js";
9
+ import { agentClaimSelfTool, runAgentClaimSelf } from "./tools/agent-claim-self.js";
9
10
  import { agentQuotaTool, runAgentQuota } from "./tools/agent-quota.js";
10
11
  import { makeSafeFetch } from "./safe-fetch.js";
11
12
  import { loadConfigFromEnv, validatePaymentConfig } from "./config.js";
@@ -92,6 +93,9 @@ export async function createServer(config = {}) {
92
93
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
93
94
  tools: [
94
95
  agentAddressTool(),
96
+ // Links the agent to its owner's dashboard. Signs only an AiFinPay claim
97
+ // challenge for this agent's own address, on allowed origins; no funds.
98
+ agentClaimSelfTool(),
95
99
  {
96
100
  name: "agent_reload",
97
101
  description: "Reload the configured local wallet files after init or a file update, without starting a new conversation. Returns public addresses only. Shell environment changes still require reconnecting the MCP process.",
@@ -152,6 +156,8 @@ export async function createServer(config = {}) {
152
156
  return runPayableFetch(ctx, args ?? {});
153
157
  case "agent_address":
154
158
  return runAgentAddress(ctx, args ?? {});
159
+ case "agent_claim_self":
160
+ return runAgentClaimSelf(ctx, args ?? {});
155
161
  case "agent_quota":
156
162
  return runAgentQuota(ctx, args ?? {});
157
163
  case "agent_history":
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAA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,wBAAwB;gBAC3B,OAAO,uBAAuB,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;YAClD,KAAK,mBAAmB;gBACtB,OAAO,mBAAmB,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;YAC9C,KAAK,oBAAoB;gBACvB,OAAO,oBAAoB,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;YAC/C,KAAK,mBAAmB;gBACtB,OAAO,mBAAmB,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;YAC9C,KAAK,mBAAmB;gBACtB,OAAO,mBAAmB,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;YAC9C,KAAK,iBAAiB;gBACpB,OAAO,iBAAiB,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;YAC5C;gBACE,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,IAAI,EAAE,EAAE,CAAC;iBACtE,CAAC;QACN,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,MAAM;QACN,IAAI,KAAK;YACP,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC;AASD,SAAS,UAAU,CAAC,KAAgC,EAAE,GAAW;IAC/D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,GAAG,IAAI,CAAC,CAAC;AAC9C,CAAC"}
@@ -29,6 +29,9 @@ export declare function agentAddressTool(): {
29
29
  note: {
30
30
  type: string;
31
31
  };
32
+ dashboard: {
33
+ type: string;
34
+ };
32
35
  };
33
36
  required: string[];
34
37
  };
@@ -43,6 +46,7 @@ export declare function runAgentAddress(ctx: ToolContext, _args: Record<string,
43
46
  evm: string;
44
47
  casper: string;
45
48
  note: string;
49
+ dashboard: string;
46
50
  };
47
51
  }>;
48
52
  //# sourceMappingURL=agent-address.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-address.d.ts","sourceRoot":"","sources":["../../src/tools/agent-address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,wBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8B/B;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;GAWrF"}
1
+ {"version":3,"file":"agent-address.d.ts","sourceRoot":"","sources":["../../src/tools/agent-address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,wBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+B/B;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;GAkBrF"}
@@ -22,6 +22,7 @@ export function agentAddressTool() {
22
22
  description: "Casper identity derived from the same seed. Read-only in this MCP RC; no payment signing tool is exposed.",
23
23
  },
24
24
  note: { type: "string" },
25
+ dashboard: { type: "string" },
25
26
  },
26
27
  required: ["solana", "evm"],
27
28
  },
@@ -32,7 +33,12 @@ export async function runAgentAddress(ctx, _args) {
32
33
  solana: ctx.agent.solanaAddress,
33
34
  evm: ctx.agent.evmAddress,
34
35
  casper: ctx.agent.casperAddress,
35
- note: "Read-only address discovery. Payment signing is intentionally absent from this MCP production RC until the final SDK v2 release contains independently trusted deployment pins and paid E2E evidence.",
36
+ note: "Payments: payable_fetch pays AIFP-1 on native Polygon v1.4 once the owner enables it " +
37
+ "(AIFINPAY_PAYMENTS_ENABLED=1 with USD limits, a gas cap and exact payable origins). " +
38
+ "Fund the evm address with POL on Polygon.",
39
+ dashboard: "Offer the owner a dashboard link: at https://dash.aifinpay.io → My Agents → Claim via MCP " +
40
+ "they get a one-time URL; pass it to agent_claim_self. They then see this agent's balance, " +
41
+ "payments and receipts.",
36
42
  };
37
43
  return {
38
44
  content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],
@@ -1 +1 @@
1
- {"version":3,"file":"agent-address.js","sourceRoot":"","sources":["../../src/tools/agent-address.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,2DAA2D;YAC3D,kEAAkE;YAClE,yIAAyI;QAC3I,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;SACf;QACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE;QACjF,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;gBAChE,GAAG,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,qHAAqH;iBACnI;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,2GAA2G;iBAC9G;gBACD,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;aACzB;YACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC;SAC5B;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,GAAgB,EAAE,KAA8B;IACpF,MAAM,OAAO,GAAG;QACd,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,aAAa;QAC/B,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,UAAU;QACzB,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,aAAa;QAC/B,IAAI,EAAE,uMAAuM;KAC9M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