@priors/mcp 0.10.0 → 0.10.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,16 @@
1
1
  # @priors/mcp changelog
2
2
 
3
+ ## 0.10.1 (2026-10-22)
4
+
5
+ - **`pay_url` no longer times out for a wallet with no `PRIORS_AGENT_ID`.** Since 0.10.0 bundles AutoRepay's address,
6
+ `pay_url` keeps back what Autopay pulls in the next 24 h, which first looks up the wallet's agent in the registry's
7
+ logs (some 470 reads on chain 4663). 0.10.0 waited for that lookup with no bound and repeated it before every
8
+ payment, so a payment from a wallet that owns no agent, or whose agent the lookup is slow to find, ran out of its
9
+ 45 s. The lookup now gets a quarter of the call's budget (10 s at most) and keeps nothing back when it runs out, as a
10
+ failed Autopay read always did; a wallet found to own no agent is not looked up again for 10 minutes, unless another
11
+ tool (such as `credit_status`) has found its agent since, and then its plan is read at once. With
12
+ `PRIORS_AGENT_ID` set, nothing changes. `fund_base`'s reserve is the same code. Use 0.10.1 rather than 0.10.0.
13
+
3
14
  ## 0.10.0 (2026-10-22)
4
15
 
5
16
  - **Repay on time works with no setting.** The bundled deployment record names AutoRepay v2
