@priors/mcp 0.11.0 → 0.11.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @priors/mcp changelog
2
2
 
3
+ ## 0.11.1 (2026-10-25)
4
+
5
+ - **The daily limits count a call that ends while another server checks them.** With `PRIORS_MAX_SPEND_DAY_USD` or
6
+ `PRIORS_MAX_BORROW_DAY_USD` set and several servers sharing one `PRIORS_STATE_DIR`, a check read the day's entries,
7
+ then the markers of the calls in flight, in two listings. A call begun before 00:00 UTC that ended between them (its
8
+ entry moved into the new day, then its marker removed) was in neither, and another server's call could pass the
9
+ day's limit (50 USDG against 25). The markers are now listed first, so such a call is counted at least once, and at
10
+ worst twice for that one check: a refusal near the limit, which passes on a retry. `credit_status`'s "Today (UTC)"
11
+ reads through the same check. A single server was not affected: its money calls run one at a time. 0.8.5 to 0.11.0.
12
+ - **undici 6.29.1** (from 6.29.0): its fixes for an unhandled error on a response with too many content encodings,
13
+ and for unbounded memory in its EventSource parser.
14
+
3
15
  ## 0.11.0 (2026-10-24)
4
16
 
5
17
  - **`find_services` lists only the merchants Go mode's Tools lists.** The ones Priors approved, and the ones under review
