brainchain-mcp 0.4.1 → 0.4.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/README.md +12 -12
- package/dist/payments.js +5 -1
- package/dist/tools.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Read the key without echoing it or leaving it in your shell history, then add th
|
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
printf 'Key: ' && read -rs BRAINCHAIN_PAYER_KEY && echo
|
|
19
|
-
claude mcp add brainchain --scope user -e BRAINCHAIN_PAYER_KEY="$BRAINCHAIN_PAYER_KEY" -- npx -y brainchain-mcp@0.4.
|
|
19
|
+
claude mcp add brainchain --scope user -e BRAINCHAIN_PAYER_KEY="$BRAINCHAIN_PAYER_KEY" -- npx -y brainchain-mcp@0.4.2
|
|
20
20
|
unset BRAINCHAIN_PAYER_KEY
|
|
21
21
|
```
|
|
22
22
|
|
|
@@ -27,7 +27,7 @@ unset BRAINCHAIN_PAYER_KEY
|
|
|
27
27
|
"mcpServers": {
|
|
28
28
|
"brainchain": {
|
|
29
29
|
"command": "npx",
|
|
30
|
-
"args": ["-y", "brainchain-mcp@0.4.
|
|
30
|
+
"args": ["-y", "brainchain-mcp@0.4.2"],
|
|
31
31
|
"env": { "BRAINCHAIN_PAYER_KEY": "${BRAINCHAIN_PAYER_KEY}" }
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -36,7 +36,7 @@ unset BRAINCHAIN_PAYER_KEY
|
|
|
36
36
|
|
|
37
37
|
### Cursor
|
|
38
38
|
|
|
39
|
-
[](https://cursor.com/en/install-mcp?name=brainchain&config=
|
|
39
|
+
[](https://cursor.com/en/install-mcp?name=brainchain&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImJyYWluY2hhaW4tbWNwQDAuNC4yIl0sImVudiI6eyJCUkFJTkNIQUlOX1BBWUVSX0tFWSI6IiR7ZW52OkJSQUlOQ0hBSU5fUEFZRVJfS0VZfSJ9fQ%3D%3D)
|
|
40
40
|
|
|
41
41
|
Or add the server to a project's `.cursor/mcp.json` (`~/.cursor/mcp.json` for every project):
|
|
42
42
|
|
|
@@ -45,7 +45,7 @@ Or add the server to a project's `.cursor/mcp.json` (`~/.cursor/mcp.json` for ev
|
|
|
45
45
|
"mcpServers": {
|
|
46
46
|
"brainchain": {
|
|
47
47
|
"command": "npx",
|
|
48
|
-
"args": ["-y", "brainchain-mcp@0.4.
|
|
48
|
+
"args": ["-y", "brainchain-mcp@0.4.2"],
|
|
49
49
|
"env": { "BRAINCHAIN_PAYER_KEY": "${env:BRAINCHAIN_PAYER_KEY}" }
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -63,7 +63,7 @@ Add the server to the client's `mcpServers` configuration. For Claude Desktop th
|
|
|
63
63
|
"mcpServers": {
|
|
64
64
|
"brainchain": {
|
|
65
65
|
"command": "npx",
|
|
66
|
-
"args": ["-y", "brainchain-mcp@0.4.
|
|
66
|
+
"args": ["-y", "brainchain-mcp@0.4.2"],
|
|
67
67
|
"env": { "BRAINCHAIN_PAYER_KEY": "0xYOUR_KEY" }
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -82,7 +82,7 @@ These clients keep the key in that file as plain text.
|
|
|
82
82
|
"brainchain": {
|
|
83
83
|
"type": "stdio",
|
|
84
84
|
"command": "npx",
|
|
85
|
-
"args": ["-y", "brainchain-mcp@0.4.
|
|
85
|
+
"args": ["-y", "brainchain-mcp@0.4.2"],
|
|
86
86
|
"env": { "BRAINCHAIN_PAYER_KEY": "${input:brainchain-key}" }
|
|
87
87
|
}
|
|
88
88
|
},
|
|
@@ -95,7 +95,7 @@ These clients keep the key in that file as plain text.
|
|
|
95
95
|
### OpenClaw
|
|
96
96
|
|
|
97
97
|
```sh
|
|
98
|
-
openclaw mcp set brainchain '{"command":"npx","args":["-y","brainchain-mcp@0.4.
|
|
98
|
+
openclaw mcp set brainchain '{"command":"npx","args":["-y","brainchain-mcp@0.4.2"],"env":{"BRAINCHAIN_PAYER_KEY":"${BRAINCHAIN_PAYER_KEY}"}}'
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
OpenClaw resolves `${BRAINCHAIN_PAYER_KEY}` from its environment when it starts the server, so the config holds no secret. [`examples/openclaw/brainchain`](examples/openclaw/brainchain) is an OpenClaw skill that tells the agent when to hand work to BrainChain, how to write the brief and levels, and checks the wallet before it pays.
|
|
@@ -112,7 +112,7 @@ Each brief is posted on BrainChain and each result is served at a public link. K
|
|
|
112
112
|
|
|
113
113
|
```bash
|
|
114
114
|
printf 'Key: ' && read -rs BRAINCHAIN_PAYER_KEY && echo && export BRAINCHAIN_PAYER_KEY
|
|
115
|
-
npx -y brainchain-mcp@0.4.
|
|
115
|
+
npx -y brainchain-mcp@0.4.2 approve
|
|
116
116
|
unset BRAINCHAIN_PAYER_KEY
|
|
117
117
|
```
|
|
118
118
|
|
|
@@ -126,7 +126,7 @@ Use a dedicated wallet that holds only what you plan to spend. The key stays on
|
|
|
126
126
|
|
|
127
127
|
| Tool | What it does |
|
|
128
128
|
| --- | --- |
|
|
129
|
-
| `brainchain_post_task` | Pays for a task and returns an order id, the price paid and a `statusUrl`. Takes a `title` of up to 120 characters, a `brief` of up to 32,000 characters and two or three quality `levels` of up to 200 characters each, best first.
|
|
129
|
+
| `brainchain_post_task` | Pays for a task and returns an order id, the price paid and a `statusUrl`. Takes a `title` of up to 120 characters, a `brief` of up to 32,000 characters and two or three quality `levels` of up to 200 characters each, best first. With three levels the work is paid at the second level or better; with two, only at the first. Models cannot browse, so put every fact they need in the brief. |
|
|
130
130
|
| `brainchain_get_task` | Takes the `order` id and returns the payment, the task's status on BrainChain, whether Jev accepted the work, the result text once it did, and the refund transaction if it did not. `done` says when to stop asking and `retryAfterSeconds` when to ask again. |
|
|
131
131
|
|
|
132
132
|
Results usually arrive within minutes. A post reply with `possiblyCharged` means the payment was signed but the desk never confirmed the order, because the connection dropped or the desk returned an unexpected status. The payment may have gone through, so read the order with `brainchain_get_task` rather than posting again. While the server keeps running, an identical post within 15 minutes returns the first order, marked `duplicate`, instead of paying twice.
|
|
@@ -153,7 +153,7 @@ Every hire and grade is recorded on BrainChain and listed at [usebrainchain.com/
|
|
|
153
153
|
| `BRAINCHAIN_STATE_DIR` | `~/.brainchain` | Where the daily total is kept, one file per network and wallet. |
|
|
154
154
|
| `BRAINCHAIN_DESK_URL`, `BRAINCHAIN_PAY_TO`, `BRAINCHAIN_PAYMENT_NETWORK`, `BRAINCHAIN_PAYMENT_ASSET`, `BRAINCHAIN_PAYMENT_RPC` | network preset | Override a single setting. A custom desk needs its own `BRAINCHAIN_PAY_TO`. |
|
|
155
155
|
|
|
156
|
-
If a setting is invalid, the server says so once on stderr when it starts, and both tools return the error. `npx -y brainchain-mcp@0.4.
|
|
156
|
+
If a setting is invalid, the server says so once on stderr when it starts, and both tools return the error. `npx -y brainchain-mcp@0.4.2 --help` lists the commands and variables, and `--version` prints the version.
|
|
157
157
|
|
|
158
158
|
## Try it on testnet
|
|
159
159
|
|
|
@@ -161,7 +161,7 @@ Set `BRAINCHAIN_NETWORK=testnet` in the server's environment. Test tokens have n
|
|
|
161
161
|
|
|
162
162
|
```bash
|
|
163
163
|
printf 'Key: ' && read -rs BRAINCHAIN_PAYER_KEY && echo
|
|
164
|
-
claude mcp add brainchain --scope user -e BRAINCHAIN_NETWORK=testnet -e BRAINCHAIN_PAYER_KEY="$BRAINCHAIN_PAYER_KEY" -- npx -y brainchain-mcp@0.4.
|
|
164
|
+
claude mcp add brainchain --scope user -e BRAINCHAIN_NETWORK=testnet -e BRAINCHAIN_PAYER_KEY="$BRAINCHAIN_PAYER_KEY" -- npx -y brainchain-mcp@0.4.2
|
|
165
165
|
unset BRAINCHAIN_PAYER_KEY
|
|
166
166
|
```
|
|
167
167
|
|
|
@@ -176,7 +176,7 @@ unset BRAINCHAIN_PAYER_KEY
|
|
|
176
176
|
cast send 0x1eC185467cA2D5d1c24f0EdCB91301Bca4d0a787 "faucet()" --rpc-url https://rpc.testnet.chain.robinhood.com --interactive
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
-
3. Approve Permit2 with `BRAINCHAIN_NETWORK=testnet npx -y brainchain-mcp@0.4.
|
|
179
|
+
3. Approve Permit2 with `BRAINCHAIN_NETWORK=testnet npx -y brainchain-mcp@0.4.2 approve`.
|
|
180
180
|
|
|
181
181
|
## Links
|
|
182
182
|
|
package/dist/payments.js
CHANGED
|
@@ -345,6 +345,10 @@ export function guidance(view, config) {
|
|
|
345
345
|
return { done: true, next: `Jev did not accept the work, so the result is withheld. The full amount is refunded on ${config.chain} when the dispute window closes, ${config.terms.finalAfter} after grading.` };
|
|
346
346
|
}
|
|
347
347
|
switch (task.status) {
|
|
348
|
+
case "paid":
|
|
349
|
+
return { done: true, next: `Jev accepted the work and the model was paid.${typeof view.result === "string" ? ` The result is at ${view.result}.` : ""}` };
|
|
350
|
+
case "refunded":
|
|
351
|
+
return { done: true, next: `${why} The full amount was refunded on ${config.chain}.` };
|
|
348
352
|
case "open":
|
|
349
353
|
return wait(60, `Waiting for Jev to hire a model.${unless("the work is not delivered")}`);
|
|
350
354
|
case "hired":
|
|
@@ -353,7 +357,7 @@ export function guidance(view, config) {
|
|
|
353
357
|
case "submitted":
|
|
354
358
|
return wait(30, `The model delivered; Jev is grading the work.${unless("Jev has not graded it")}`);
|
|
355
359
|
case "graded":
|
|
356
|
-
return wait(60, "Jev accepted the work; the result is being prepared.");
|
|
360
|
+
return wait(60, task.accepted === true ? "Jev accepted the work; the result is being prepared." : "Jev graded the work; the verdict is being recorded.");
|
|
357
361
|
}
|
|
358
362
|
return wait(60, "The order is in progress.");
|
|
359
363
|
}
|
package/dist/tools.js
CHANGED
|
@@ -3,7 +3,7 @@ export const POST_TASK_NAME = "brainchain_post_task";
|
|
|
3
3
|
export const GET_TASK_NAME = "brainchain_get_task";
|
|
4
4
|
/** Given a configuration error instead of terms, the description leads with it. */
|
|
5
5
|
export function postTaskTool(terms) {
|
|
6
|
-
const about = `Pay for a task on BrainChain. Jev, a decision model from TypeSafe, hires a frontier model for the brief, grades the result against your quality levels and pays the model only if the work reaches the second
|
|
6
|
+
const about = `Pay for a task on BrainChain. Jev, a decision model from TypeSafe, hires a frontier model for the brief, grades the result against your quality levels and pays the model only if the work reaches your pass level: with three quality levels, the second or better; with two, only the first. ` +
|
|
7
7
|
`Briefs and results are public, so never include credentials or code that cannot be published. `;
|
|
8
8
|
return {
|
|
9
9
|
name: POST_TASK_NAME,
|
|
@@ -29,7 +29,7 @@ export function postTaskTool(terms) {
|
|
|
29
29
|
items: { type: "string", minLength: 1, maxLength: 200 },
|
|
30
30
|
minItems: 2,
|
|
31
31
|
maxItems: 3,
|
|
32
|
-
description: "Two or three quality levels, best first, each a short description a reader could check.
|
|
32
|
+
description: "Two or three quality levels, best first, each a short description a reader could check. With three, the work is paid if it reaches the second level or better; with two, only the first.",
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
required: ["title", "brief", "levels"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brainchain-mcp",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "MCP server for BrainChain: let your agent hire a frontier model for a task and pay in USDG on Robinhood Chain or USDC on Base, only for work that meets the quality bar you set.",
|
|
5
5
|
"mcpName": "com.usebrainchain/brainchain",
|
|
6
6
|
"license": "MIT",
|