package/README.md CHANGED
@@ -209,7 +209,7 @@ Settings → Developer → Edit Config (`claude_desktop_config.json`), then rest
209
209
  "mcpServers": {
210
210
  "priors": {
211
211
  "command": "npx",
212
- "args": ["-y", "@priors/mcp@0.10.0"],
212
+ "args": ["-y", "@priors/mcp@0.10.1"],
213
213
  "env": {
214
214
  "PRIORS_KEY": "0xYOUR_AGENT_WALLET_KEY",
215
215
  "PRIORS_AGENT_ID": "1234"
@@ -231,7 +231,7 @@ A project `.mcp.json` that reads the key from your shell's environment, so the f
231
231
  "mcpServers": {
232
232
  "priors": {
233
233
  "command": "npx",
234
- "args": ["-y", "@priors/mcp@0.10.0"],
234
+ "args": ["-y", "@priors/mcp@0.10.1"],
235
235
  "env": {
236
236
  "PRIORS_KEY": "${PRIORS_KEY}",
237
237
  "PRIORS_AGENT_ID": "${PRIORS_AGENT_ID:-}"
@@ -244,7 +244,7 @@ A project `.mcp.json` that reads the key from your shell's environment, so the f
244
244
  or, for your user only, from a macOS or Linux terminal:
245
245
 
246
246
  ```sh
247
- (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.10.0' priors-mcp ~/.config/priors/agent.key
247
+ (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.10.1' priors-mcp ~/.config/priors/agent.key
248
248
  ```
249
249
 
250
250
  It waits for the key without showing it (paste it, then Enter), saves it in a file only you can read, and gives Claude
@@ -300,7 +300,7 @@ to approve a borrow; this package, with the key, pays for APIs. With borrowing o
300
300
  approves each loan in Priors' Go mode. ElizaOS (`@elizaos/plugin-mcp`):
301
301
 
302
302
  ```ts
303
- "priors-wallet": { type: "stdio", command: "npx", args: ["-y", "@priors/mcp@0.10.0"],
303
+ "priors-wallet": { type: "stdio", command: "npx", args: ["-y", "@priors/mcp@0.10.1"],
304
304
  env: { PRIORS_KEY_FILE: "/home/agent/.config/priors/agent-7311.key", PRIORS_AGENT_ID: "7311",
305
305
  PRIORS_MAX_BORROW_USD: "0", PRIORS_MAX_BORROW_DAY_USD: "0", PRIORS_MAX_SPEND_DAY_USD: "1", PRIORS_MAX_PRICE_USD: "0.10",
306
306
  PRIORS_PAY_HOSTS: "api.example.com" } }
@@ -312,7 +312,7 @@ OpenClaw (`mcp.servers`, JSON5) takes the same `command`, `args` and `env`; Herm
312
312
  mcp_servers:
313
313
  priors-wallet:
314
314
  command: npx
315
- args: ["-y", "@priors/mcp@0.10.0"]
315
+ args: ["-y", "@priors/mcp@0.10.1"]
316
316
  env:
317
317
  PRIORS_KEY_FILE: /home/agent/.config/priors/agent-7311.key
318
318
  PRIORS_AGENT_ID: "7311"
@@ -339,7 +339,7 @@ key proves it is there: it signs the ERC-8004 identity registry's `AgentWalletSe
339
339
  agent's).
340
340
 
341
341
  ```sh
342
- PRIORS_KEY_FILE=~/.config/priors/agent-7311.key npx -y @priors/mcp@0.10.0 link-wallet --agent 7311
342
+ PRIORS_KEY_FILE=~/.config/priors/agent-7311.key npx -y @priors/mcp@0.10.1 link-wallet --agent 7311
343
343
  ```
344
344
 
345
345
  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.10.0",
4
+ "version": "0.10.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",
package/src/server.mjs CHANGED
@@ -854,7 +854,7 @@ export async function createPriorsMcpServer({ env = process.env, fetchImpl = glo
854
854
  const mine = await credit.agentsOf(wallet.address);
855
855
  if (mine.length === 1) return (agentCache = mine[0]);
856
856
  if (mine.length > 1) throw new ToolError(`This wallet owns several agent identities (${mine.map((i) => "#" + i).join(", ")}). Set PRIORS_AGENT_ID or pass agent_id.`);
857
- throw new ToolError("This wallet owns no Priors agent identity minted to it since the v2 deploy and held ever since. Set PRIORS_AGENT_ID if it owns an older one, or one that left it and came back, or register first (`npx priors-v2 join`, from a clone of github.com/priors-agents/priors).");
857
+ throw Object.assign(new ToolError("This wallet owns no Priors agent identity minted to it since the v2 deploy and held ever since. Set PRIORS_AGENT_ID if it owns an older one, or one that left it and came back, or register first (`npx priors-v2 join`, from a clone of github.com/priors-agents/priors)."), { noAgent: true });
858
858
  }
859
859
 
860
860
  function needWallet(action) {
@@ -899,13 +899,23 @@ export async function createPriorsMcpServer({ env = process.env, fetchImpl = glo
899
899
  return autopay;
900
900
  }
901
901
  /** What pay_url keeps back: what the wallet's Autopay plan pulls for loans whose window opens in the next 24 h. A
902
- * failed read keeps nothing back (the payment goes on as before) and is never an error. */
902
+ * failed read keeps nothing back (the payment goes on as before) and is never an error. Without PRIORS_AGENT_ID the
903
+ * wallet's agent is looked up first, in the registry's logs: that lookup gets a quarter of the call's budget (10 s at
904
+ * most), and a wallet it finds owning no agent, so with no plan to keep anything for, is not looked up again for 10
905
+ * minutes, unless another tool has found its agent since (0.10.0 waited for the lookup with no bound before every
906
+ * payment, so a payment from such a wallet ran out of time). */
907
+ const RESERVE_LOOKUP_MS = Math.min(10_000, Math.floor(callBudgetMs / 4));
908
+ let noAgentUntil = 0;
903
909
  async function autopayReserve() {
904
910
  if (!reserveOn || !autopay || !wallet) return 0n;
911
+ if (agentCache === null && Date.now() < noAgentUntil) return 0n;
905
912
  try {
906
- const id = await resolveAgent();
913
+ const id = await withinTime(resolveAgent(), RESERVE_LOOKUP_MS);
907
914
  return A.autopayReserve(await withinTime(autopay.status(wallet.address, id), 10_000));
908
- } catch (_) { return 0n; }
915
+ } catch (e) {
916
+ if (e?.noAgent) noAgentUntil = Date.now() + 600_000;
917
+ return 0n;
918
+ }
909
919
  }
910
920
  /** Autopay lines for credit_status: the wallet's plan, its budget, the next loan it pays, a shortfall. */
911
921
  async function autopayLines(id) {