@priors/mcp 0.12.1 → 0.12.2

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
@@ -1,5 +1,16 @@
1
1
  # @priors/mcp changelog
2
2
 
3
+ ## 0.12.2 (2026-10-27)
4
+
5
+ Still on @priors/x402 0.8.3.
6
+
7
+ - **A dollar amount rounds up to the next USDG unit only by the float rounding of its own value** (GHSA-6rfc-64cr-p7v5,
8
+ reported by Leonardiae). Since 0.2.6 a `max_price_usd`, `max_borrow_usd` or other dollar amount that would round up
9
+ is refused as having more than 6 decimals, but the check let it round up by as much as 1e-12 USD, kept for float
10
+ noise: a `max_price_usd` of 0.0999999999995 or 0.09999999999999 signed a 0.10 USDG payment, an excess of at most a
11
+ millionth of one USDG unit. An amount now rounds up only by a few units in the last place of its own value, and never
12
+ by more than 1e-12: a computed 0.7 + 0.1 (0.7999999999999999) still reads as 0.80, and both values above are refused.
13
+
3
14
  ## 0.12.1 (2026-10-27)
4
15
 
5
16
  On @priors/x402 0.8.3 (GHSA-xccq-5ghg-w7mq and GHSA-qcrq-x8xg-25vg, reported by hey-research-lab):
