@gvnrdao/dh-mcp 0.5.0 → 0.5.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 +3 -3
- package/dist/boundary.js +20 -2
- package/dist/index.js +21 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,13 +11,13 @@ so there is **nothing to install first** (no Node, no npm):
|
|
|
11
11
|
|
|
12
12
|
| You are on | Install path |
|
|
13
13
|
|---|---|
|
|
14
|
-
| **Claude Desktop (macOS / Windows)** | Download the bundle and open it (double-click / drag into Settings → Extensions): `https://assets.gvnr.xyz/dh-mcp/v0.5.
|
|
15
|
-
| **Linux — including Claude Desktop builds on Linux — or any other MCP host** | One line, no sudo: `curl -fsSL https://assets.gvnr.xyz/dh-mcp/install.sh \| sh` — installs a self-contained binary (its own Node runtime inside) to `~/.dh-mcp/bin/dh-mcp`, verifies its SHA-256, and prints the exact `mcpServers` snippet. **Then wire the host:** Claude Code: `claude mcp add diamond-hands -- $HOME/.dh-mcp/bin/dh-mcp` (new session); Claude Desktop (Linux builds): the snippet in `~/.config/Claude/claude_desktop_config.json`, full quit + relaunch; other hosts: the snippet in their MCP config. Pin a version: `curl -fsSL https://assets.gvnr.xyz/dh-mcp/install.sh \| DH_VERSION=0.5.
|
|
14
|
+
| **Claude Desktop (macOS / Windows)** | Download the bundle and open it (double-click / drag into Settings → Extensions): `https://assets.gvnr.xyz/dh-mcp/v0.5.1/dh-mcp-0.5.1.mcpb` — Claude Desktop runs it on its own embedded runtime; network and optional keystore are configured in the extension's settings UI (the password is held by the OS credential store, never written to a config file). |
|
|
15
|
+
| **Linux — including Claude Desktop builds on Linux — or any other MCP host** | One line, no sudo: `curl -fsSL https://assets.gvnr.xyz/dh-mcp/install.sh \| sh` — installs a self-contained binary (its own Node runtime inside) to `~/.dh-mcp/bin/dh-mcp`, verifies its SHA-256, and prints the exact `mcpServers` snippet. **Then wire the host:** Claude Code: `claude mcp add diamond-hands -- $HOME/.dh-mcp/bin/dh-mcp` (new session); Claude Desktop (Linux builds): the snippet in `~/.config/Claude/claude_desktop_config.json`, full quit + relaunch; other hosts: the snippet in their MCP config. Pin a version: `curl -fsSL https://assets.gvnr.xyz/dh-mcp/install.sh \| DH_VERSION=0.5.1 sh` |
|
|
16
16
|
| **Developers** (requires **Node ≥ 18 on PATH** — this path does NOT work on a bare machine) | Claude Code: `claude mcp add diamond-hands -- npx -y @gvnrdao/dh-mcp` · any host JSON: `{ "mcpServers": { "diamond-hands": { "command": "npx", "args": ["-y", "@gvnrdao/dh-mcp"] } } }` |
|
|
17
17
|
|
|
18
18
|
Downloads landing page (which file is for which system, checksums, security notes):
|
|
19
19
|
**https://assets.gvnr.xyz/dh-mcp/** — all artifacts and `SHA256SUMS` live under it
|
|
20
|
-
(`latest/` and `v<version>/` — e.g. `v0.5.
|
|
20
|
+
(`latest/` and `v<version>/` — e.g. `v0.5.1/`).
|
|
21
21
|
|
|
22
22
|
Local installs serve local MCP hosts only — **claude.ai web / mobile / Cowork cannot
|
|
23
23
|
reach them** (a hosted remote connector is a separate, upcoming tier).
|
package/dist/boundary.js
CHANGED
|
@@ -88203,6 +88203,22 @@ async function verifyBroadcastTxByHash(provider, hash, approved, borrower, budge
|
|
|
88203
88203
|
|
|
88204
88204
|
// src/signer/external-eoa.ts
|
|
88205
88205
|
var DEFAULT_BUDGET = { attempts: 30, delayMs: 3e3 };
|
|
88206
|
+
async function gasHintAcrossBlocks(provider, from, tx2, action) {
|
|
88207
|
+
if (typeof provider.estimateGas !== "function") return null;
|
|
88208
|
+
let lastErr = null;
|
|
88209
|
+
for (let attempt = 0; attempt < 4; attempt++) {
|
|
88210
|
+
try {
|
|
88211
|
+
const est = await provider.estimateGas({ from, to: tx2.to, data: tx2.data, value: BigInt(tx2.value) });
|
|
88212
|
+
return import_ethers36.ethers.toBeHex(est * 15n / 10n);
|
|
88213
|
+
} catch (e) {
|
|
88214
|
+
lastErr = e;
|
|
88215
|
+
await new Promise((r) => setTimeout(r, 13e3));
|
|
88216
|
+
}
|
|
88217
|
+
}
|
|
88218
|
+
throw new Error(
|
|
88219
|
+
`the ${action} transaction kept reverting in gas estimation across blocks \u2014 refusing to hand it to the wallet (it would fail on-chain; a wallet-side estimate would fall back to an absurd fee and block confirmation): ${(lastErr?.message ?? "unknown estimation failure").slice(0, 200)}`
|
|
88220
|
+
);
|
|
88221
|
+
}
|
|
88206
88222
|
var ExternalEoaDHSigner = class {
|
|
88207
88223
|
constructor(deps) {
|
|
88208
88224
|
this.deps = deps;
|
|
@@ -88254,6 +88270,7 @@ var ExternalEoaDHSigner = class {
|
|
|
88254
88270
|
}
|
|
88255
88271
|
async submitValidatedTx(outerTx, ctx) {
|
|
88256
88272
|
const approved = toApprovedTx(outerTx, this.deps.chainId);
|
|
88273
|
+
const gas = outerTx.gasLimit != null ? import_ethers36.ethers.toBeHex(BigInt(String(outerTx.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, ctx.action);
|
|
88257
88274
|
const outcome = await this.deps.bridge.requestSignature({
|
|
88258
88275
|
id: (0, import_node_crypto5.randomUUID)(),
|
|
88259
88276
|
kind: "transaction",
|
|
@@ -88261,7 +88278,7 @@ var ExternalEoaDHSigner = class {
|
|
|
88261
88278
|
card: ctx.card,
|
|
88262
88279
|
expectedSigner: this.deps.borrower,
|
|
88263
88280
|
chainId: this.deps.chainId,
|
|
88264
|
-
tx: approved
|
|
88281
|
+
tx: { ...approved, ...gas ? { gas } : {}, txType: 2 }
|
|
88265
88282
|
});
|
|
88266
88283
|
if (outcome.status !== "approved") {
|
|
88267
88284
|
throw new OperationDeclined(`the ${ctx.action} transaction was not approved: ${describeOutcome(outcome)}`);
|
|
@@ -88361,6 +88378,7 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers36.ether
|
|
|
88361
88378
|
chainId: tx2.chainId != null ? Number(tx2.chainId) : this.deps.chainId
|
|
88362
88379
|
};
|
|
88363
88380
|
const card = cardForTx(approved);
|
|
88381
|
+
const gas = tx2.gasLimit != null ? import_ethers36.ethers.toBeHex(BigInt(String(tx2.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, describeFn(approved.data));
|
|
88364
88382
|
const outcome = await this.deps.bridge.requestSignature({
|
|
88365
88383
|
id: (0, import_node_crypto5.randomUUID)(),
|
|
88366
88384
|
kind: "transaction",
|
|
@@ -88368,7 +88386,7 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers36.ether
|
|
|
88368
88386
|
card,
|
|
88369
88387
|
expectedSigner: this.deps.borrower,
|
|
88370
88388
|
chainId: approved.chainId,
|
|
88371
|
-
tx: { ...approved, ...
|
|
88389
|
+
tx: { ...approved, ...gas ? { gas } : {}, txType: 2 }
|
|
88372
88390
|
});
|
|
88373
88391
|
if (outcome.status !== "approved") {
|
|
88374
88392
|
throw new OperationDeclined(`the transaction was not approved: ${describeOutcome(outcome)}`);
|
package/dist/index.js
CHANGED
|
@@ -88405,6 +88405,22 @@ async function verifyBroadcastTxByHash(provider, hash, approved, borrower, budge
|
|
|
88405
88405
|
|
|
88406
88406
|
// src/signer/external-eoa.ts
|
|
88407
88407
|
var DEFAULT_BUDGET = { attempts: 30, delayMs: 3e3 };
|
|
88408
|
+
async function gasHintAcrossBlocks(provider, from, tx2, action) {
|
|
88409
|
+
if (typeof provider.estimateGas !== "function") return null;
|
|
88410
|
+
let lastErr = null;
|
|
88411
|
+
for (let attempt = 0; attempt < 4; attempt++) {
|
|
88412
|
+
try {
|
|
88413
|
+
const est = await provider.estimateGas({ from, to: tx2.to, data: tx2.data, value: BigInt(tx2.value) });
|
|
88414
|
+
return import_ethers36.ethers.toBeHex(est * 15n / 10n);
|
|
88415
|
+
} catch (e) {
|
|
88416
|
+
lastErr = e;
|
|
88417
|
+
await new Promise((r) => setTimeout(r, 13e3));
|
|
88418
|
+
}
|
|
88419
|
+
}
|
|
88420
|
+
throw new Error(
|
|
88421
|
+
`the ${action} transaction kept reverting in gas estimation across blocks \u2014 refusing to hand it to the wallet (it would fail on-chain; a wallet-side estimate would fall back to an absurd fee and block confirmation): ${(lastErr?.message ?? "unknown estimation failure").slice(0, 200)}`
|
|
88422
|
+
);
|
|
88423
|
+
}
|
|
88408
88424
|
var ExternalEoaDHSigner = class {
|
|
88409
88425
|
constructor(deps) {
|
|
88410
88426
|
this.deps = deps;
|
|
@@ -88456,6 +88472,7 @@ var ExternalEoaDHSigner = class {
|
|
|
88456
88472
|
}
|
|
88457
88473
|
async submitValidatedTx(outerTx, ctx) {
|
|
88458
88474
|
const approved = toApprovedTx(outerTx, this.deps.chainId);
|
|
88475
|
+
const gas = outerTx.gasLimit != null ? import_ethers36.ethers.toBeHex(BigInt(String(outerTx.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, ctx.action);
|
|
88459
88476
|
const outcome = await this.deps.bridge.requestSignature({
|
|
88460
88477
|
id: (0, import_node_crypto5.randomUUID)(),
|
|
88461
88478
|
kind: "transaction",
|
|
@@ -88463,7 +88480,7 @@ var ExternalEoaDHSigner = class {
|
|
|
88463
88480
|
card: ctx.card,
|
|
88464
88481
|
expectedSigner: this.deps.borrower,
|
|
88465
88482
|
chainId: this.deps.chainId,
|
|
88466
|
-
tx: approved
|
|
88483
|
+
tx: { ...approved, ...gas ? { gas } : {}, txType: 2 }
|
|
88467
88484
|
});
|
|
88468
88485
|
if (outcome.status !== "approved") {
|
|
88469
88486
|
throw new OperationDeclined(`the ${ctx.action} transaction was not approved: ${describeOutcome(outcome)}`);
|
|
@@ -88563,6 +88580,7 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers36.ether
|
|
|
88563
88580
|
chainId: tx2.chainId != null ? Number(tx2.chainId) : this.deps.chainId
|
|
88564
88581
|
};
|
|
88565
88582
|
const card = cardForTx(approved);
|
|
88583
|
+
const gas = tx2.gasLimit != null ? import_ethers36.ethers.toBeHex(BigInt(String(tx2.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, describeFn(approved.data));
|
|
88566
88584
|
const outcome = await this.deps.bridge.requestSignature({
|
|
88567
88585
|
id: (0, import_node_crypto5.randomUUID)(),
|
|
88568
88586
|
kind: "transaction",
|
|
@@ -88570,7 +88588,7 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers36.ether
|
|
|
88570
88588
|
card,
|
|
88571
88589
|
expectedSigner: this.deps.borrower,
|
|
88572
88590
|
chainId: approved.chainId,
|
|
88573
|
-
tx: { ...approved, ...
|
|
88591
|
+
tx: { ...approved, ...gas ? { gas } : {}, txType: 2 }
|
|
88574
88592
|
});
|
|
88575
88593
|
if (outcome.status !== "approved") {
|
|
88576
88594
|
throw new OperationDeclined(`the transaction was not approved: ${describeOutcome(outcome)}`);
|
|
@@ -92229,7 +92247,7 @@ function registerBoundaryInfoResource(server, getB) {
|
|
|
92229
92247
|
}
|
|
92230
92248
|
|
|
92231
92249
|
// src/server.ts
|
|
92232
|
-
var SERVER_VERSION = "0.5.
|
|
92250
|
+
var SERVER_VERSION = "0.5.1";
|
|
92233
92251
|
var SERVER_INSTRUCTIONS = "Diamond Hands MCP \u2014 Bitcoin-collateralized borrowing. Before promising ANY flow, read the boundary://info resource and honor its `capabilities` block: it states which network this server is on, whether money is real (practiceWorld), whether writes are enabled (and the true reason when they are not), and which signer modes this build actually offers \u2014 never describe a flow outside it. State the network and whether funds are real when the user first acts. Authorization is chosen by conversation via the signer_setup tool (when listed); writes always require confirmed:true after showing the human-readable card. For walkthroughs consult the guide tool / guide:// resources instead of inventing steps; when a tool refuses, relay its stated reason and remedy \u2014 do not improvise alternatives. When a network_switch tool is listed, the network can change mid-session \u2014 after ANY switch, re-read boundary://info and state the new network and money reality to the user before doing anything else.";
|
|
92234
92252
|
function createServer2(deps) {
|
|
92235
92253
|
const server = new import_mcp2.McpServer(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gvnrdao/dh-mcp",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "MCP server for the Diamond Hands protocol — Bitcoin-collateralized UCD lending with human-approved signing (sepolia practice by default; mainnet fully enabled)",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|