package/README.md CHANGED
@@ -211,7 +211,7 @@ Settings → Developer → Edit Config (`claude_desktop_config.json`), then rest
211
211
  "mcpServers": {
212
212
  "priors": {
213
213
  "command": "npx",
214
- "args": ["-y", "@priors/mcp@0.11.0"],
214
+ "args": ["-y", "@priors/mcp@0.11.1"],
215
215
  "env": {
216
216
  "PRIORS_KEY": "0xYOUR_AGENT_WALLET_KEY",
217
217
  "PRIORS_AGENT_ID": "1234"
@@ -233,7 +233,7 @@ A project `.mcp.json` that reads the key from your shell's environment, so the f
233
233
  "mcpServers": {
234
234
  "priors": {
235
235
  "command": "npx",
236
- "args": ["-y", "@priors/mcp@0.11.0"],
236
+ "args": ["-y", "@priors/mcp@0.11.1"],
237
237
  "env": {
238
238
  "PRIORS_KEY": "${PRIORS_KEY}",
239
239
  "PRIORS_AGENT_ID": "${PRIORS_AGENT_ID:-}"
@@ -246,7 +246,7 @@ A project `.mcp.json` that reads the key from your shell's environment, so the f
246
246
  or, for your user only, from a macOS or Linux terminal:
247
247
 
248
248
  ```sh
249
- (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.11.0' priors-mcp ~/.config/priors/agent.key
249
+ (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.11.1' priors-mcp ~/.config/priors/agent.key
250
250
  ```
251
251
 
252
252
  It waits for the key without showing it (paste it, then Enter), saves it in a file only you can read, and gives Claude
@@ -302,7 +302,7 @@ to approve a borrow; this package, with the key, pays for APIs. With borrowing o
302
302
  approves each loan in Priors' Go mode. ElizaOS (`@elizaos/plugin-mcp`):
303
303
 
304
304
  ```ts
305
- "priors-wallet": { type: "stdio", command: "npx", args: ["-y", "@priors/mcp@0.11.0"],
305
+ "priors-wallet": { type: "stdio", command: "npx", args: ["-y", "@priors/mcp@0.11.1"],
306
306
  env: { PRIORS_KEY_FILE: "/home/agent/.config/priors/agent-7311.key", PRIORS_AGENT_ID: "7311",
307
307
  PRIORS_MAX_BORROW_USD: "0", PRIORS_MAX_BORROW_DAY_USD: "0", PRIORS_MAX_SPEND_DAY_USD: "1", PRIORS_MAX_PRICE_USD: "0.10",
308
308
  PRIORS_PAY_HOSTS: "api.example.com" } }
@@ -314,7 +314,7 @@ OpenClaw (`mcp.servers`, JSON5) takes the same `command`, `args` and `env`; Herm
314
314
  mcp_servers:
315
315
  priors-wallet:
316
316
  command: npx
317
- args: ["-y", "@priors/mcp@0.11.0"]
317
+ args: ["-y", "@priors/mcp@0.11.1"]
318
318
  env:
319
319
  PRIORS_KEY_FILE: /home/agent/.config/priors/agent-7311.key
320
320
  PRIORS_AGENT_ID: "7311"
@@ -341,7 +341,7 @@ key proves it is there: it signs the ERC-8004 identity registry's `AgentWalletSe
341
341
  agent's).
342
342
 
343
343
  ```sh
344
- PRIORS_KEY_FILE=~/.config/priors/agent-7311.key npx -y @priors/mcp@0.11.0 link-wallet --agent 7311
344
+ PRIORS_KEY_FILE=~/.config/priors/agent-7311.key npx -y @priors/mcp@0.11.1 link-wallet --agent 7311
345
345
  ```
346
346
 
347
347
  It reads the registry's EIP-712 domain and refuses to sign for any other, takes the owner from the chain (`--owner`
@@ -352,7 +352,7 @@ model can call.
352
352
  ## Try it
353
353
 
354
354
  "What's the Priors score of agent 6228?" · "How much USDG does my wallet hold?" · "Find services that sell token
355
- prices" · "Pay https://api.example.com/report, up to 5 cents" · "Borrow $5 for 7 days, show me the fee first".
355
+ prices" · "Pay https://api.example.com/report, up to 5 cents" · "Borrow $5 for 14 days, show me the fee first".
356
356
 
357
357
  ## Tests
358
358
 
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.11.0",
4
+ "version": "0.11.1",
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",
@@ -47,7 +47,7 @@
47
47
  "@modelcontextprotocol/sdk": "^1.30.1",
48
48
  "@priors/x402": "0.8.1",
49
49
  "ethers": "^6.13.4",
50
- "undici": "6.29.0",
50
+ "undici": "6.29.1",
51
51
  "viem": "^2.56.9",
52
52
  "zod": "^4.6.5"
53
53
  }
package/src/daily.mjs CHANGED
@@ -25,9 +25,11 @@
25
25
  // it ends, its entry becomes what it did, filed in the day it ended (never in a day before the one it started: a
26
26
  // clock set back moves nothing back), and only then does its marker go. So a borrow sent before 00:00 UTC that lands
27
27
  // after counts in the new day, and while it is still in flight a call another process makes after midnight already
28
- // sees it. A process that dies mid-call leaves its entry at its most in the day it started and its marker counted
29
- // PENDING_DAYS days more, the safe direction. Days before yesterday, and markers older than that count, are deleted as
30
- // new days begin. A file whose name is not a ledger entry is left alone and not counted.
28
+ // sees it. A reader lists the markers before the day's entries, so a call that ends while another process lists the
29
+ // ledger is counted at least once (0.11.1). A process that dies mid-call leaves its entry at its most in the day it
30
+ // started and its marker counted PENDING_DAYS days more, the safe direction. Days before yesterday, and markers older
31
+ // than that count, are deleted as new days begin. A file whose name is not a ledger entry is left alone and not
32
+ // counted.
31
33
  // SHORTCUT: a call still in flight more than PENDING_DAYS days after the day it started stops counting in later days.
32
34
  // Ceiling: none on this chain, whose sequencer includes or refuses a transaction within seconds and whose forced
33
35
  // inclusion is bounded to 24 h. Upgrade trigger: a money call that can stay in flight longer.
@@ -112,9 +114,12 @@ export function dailyLedger({ stateDir, owners, owner, caps, now = () => Date.no
112
114
  /** Takes a call's files back (a refusal, or a ledger that could not be written): best effort, since one left behind
113
115
  * only counts too much, the safe direction. */
114
116
  const drop = (files) => { for (const f of files) { try { fs.unlinkSync(join(f.dir, f.name)); } catch (_) { /* counted */ } } };
115
- /** What an owner's ledger holds on `day`: that day's entries, and the calls started before it still in flight. */
117
+ /** What an owner's ledger holds on `day`: that day's entries, and the calls started before it still in flight.
118
+ * The markers are listed BEFORE the day's entries (0.11.1): settle() files a call's entry in its new day first and
119
+ * only then removes its marker, so a settle that runs between the two listings is seen in one of them, or in both
120
+ * (counted twice for this check, the safe direction), never in neither. */
116
121
  const totalOn = (o, day) => {
117
- const a = sum(join(rootOf(o), day), fs), p = inFlight(join(rootOf(o), PENDING), day, fs);
122
+ const p = inFlight(join(rootOf(o), PENDING), day, fs), a = sum(join(rootOf(o), day), fs);
118
123
  return { signed: a.signed + p.signed, borrowed: a.borrowed + p.borrowed };
119
124
  };
120
125
  return {