package/README.md CHANGED
@@ -213,7 +213,7 @@ Settings → Developer → Edit Config (`claude_desktop_config.json`), then rest
213
213
  "mcpServers": {
214
214
  "priors": {
215
215
  "command": "npx",
216
- "args": ["-y", "@priors/mcp@0.12.1"],
216
+ "args": ["-y", "@priors/mcp@0.12.2"],
217
217
  "env": {
218
218
  "PRIORS_KEY": "0xYOUR_AGENT_WALLET_KEY",
219
219
  "PRIORS_AGENT_ID": "1234"
@@ -235,7 +235,7 @@ A project `.mcp.json` that reads the key from your shell's environment, so the f
235
235
  "mcpServers": {
236
236
  "priors": {
237
237
  "command": "npx",
238
- "args": ["-y", "@priors/mcp@0.12.1"],
238
+ "args": ["-y", "@priors/mcp@0.12.2"],
239
239
  "env": {
240
240
  "PRIORS_KEY": "${PRIORS_KEY}",
241
241
  "PRIORS_AGENT_ID": "${PRIORS_AGENT_ID:-}"
@@ -248,7 +248,7 @@ A project `.mcp.json` that reads the key from your shell's environment, so the f
248
248
  or, for your user only, from a macOS or Linux terminal:
249
249
 
250
250
  ```sh
251
- (read -rs PRIORS_KEY && umask 077 && mkdir -p ~/.config/priors && rm -f ~/.config/priors/agent.key && printf '%s\n' "$PRIORS_KEY" > ~/.config/priors/agent.key) && claude mcp add priors --scope user -- sh -c 'read -r PRIORS_KEY < "$1" && export PRIORS_KEY && exec npx -y @priors/mcp@0.12.1' priors-mcp ~/.config/priors/agent.key
251
+ (read -rs PRIORS_KEY && umask 077 && mkdir -p ~/.config/priors && rm -f ~/.config/priors/agent.key && printf '%s\n' "$PRIORS_KEY" > ~/.config/priors/agent.key) && claude mcp add priors --scope user -- sh -c 'read -r PRIORS_KEY < "$1" && export PRIORS_KEY && exec npx -y @priors/mcp@0.12.2' priors-mcp ~/.config/priors/agent.key
252
252
  ```
253
253
 
254
254
  It waits for the key without showing it (paste it, then Enter), saves it in a file only you can read, and gives Claude
@@ -304,7 +304,7 @@ to approve a borrow; this package, with the key, pays for APIs. With borrowing o
304
304
  approves each loan in Priors' Go mode. ElizaOS (`@elizaos/plugin-mcp`):
305
305
 
306
306
  ```ts
307
- "priors-wallet": { type: "stdio", command: "npx", args: ["-y", "@priors/mcp@0.12.1"],
307
+ "priors-wallet": { type: "stdio", command: "npx", args: ["-y", "@priors/mcp@0.12.2"],
308
308
  env: { PRIORS_KEY_FILE: "/home/agent/.config/priors/agent-7311.key", PRIORS_AGENT_ID: "7311",
309
309
  PRIORS_MAX_BORROW_USD: "0", PRIORS_MAX_BORROW_DAY_USD: "0", PRIORS_MAX_SPEND_DAY_USD: "1", PRIORS_MAX_PRICE_USD: "0.10",
310
310
  PRIORS_PAY_HOSTS: "api.example.com" } }
@@ -316,7 +316,7 @@ OpenClaw (`mcp.servers`, JSON5) takes the same `command`, `args` and `env`; Herm
316
316
  mcp_servers:
317
317
  priors-wallet:
318
318
  command: npx
319
- args: ["-y", "@priors/mcp@0.12.1"]
319
+ args: ["-y", "@priors/mcp@0.12.2"]
320
320
  env:
321
321
  PRIORS_KEY_FILE: /home/agent/.config/priors/agent-7311.key
322
322
  PRIORS_AGENT_ID: "7311"
@@ -343,7 +343,7 @@ key proves it is there: it signs the ERC-8004 identity registry's `AgentWalletSe
343
343
  agent's).
344
344
 
345
345
  ```sh
346
- PRIORS_KEY_FILE=~/.config/priors/agent-7311.key npx -y @priors/mcp@0.12.1 link-wallet --agent 7311
346
+ PRIORS_KEY_FILE=~/.config/priors/agent-7311.key npx -y @priors/mcp@0.12.2 link-wallet --agent 7311
347
347
  ```
348
348
 
349
349
  It reads the registry's EIP-712 domain and refuses to sign for any other, takes the owner from the chain (`--owner`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@priors/mcp",
3
3
  "mcpName": "io.github.priors-agents/priors",
4
- "version": "0.12.1",
4
+ "version": "0.12.2",
5
5
  "private": false,
6
6
  "description": "MCP server for Priors on Robinhood Chain: pay x402 URLs in USDG, read balances, credit lines and scores, borrow and repay, and buy, sell and redeem PT-USDG. Key from PRIORS_KEY_FILE (a file only you can read) or PRIORS_KEY, never the command line.",
7
7
  "type": "module",
package/src/server.mjs CHANGED
@@ -269,8 +269,11 @@ const clean = (s, n) => short(String(s ?? "").replace(/[\u0000-\u0008\u000b\u000
269
269
  function dollars(v, what) {
270
270
  if (typeof v !== "number" || !Number.isFinite(v) || v < 0) throw new ToolError(`${what} must be a non-negative number of US dollars`);
271
271
  const s = v.toFixed(6);
272
- // never rounded up: 0.0999999995 is not a cap of 0.10 (own audit 2026-10-01)
273
- if (Math.abs(Number(s) - v) > 1e-9 || Number(s) - v > 1e-12) throw new ToolError(`${what} has more than 6 decimals`);
272
+ // never rounded up: 0.0999999995 is not a cap of 0.10 (own audit 2026-10-01), nor is 0.0999999999995
273
+ // (GHSA-6rfc-64cr-p7v5). Up only by the float rounding of v itself, a few units in its last place (a computed
274
+ // 0.7 + 0.1 = 0.7999999999999999 is 0.80), and never by more than 1e-12, which that rounding passes above $1,125.90.
275
+ const up = Number(s) - v;
276
+ if (Math.abs(up) > 1e-9 || up > Math.min(4 * v * Number.EPSILON, 1e-12)) throw new ToolError(`${what} has more than 6 decimals`);
274
277
  return X.toAtomicUsdg(`$${s}`, what);
275
278
  }
276
279
  function envDollars(env, name, dflt) {