@aibtc/mcp-server 1.70.1 → 1.72.0
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 +45 -8
- package/dist/bridge/index.js +4 -4
- package/dist/config/contracts.d.ts +4 -4
- package/dist/config/contracts.js +2 -2
- package/dist/config/networks.js +4 -1
- package/dist/endpoints/registry.d.ts +8 -26
- package/dist/endpoints/registry.js +7 -932
- package/dist/index.js +118 -42
- package/dist/services/stacking.service.d.ts +144 -45
- package/dist/services/stacking.service.js +416 -123
- package/dist/services/x402-discovery.service.d.ts +81 -0
- package/dist/services/x402-discovery.service.js +170 -0
- package/dist/tools/arxiv-research.tools.d.ts +1 -1
- package/dist/tools/arxiv-research.tools.js +6 -6
- package/dist/tools/at-stake-legion.tools.d.ts +1 -1
- package/dist/tools/at-stake-legion.tools.js +14 -14
- package/dist/tools/at-stake.tools.d.ts +1 -1
- package/dist/tools/at-stake.tools.js +17 -17
- package/dist/tools/bitcoin.tools.d.ts +1 -1
- package/dist/tools/bitcoin.tools.js +12 -12
- package/dist/tools/bitflow.tools.d.ts +1 -1
- package/dist/tools/bitflow.tools.js +21 -21
- package/dist/tools/bns.tools.d.ts +1 -1
- package/dist/tools/bns.tools.js +18 -18
- package/dist/tools/bounty-hint.d.ts +1 -1
- package/dist/tools/bounty-scanner.tools.d.ts +1 -1
- package/dist/tools/bounty-scanner.tools.js +20 -20
- package/dist/tools/child-inscription.tools.d.ts +1 -1
- package/dist/tools/child-inscription.tools.js +6 -6
- package/dist/tools/competition.tools.d.ts +1 -1
- package/dist/tools/competition.tools.js +4 -4
- package/dist/tools/contract.tools.d.ts +1 -1
- package/dist/tools/contract.tools.js +8 -8
- package/dist/tools/credentials.tools.d.ts +1 -1
- package/dist/tools/credentials.tools.js +8 -8
- package/dist/tools/defi.tools.d.ts +1 -1
- package/dist/tools/defi.tools.js +21 -21
- package/dist/tools/dual-stacking.tools.d.ts +1 -1
- package/dist/tools/dual-stacking.tools.js +7 -7
- package/dist/tools/earning.tools.d.ts +1 -1
- package/dist/tools/earning.tools.js +5 -5
- package/dist/tools/endpoint.tools.d.ts +1 -1
- package/dist/tools/endpoint.tools.js +92 -49
- package/dist/tools/identity.tools.d.ts +1 -1
- package/dist/tools/identity.tools.js +19 -19
- package/dist/tools/inbox-x402.tools.d.ts +1 -1
- package/dist/tools/inbox-x402.tools.js +2 -2
- package/dist/tools/inbox.tools.d.ts +1 -1
- package/dist/tools/inbox.tools.js +2 -2
- package/dist/tools/index.d.ts +6 -3
- package/dist/tools/index.js +69 -58
- package/dist/tools/inference-marketplace.tools.d.ts +1 -1
- package/dist/tools/inference-marketplace.tools.js +10 -10
- package/dist/tools/jingswap.tools.d.ts +1 -1
- package/dist/tools/jingswap.tools.js +30 -30
- package/dist/tools/legion.tools.d.ts +1 -1
- package/dist/tools/legion.tools.js +20 -20
- package/dist/tools/lightning.tools.d.ts +1 -1
- package/dist/tools/lightning.tools.js +14 -14
- package/dist/tools/mempool.tools.d.ts +1 -1
- package/dist/tools/mempool.tools.js +5 -5
- package/dist/tools/news.tools.d.ts +1 -1
- package/dist/tools/news.tools.js +2 -1
- package/dist/tools/nft.tools.d.ts +1 -1
- package/dist/tools/nft.tools.js +12 -12
- package/dist/tools/nonce.tools.d.ts +1 -1
- package/dist/tools/nonce.tools.js +8 -8
- package/dist/tools/nostr.tools.d.ts +1 -1
- package/dist/tools/nostr.tools.js +12 -12
- package/dist/tools/openrouter.tools.d.ts +1 -1
- package/dist/tools/openrouter.tools.js +4 -4
- package/dist/tools/ordinals-marketplace.tools.d.ts +1 -1
- package/dist/tools/ordinals-marketplace.tools.js +10 -10
- package/dist/tools/ordinals-p2p.tools.d.ts +1 -1
- package/dist/tools/ordinals-p2p.tools.js +18 -18
- package/dist/tools/ordinals.tools.d.ts +1 -1
- package/dist/tools/ordinals.tools.js +8 -8
- package/dist/tools/pillar-direct.tools.d.ts +1 -1
- package/dist/tools/pillar-direct.tools.js +59 -38
- package/dist/tools/pillar.tools.d.ts +1 -1
- package/dist/tools/pillar.tools.js +28 -26
- package/dist/tools/profiles.d.ts +51 -0
- package/dist/tools/profiles.js +111 -0
- package/dist/tools/psbt.tools.d.ts +1 -1
- package/dist/tools/psbt.tools.js +8 -8
- package/dist/tools/query.tools.d.ts +1 -1
- package/dist/tools/query.tools.js +12 -12
- package/dist/tools/relay-diagnostic.tools.d.ts +1 -1
- package/dist/tools/relay-diagnostic.tools.js +3 -3
- package/dist/tools/reputation.tools.d.ts +1 -1
- package/dist/tools/reputation.tools.js +22 -22
- package/dist/tools/runes.tools.d.ts +1 -1
- package/dist/tools/runes.tools.js +18 -18
- package/dist/tools/sbtc.tools.d.ts +1 -1
- package/dist/tools/sbtc.tools.js +14 -33
- package/dist/tools/scaffold.tools.d.ts +1 -1
- package/dist/tools/scaffold.tools.js +4 -4
- package/dist/tools/settings.tools.d.ts +1 -1
- package/dist/tools/settings.tools.js +9 -9
- package/dist/tools/signing.tools.d.ts +1 -1
- package/dist/tools/signing.tools.js +20 -20
- package/dist/tools/skill-mappings.js +4 -0
- package/dist/tools/souldinals.tools.d.ts +1 -1
- package/dist/tools/souldinals.tools.js +10 -10
- package/dist/tools/stacking-lottery.tools.d.ts +1 -1
- package/dist/tools/stacking-lottery.tools.js +11 -11
- package/dist/tools/stacking.tools.d.ts +1 -1
- package/dist/tools/stacking.tools.js +358 -50
- package/dist/tools/stacks-market.tools.d.ts +1 -1
- package/dist/tools/stacks-market.tools.js +22 -22
- package/dist/tools/styx.tools.d.ts +1 -1
- package/dist/tools/styx.tools.js +11 -11
- package/dist/tools/taproot-multisig.tools.d.ts +1 -1
- package/dist/tools/taproot-multisig.tools.js +5 -5
- package/dist/tools/tenero.tools.d.ts +1 -1
- package/dist/tools/tenero.tools.js +22 -22
- package/dist/tools/tokens.tools.d.ts +1 -1
- package/dist/tools/tokens.tools.js +10 -10
- package/dist/tools/transfer.tools.d.ts +1 -1
- package/dist/tools/transfer.tools.js +4 -4
- package/dist/tools/wallet-management.tools.d.ts +1 -1
- package/dist/tools/wallet-management.tools.js +16 -16
- package/dist/tools/wallet.tools.d.ts +1 -1
- package/dist/tools/wallet.tools.js +2 -2
- package/dist/tools/yield-dashboard.tools.d.ts +1 -1
- package/dist/tools/yield-dashboard.tools.js +18 -27
- package/dist/tools/yield-hunter.tools.d.ts +1 -1
- package/dist/tools/yield-hunter.tools.js +6 -6
- package/dist/utils/bitcoin.d.ts +8 -0
- package/dist/utils/bitcoin.js +24 -0
- package/dist/utils/fee.js +1 -1
- package/package.json +8 -7
- package/skill/SKILL.md +1 -1
- package/skill/references/stacks-defi.md +1 -1
|
@@ -17,6 +17,7 @@ import { contractPrincipalCV, standardPrincipalCV, uintCV, hexToCV, cvToValue, }
|
|
|
17
17
|
import { NETWORK } from "../services/x402.service.js";
|
|
18
18
|
import { getWalletAddress } from "../services/x402.service.js";
|
|
19
19
|
import { getHiroApi } from "../services/hiro-api.js";
|
|
20
|
+
import { getStackingService } from "../services/stacking.service.js";
|
|
20
21
|
import { createJsonResponse, createErrorResponse } from "../utils/index.js";
|
|
21
22
|
// ============================================================================
|
|
22
23
|
// Constants
|
|
@@ -41,10 +42,6 @@ const ALEX_TOKEN_Y_NAME = "token-abtc";
|
|
|
41
42
|
const ALEX_FACTOR = 100_000_000;
|
|
42
43
|
// Bitflow public API
|
|
43
44
|
const BITFLOW_API = "https://app.bitflow.finance/api";
|
|
44
|
-
// Stacking (PoX-4)
|
|
45
|
-
const POX_CONTRACT = "SP000000000000000000002Q6VF78";
|
|
46
|
-
const POX_NAME = "pox-4";
|
|
47
|
-
const POX_CONTRACT_ID = `${POX_CONTRACT}.${POX_NAME}`;
|
|
48
45
|
// Mainnet Hiro API base URL (direct — not network-switched, this skill is mainnet-only)
|
|
49
46
|
const MAINNET_HIRO_API = "https://api.hiro.so";
|
|
50
47
|
// ============================================================================
|
|
@@ -225,24 +222,18 @@ async function readStackingPosition(walletAddress) {
|
|
|
225
222
|
details: {},
|
|
226
223
|
};
|
|
227
224
|
try {
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
? lockAmount
|
|
241
|
-
: 0;
|
|
242
|
-
pos.apyPct = 8.0;
|
|
243
|
-
pos.details.apySource = "static estimate, not live";
|
|
244
|
-
pos.details.stackerInfo = val;
|
|
245
|
-
}
|
|
225
|
+
const info = await getStackingService("mainnet").getStakerInfo(walletAddress);
|
|
226
|
+
if (info) {
|
|
227
|
+
pos.valueSats = Number(info.amountUstx);
|
|
228
|
+
pos.apyPct = 8.0;
|
|
229
|
+
pos.details.apySource = "static estimate, not live";
|
|
230
|
+
pos.details.stakerInfo = {
|
|
231
|
+
signerManager: info.signerManager,
|
|
232
|
+
firstRewardCycle: info.firstRewardCycle,
|
|
233
|
+
numCycles: info.numCycles,
|
|
234
|
+
unlockCycle: info.unlockCycle,
|
|
235
|
+
unlockBurnHeight: info.unlockBurnHeight,
|
|
236
|
+
};
|
|
246
237
|
}
|
|
247
238
|
}
|
|
248
239
|
catch (e) {
|
|
@@ -288,7 +279,7 @@ Read-only. Mainnet-only. Requires an unlocked wallet for address context.
|
|
|
288
279
|
|
|
289
280
|
Note: ALEX LP and Bitflow LP position values are 0 — these protocols do not
|
|
290
281
|
expose user LP positions via read-only calls. APY figures are still returned.`,
|
|
291
|
-
inputSchema: {},
|
|
282
|
+
inputSchema: z.object({}),
|
|
292
283
|
}, async () => {
|
|
293
284
|
try {
|
|
294
285
|
if (NETWORK !== "mainnet") {
|
|
@@ -364,7 +355,7 @@ Known limitations:
|
|
|
364
355
|
- ALEX LP and Bitflow LP: valueSats shows 0 (protocol does not expose user
|
|
365
356
|
LP balances via read-only calls). APY is still returned.
|
|
366
357
|
- Stacking: denominated in microSTX, not sats.`,
|
|
367
|
-
inputSchema: {},
|
|
358
|
+
inputSchema: z.object({}),
|
|
368
359
|
}, async () => {
|
|
369
360
|
try {
|
|
370
361
|
if (NETWORK !== "mainnet") {
|
|
@@ -415,7 +406,7 @@ Data sources:
|
|
|
415
406
|
- STX Stacking: static 8.0% estimate
|
|
416
407
|
|
|
417
408
|
Mainnet data only (contract addresses are mainnet-specific).`,
|
|
418
|
-
inputSchema: {},
|
|
409
|
+
inputSchema: z.object({}),
|
|
419
410
|
}, async () => {
|
|
420
411
|
try {
|
|
421
412
|
// APY breakdown does not require a wallet — use burn address as dummy
|
|
@@ -474,13 +465,13 @@ Risk tolerance levels:
|
|
|
474
465
|
- high: Zest 50%, ALEX 30%, Bitflow 20%, Stacking 0%
|
|
475
466
|
|
|
476
467
|
Read-only. Mainnet-only. Requires an unlocked wallet for address context.`,
|
|
477
|
-
inputSchema: {
|
|
468
|
+
inputSchema: z.object({
|
|
478
469
|
riskTolerance: z
|
|
479
470
|
.enum(["low", "medium", "high"])
|
|
480
471
|
.optional()
|
|
481
472
|
.default("medium")
|
|
482
473
|
.describe("Risk tolerance level: low, medium, or high (default: medium)"),
|
|
483
|
-
},
|
|
474
|
+
}),
|
|
484
475
|
}, async ({ riskTolerance }) => {
|
|
485
476
|
try {
|
|
486
477
|
if (NETWORK !== "mainnet") {
|
|
@@ -273,7 +273,7 @@ Default settings:
|
|
|
273
273
|
- Deposit threshold: 10,000 sats (0.0001 sBTC)
|
|
274
274
|
- Reserve: 0 sats (deposit all sBTC to maximize yield)
|
|
275
275
|
- Check interval: 10 minutes`,
|
|
276
|
-
inputSchema: {
|
|
276
|
+
inputSchema: z.object({
|
|
277
277
|
threshold: z
|
|
278
278
|
.string()
|
|
279
279
|
.optional()
|
|
@@ -286,7 +286,7 @@ Default settings:
|
|
|
286
286
|
.number()
|
|
287
287
|
.optional()
|
|
288
288
|
.describe("Check interval in seconds. Default: 600 (10 minutes)"),
|
|
289
|
-
},
|
|
289
|
+
}),
|
|
290
290
|
}, async ({ threshold, reserve, interval }) => {
|
|
291
291
|
try {
|
|
292
292
|
if (NETWORK !== "mainnet") {
|
|
@@ -363,7 +363,7 @@ Default settings:
|
|
|
363
363
|
|
|
364
364
|
Stops the background process that monitors and deposits sBTC.
|
|
365
365
|
Your existing Zest positions remain untouched.`,
|
|
366
|
-
inputSchema: {},
|
|
366
|
+
inputSchema: z.object({}),
|
|
367
367
|
}, async () => {
|
|
368
368
|
try {
|
|
369
369
|
if (!state.running) {
|
|
@@ -403,7 +403,7 @@ Shows:
|
|
|
403
403
|
- Statistics (checks run, deposits made)
|
|
404
404
|
- Recent activity logs
|
|
405
405
|
- Current Zest position`,
|
|
406
|
-
inputSchema: {},
|
|
406
|
+
inputSchema: z.object({}),
|
|
407
407
|
}, async () => {
|
|
408
408
|
try {
|
|
409
409
|
const status = await getFullStatus();
|
|
@@ -419,7 +419,7 @@ Shows:
|
|
|
419
419
|
|
|
420
420
|
Adjust the deposit threshold, reserve, or check interval.
|
|
421
421
|
Changes take effect on the next check cycle.`,
|
|
422
|
-
inputSchema: {
|
|
422
|
+
inputSchema: z.object({
|
|
423
423
|
threshold: z
|
|
424
424
|
.string()
|
|
425
425
|
.optional()
|
|
@@ -432,7 +432,7 @@ Changes take effect on the next check cycle.`,
|
|
|
432
432
|
.number()
|
|
433
433
|
.optional()
|
|
434
434
|
.describe("Check interval in seconds"),
|
|
435
|
-
},
|
|
435
|
+
}),
|
|
436
436
|
}, async ({ threshold, reserve, interval }) => {
|
|
437
437
|
try {
|
|
438
438
|
const changes = [];
|
package/dist/utils/bitcoin.d.ts
CHANGED
|
@@ -231,4 +231,12 @@ export declare function deriveTaprootKeyPair(mnemonic: string, network: Network)
|
|
|
231
231
|
* ```
|
|
232
232
|
*/
|
|
233
233
|
export declare function deriveNostrKeyPair(mnemonic: string, _network: Network): NostrKeyPair;
|
|
234
|
+
/**
|
|
235
|
+
* Decode a Bitcoin address into the `{ version, hashbytes }` pox-addr tuple used by
|
|
236
|
+
* Stacks contracts (sBTC withdrawals, PoX signer-manager payout addresses).
|
|
237
|
+
*/
|
|
238
|
+
export declare function btcAddressToPoxAddr(address: string, network: Network): {
|
|
239
|
+
version: number;
|
|
240
|
+
hashbytesHex: string;
|
|
241
|
+
};
|
|
234
242
|
//# sourceMappingURL=bitcoin.d.ts.map
|
package/dist/utils/bitcoin.js
CHANGED
|
@@ -326,4 +326,28 @@ export function deriveNostrKeyPair(mnemonic, _network) {
|
|
|
326
326
|
publicKey,
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
|
+
/**
|
|
330
|
+
* Decode a Bitcoin address into the `{ version, hashbytes }` pox-addr tuple used by
|
|
331
|
+
* Stacks contracts (sBTC withdrawals, PoX signer-manager payout addresses).
|
|
332
|
+
*/
|
|
333
|
+
export function btcAddressToPoxAddr(address, network) {
|
|
334
|
+
const decoded = btc
|
|
335
|
+
.Address(network === "mainnet" ? btc.NETWORK : btc.TEST_NETWORK)
|
|
336
|
+
.decode(address);
|
|
337
|
+
if (decoded.type === "tr" && decoded.pubkey) {
|
|
338
|
+
return { version: 0x06, hashbytesHex: Buffer.from(decoded.pubkey).toString("hex") };
|
|
339
|
+
}
|
|
340
|
+
switch (decoded.type) {
|
|
341
|
+
case "pkh":
|
|
342
|
+
return { version: 0x00, hashbytesHex: Buffer.from(decoded.hash).toString("hex") };
|
|
343
|
+
case "sh":
|
|
344
|
+
return { version: 0x01, hashbytesHex: Buffer.from(decoded.hash).toString("hex") };
|
|
345
|
+
case "wpkh":
|
|
346
|
+
return { version: 0x04, hashbytesHex: Buffer.from(decoded.hash).toString("hex") };
|
|
347
|
+
case "wsh":
|
|
348
|
+
return { version: 0x05, hashbytesHex: Buffer.from(decoded.hash).toString("hex") };
|
|
349
|
+
default:
|
|
350
|
+
throw new Error("Unsupported BTC address type. Supported: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.");
|
|
351
|
+
}
|
|
352
|
+
}
|
|
329
353
|
//# sourceMappingURL=bitcoin.js.map
|
package/dist/utils/fee.js
CHANGED
|
@@ -88,7 +88,7 @@ export async function resolveFee(fee, network, txType = "all") {
|
|
|
88
88
|
const clamps = FEE_CLAMPS[txType];
|
|
89
89
|
const multipliers = { low: 1n, medium: 2n, high: 3n };
|
|
90
90
|
const fallbackFee = clamps.floor * multipliers[fee.toLowerCase()];
|
|
91
|
-
console.
|
|
91
|
+
console.error(`Using fallback fee: ${fallbackFee} uSTX (${fee} preset, ${txType} type)`);
|
|
92
92
|
return fallbackFee;
|
|
93
93
|
}
|
|
94
94
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aibtc/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.72.0",
|
|
4
4
|
"description": "Bitcoin-native MCP server for AI agents: BTC/STX wallets, DeFi yield, sBTC peg, NFTs, and x402 payments.",
|
|
5
5
|
"mcpName": "io.github.aibtcdev/mcp-server",
|
|
6
6
|
"type": "module",
|
|
@@ -52,17 +52,18 @@
|
|
|
52
52
|
"@bitflowlabs/core-sdk": "^3.0.0",
|
|
53
53
|
"@buildonspark/spark-sdk": "^0.7.14",
|
|
54
54
|
"@faktoryfun/styx-sdk": "^1.3.5",
|
|
55
|
-
"@modelcontextprotocol/
|
|
55
|
+
"@modelcontextprotocol/client": "^2.1.0",
|
|
56
|
+
"@modelcontextprotocol/server": "^2.1.0",
|
|
56
57
|
"@noble/curves": "^2.0.1",
|
|
57
58
|
"@noble/hashes": "^2.0.1",
|
|
58
59
|
"@scure/base": "^2.0.0",
|
|
59
60
|
"@scure/bip32": "^1.4.0",
|
|
60
61
|
"@scure/bip39": "^2.0.1",
|
|
61
62
|
"@scure/btc-signer": "^2.0.1",
|
|
62
|
-
"@stacks/common": "^7.
|
|
63
|
-
"@stacks/encryption": "^7.
|
|
64
|
-
"@stacks/network": "^7.
|
|
65
|
-
"@stacks/transactions": "^7.
|
|
63
|
+
"@stacks/common": "^7.6.0",
|
|
64
|
+
"@stacks/encryption": "^7.6.0",
|
|
65
|
+
"@stacks/network": "^7.6.0",
|
|
66
|
+
"@stacks/transactions": "^7.6.0",
|
|
66
67
|
"@stacks/wallet-sdk": "^7.2.0",
|
|
67
68
|
"alex-sdk": "^3.2.1",
|
|
68
69
|
"axios": "^1.17.0",
|
|
@@ -75,7 +76,7 @@
|
|
|
75
76
|
"tslib": "^2.8.1",
|
|
76
77
|
"ws": "^8.21.0",
|
|
77
78
|
"x402-stacks": "^2.0.3",
|
|
78
|
-
"zod": "^4.
|
|
79
|
+
"zod": "^4.6.5"
|
|
79
80
|
},
|
|
80
81
|
"devDependencies": {
|
|
81
82
|
"@types/node": "^22.19.13",
|
package/skill/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: Bitcoin L1 wallet for agents - check balances, send BTC, manage UTX
|
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
author: aibtcdev
|
|
7
|
-
version: 1.
|
|
7
|
+
version: 1.72.0 # x-release-please-version
|
|
8
8
|
npm: "@aibtc/mcp-server"
|
|
9
9
|
github: https://github.com/aibtcdev/aibtc-mcp-server
|
|
10
10
|
---
|
|
@@ -360,7 +360,7 @@ Utility services for agents:
|
|
|
360
360
|
| Category | Endpoints |
|
|
361
361
|
|----------|-----------|
|
|
362
362
|
| **Inference** | `/inference/openrouter/chat`, `/inference/cloudflare/chat` |
|
|
363
|
-
| **Stacks** | `/stacks/address`, `/stacks/decode`, `/stacks/profile` |
|
|
363
|
+
| **Stacks** | `/stacks/address/{address}`, `/stacks/decode/transaction`, `/stacks/decode/clarity`, `/stacks/profile/{address}` |
|
|
364
364
|
| **Hashing** | `/hashing/sha256`, `/hashing/keccak256`, `/hashing/hash160` |
|
|
365
365
|
| **Storage** | `/storage/kv/*`, `/storage/paste/*`, `/storage/db/*`, `/storage/memory/*` |
|
|
366
366
|
|