@prismnetwork/mcp 0.8.0 → 0.8.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/README.md +38 -2
- package/package.json +1 -1
- package/server.mjs +6 -6
package/README.md
CHANGED
|
@@ -13,10 +13,14 @@ claude mcp add prism -- npx -y @prismnetwork/mcp
|
|
|
13
13
|
Then ask what you can rent. `prism_list_gpus` answers from live capacity with
|
|
14
14
|
real prices. Leasing spends money, so those tools ask for a wallet and say so.
|
|
15
15
|
|
|
16
|
+
Packaged for Claude Code and Codex as the [Prism plugin](https://plugins.prismnetwork.tech),
|
|
17
|
+
which wires this server up and prompts for the wallet at install time.
|
|
18
|
+
|
|
16
19
|
## Tools
|
|
17
20
|
|
|
18
21
|
| Tool | Wallet |
|
|
19
22
|
| --- | --- |
|
|
23
|
+
| `prism_budget` | no |
|
|
20
24
|
| `prism_list_gpus` | no |
|
|
21
25
|
| `prism_price_index` | no |
|
|
22
26
|
| `prism_receipts` | no |
|
|
@@ -34,6 +38,8 @@ real prices. Leasing spends money, so those tools ask for a wallet and say so.
|
|
|
34
38
|
| `prism_vault_delete` | yes |
|
|
35
39
|
| `prism_vault_release` | yes |
|
|
36
40
|
|
|
41
|
+
- `prism_budget`: the spending limits in force and what has already been spent
|
|
42
|
+
today, with the recent charges.
|
|
37
43
|
- `prism_wallet`: the agent's address and USDG/ETH balances.
|
|
38
44
|
- `prism_list_gpus`: GPUs available to lease, with price per second and per hour.
|
|
39
45
|
- `prism_price_index`: sourced and settled pricing per GPU model, for cost estimates.
|
|
@@ -57,6 +63,29 @@ real prices. Leasing spends money, so those tools ask for a wallet and say so.
|
|
|
57
63
|
- `prism_vault_delete`: permanently delete an item.
|
|
58
64
|
- `prism_vault_release`: authorize an item into a lease that clears its trust floor.
|
|
59
65
|
|
|
66
|
+
## Spending limits
|
|
67
|
+
|
|
68
|
+
Two ceilings bound what this server can spend, and a refusal quotes both.
|
|
69
|
+
|
|
70
|
+
| Variable | Default | What it bounds |
|
|
71
|
+
| --- | --- | --- |
|
|
72
|
+
| `PRISM_MAX_USDG` | 1 | Any single lease or generation. `max_usdg` on a call may lower it, never raise it past this. |
|
|
73
|
+
| `PRISM_DAILY_BUDGET_USDG` | 5 | Everything in a rolling 24 hours. `0` removes the ceiling. |
|
|
74
|
+
| `PRISM_LEDGER_PATH` | `~/.prism/spend.json` | Where the spend is recorded. |
|
|
75
|
+
|
|
76
|
+
Spend is written before the money moves, so a crash between funding an escrow
|
|
77
|
+
and answering is counted rather than forgiven, and a restart does not hand back
|
|
78
|
+
a fresh day's allowance. Only an attempt that provably never reached the chain
|
|
79
|
+
is reverted. Two clients pointed at one wallet share one ceiling, because they
|
|
80
|
+
share the ledger file.
|
|
81
|
+
|
|
82
|
+
None of this is the real limit. Fund a dedicated wallet with what you are
|
|
83
|
+
willing to lose: that balance is what survives a bug in everything above.
|
|
84
|
+
|
|
85
|
+
Tools that spend are annotated `destructiveHint` and carry
|
|
86
|
+
`anthropic/requiresUserInteraction`, so Claude Code asks before every one of
|
|
87
|
+
them even in modes that otherwise approve tools automatically.
|
|
88
|
+
|
|
60
89
|
## Vault
|
|
61
90
|
|
|
62
91
|
An agent that handles a card, an identity document or a credential should not
|
|
@@ -82,7 +111,8 @@ Point your MCP client (Claude Desktop / Code) at the published server:
|
|
|
82
111
|
"args": ["-y", "@prismnetwork/mcp"],
|
|
83
112
|
"env": {
|
|
84
113
|
"PRISM_AGENT_KEY": "0x<agent wallet private key>",
|
|
85
|
-
"
|
|
114
|
+
"PRISM_MAX_USDG": "1",
|
|
115
|
+
"PRISM_DAILY_BUDGET_USDG": "5"
|
|
86
116
|
}
|
|
87
117
|
}
|
|
88
118
|
}
|
|
@@ -95,11 +125,17 @@ Or add it to Claude Code in one line:
|
|
|
95
125
|
|
|
96
126
|
```sh
|
|
97
127
|
claude mcp add prism \
|
|
98
|
-
--env PRISM_ESCROW=0x62C042265991bEa17B07229322A01850974626dA \
|
|
99
128
|
--env PRISM_AGENT_KEY=0x<agent wallet private key> \
|
|
129
|
+
--env PRISM_DAILY_BUDGET_USDG=5 \
|
|
100
130
|
-- npx -y @prismnetwork/mcp
|
|
101
131
|
```
|
|
102
132
|
|
|
133
|
+
Codex takes the same server:
|
|
134
|
+
|
|
135
|
+
```sh
|
|
136
|
+
codex mcp add prism --env PRISM_AGENT_KEY=0x<agent wallet private key> -- npx -y @prismnetwork/mcp
|
|
137
|
+
```
|
|
138
|
+
|
|
103
139
|
## Timing
|
|
104
140
|
|
|
105
141
|
`prism_lease` and `prism_lease_and_run` block while a GPU provisions (usually one to four minutes, occasionally longer on a slow host). Configure your MCP client to allow long tool calls.
|
package/package.json
CHANGED
package/server.mjs
CHANGED
|
@@ -67,7 +67,7 @@ function requireWallet(tool, reason = "spends money") {
|
|
|
67
67
|
|
|
68
68
|
function requireLedger(tool) {
|
|
69
69
|
if (!ledger) {
|
|
70
|
-
throw new Error(`${tool}
|
|
70
|
+
throw new Error(`${tool} needs the spend limits, and they are unusable: ${budgetProblem}`);
|
|
71
71
|
}
|
|
72
72
|
return ledger;
|
|
73
73
|
}
|
|
@@ -104,8 +104,8 @@ function requireCommand(value) {
|
|
|
104
104
|
// The per-call ceiling is the operator's, not the model's: an omitted max_usdg
|
|
105
105
|
// takes the configured cap rather than a hardcoded one, and a stated max_usdg
|
|
106
106
|
// above it is refused when the ledger checks the commit.
|
|
107
|
-
function maxDeposit(args) {
|
|
108
|
-
if (args.max_usdg === undefined) return requireLedger(
|
|
107
|
+
function maxDeposit(tool, args) {
|
|
108
|
+
if (args.max_usdg === undefined) return requireLedger(tool).maxPerCallMicros;
|
|
109
109
|
const cap = args.max_usdg;
|
|
110
110
|
if (typeof cap !== "number" || !Number.isFinite(cap) || cap <= 0) {
|
|
111
111
|
throw new Error("max_usdg must be a positive number of USDG.");
|
|
@@ -473,7 +473,7 @@ async function handle(name, args) {
|
|
|
473
473
|
if (name === "prism_batch_run") {
|
|
474
474
|
requireCommand(args.command);
|
|
475
475
|
requireWallet(name);
|
|
476
|
-
const cap = maxDeposit(args);
|
|
476
|
+
const cap = maxDeposit(name, args);
|
|
477
477
|
return spending(name, cap, async () => {
|
|
478
478
|
const batch = await agent.lease({
|
|
479
479
|
image: IMAGE,
|
|
@@ -571,7 +571,7 @@ async function handle(name, args) {
|
|
|
571
571
|
if (name === "prism_lease_and_run" || name === "prism_lease") {
|
|
572
572
|
if (name === "prism_lease_and_run") requireCommand(args.command);
|
|
573
573
|
requireWallet(name);
|
|
574
|
-
const cap = maxDeposit(args);
|
|
574
|
+
const cap = maxDeposit(name, args);
|
|
575
575
|
sweepExpiredLeases();
|
|
576
576
|
const lease = await spending(name, cap, async () => {
|
|
577
577
|
const funded = await agent.lease({
|
|
@@ -679,7 +679,7 @@ async function handleVault(name, args) {
|
|
|
679
679
|
throw new Error(`unknown tool ${name}`);
|
|
680
680
|
}
|
|
681
681
|
|
|
682
|
-
const server = new Server({ name: "prism", version: "0.8.
|
|
682
|
+
const server = new Server({ name: "prism", version: "0.8.1" }, { capabilities: { tools: {} } });
|
|
683
683
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
684
684
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
685
685
|
try {
|