@aibtc/mcp-server 1.70.0 → 1.71.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 +16 -10
- package/dist/bridge/index.js +2 -2
- package/dist/config/contracts.d.ts +8 -8
- package/dist/config/contracts.js +3 -3
- package/dist/endpoints/registry.d.ts +8 -26
- package/dist/endpoints/registry.js +7 -932
- 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/defi.tools.js +1 -1
- package/dist/tools/earning.tools.js +3 -3
- package/dist/tools/endpoint.tools.js +85 -38
- package/dist/tools/index.js +7 -1
- package/dist/tools/news.tools.d.ts +5 -31
- package/dist/tools/news.tools.js +96 -1389
- package/dist/tools/pillar-direct.tools.js +23 -2
- package/dist/tools/sbtc.tools.js +2 -21
- package/dist/tools/skill-mappings.js +4 -7
- package/dist/tools/stacking.tools.js +352 -44
- package/dist/tools/yield-dashboard.tools.js +13 -22
- package/dist/utils/bip322.d.ts +2 -3
- package/dist/utils/bip322.js +2 -3
- package/dist/utils/bitcoin.d.ts +8 -0
- package/dist/utils/bitcoin.js +24 -0
- package/dist/utils/erc8004-helpers.d.ts +1 -1
- package/dist/utils/erc8004-helpers.js +1 -1
- package/package.json +6 -6
- package/skill/SKILL.md +3 -3
- package/skill/references/genesis-lifecycle.md +17 -32
- package/skill/references/pillar-wallet.md +1 -1
- package/skill/references/stacks-defi.md +1 -1
- package/dist/tools/erc8004.tools.d.ts +0 -21
- package/dist/tools/erc8004.tools.js +0 -329
package/README.md
CHANGED
|
@@ -10,12 +10,12 @@ Bitcoin-native MCP server for AI agents: BTC/STX wallets, DeFi yield, sBTC peg,
|
|
|
10
10
|
- **Bitcoin L1** - Check balances, send BTC, manage UTXOs via mempool.space
|
|
11
11
|
- **Agent's Own Wallet** - Agents get their own wallet to perform blockchain transactions
|
|
12
12
|
- **Secure Storage** - Wallets encrypted with AES-256-GCM and stored locally
|
|
13
|
-
- **
|
|
13
|
+
- **350+ Tools** - Bitcoin L1 + comprehensive Stacks L2 operations
|
|
14
14
|
- **sBTC Support** - Native Bitcoin on Stacks operations
|
|
15
15
|
- **Token Operations** - SIP-010 fungible token transfers and queries
|
|
16
16
|
- **NFT Support** - SIP-009 NFT holdings, transfers, and metadata
|
|
17
17
|
- **DeFi Trading** - ALEX DEX swaps and Zest Protocol lending/borrowing
|
|
18
|
-
- **Stacking/PoX** -
|
|
18
|
+
- **Stacking/PoX-5** - Stake STX with a signer manager, extend, unstake, claim sBTC rewards
|
|
19
19
|
- **BNS Domains** - .btc domain lookups and management (V1 + V2)
|
|
20
20
|
- **x402 Payments** - Automatic payment handling for paid APIs
|
|
21
21
|
|
|
@@ -276,7 +276,7 @@ Claude: Done! Transaction broadcast: abc123...
|
|
|
276
276
|
|
|
277
277
|
Both addresses are derived from the same recovery phrase, making it easy to manage both Layer 1 (Bitcoin) and Layer 2 (Stacks) assets.
|
|
278
278
|
|
|
279
|
-
## Available Tools (
|
|
279
|
+
## Available Tools (350+ total)
|
|
280
280
|
|
|
281
281
|
### Wallet Management
|
|
282
282
|
| Tool | Description |
|
|
@@ -386,10 +386,14 @@ Both addresses are derived from the same recovery phrase, making it easy to mana
|
|
|
386
386
|
### Stacking / PoX
|
|
387
387
|
| Tool | Description |
|
|
388
388
|
|------|-------------|
|
|
389
|
-
| `get_pox_info` |
|
|
390
|
-
| `get_stacking_status` |
|
|
391
|
-
| `
|
|
392
|
-
| `
|
|
389
|
+
| `get_pox_info` | Current PoX-5 cycle, burn height, prepare phase |
|
|
390
|
+
| `get_stacking_status` | Locked amount, signer manager, unlock height |
|
|
391
|
+
| `list_stacking_signers` | Signer managers in the next cycle's signer set |
|
|
392
|
+
| `stack_stx` | Lock STX with a signer manager |
|
|
393
|
+
| `extend_stacking` | Extend, increase, switch signer or payout (stake-update) |
|
|
394
|
+
| `unstake_stx` | Stop early; unlocks next cycle |
|
|
395
|
+
| `get_stacking_rewards` | Unclaimed sBTC rewards for a cycle |
|
|
396
|
+
| `claim_stacking_rewards` | Claim a cycle's rewards through the signer manager |
|
|
393
397
|
|
|
394
398
|
### BNS Domains (V1 + V2)
|
|
395
399
|
| Tool | Description |
|
|
@@ -542,7 +546,7 @@ Or use any SIP-010 token by contract ID: `SP2X...::token-name`
|
|
|
542
546
|
|
|
543
547
|
| Environment Variable | Description | Default |
|
|
544
548
|
|---------------------|-------------|---------|
|
|
545
|
-
| `NETWORK` | `mainnet` or `testnet` | `mainnet`
|
|
549
|
+
| `NETWORK` | `mainnet` or `testnet` | `mainnet` |
|
|
546
550
|
| `API_URL` | Default x402 API base URL | `https://x402.biwas.xyz` |
|
|
547
551
|
| `CLIENT_MNEMONIC` | (Optional) Pre-configured mnemonic | - |
|
|
548
552
|
| `HIRO_API_KEY` | (Optional) Hiro API key for higher rate limits | - |
|
|
@@ -550,7 +554,7 @@ Or use any SIP-010 token by contract ID: `SP2X...::token-name`
|
|
|
550
554
|
| `SPEND_LIMIT_DAILY_USTX` / `SPEND_LIMIT_SESSION_USTX` | STX spend cap per day / per unlock (micro-STX) | `10000000` (10 STX) |
|
|
551
555
|
| `SPEND_LIMIT_DAILY_SATS` / `SPEND_LIMIT_SESSION_SATS` | BTC spend cap per day / per unlock (sats) | `50000` |
|
|
552
556
|
|
|
553
|
-
**Note on `NETWORK`:** The `--install` command writes `NETWORK=mainnet` by default (pass `--testnet` to use testnet). If you omit `NETWORK` from your config entirely, the runtime fallback is `
|
|
557
|
+
**Note on `NETWORK`:** The `--install` command writes `NETWORK=mainnet` by default (pass `--testnet` to use testnet). If you omit `NETWORK` from your config entirely, the runtime fallback is also `mainnet`.
|
|
554
558
|
|
|
555
559
|
**Note on spending limits:** A default-on safety rail meters every outbound spend (`transfer_stx`, `transfer_btc`, x402/L402 auto-payments) against a cumulative per-session and per-day cap, so a single bad instruction or a malicious endpoint can't drain the wallet. A spend over the cap is blocked and reports the remaining budget. Raise the caps via the env vars above, or disable with `SPEND_LIMIT_ENABLED=false`. See [SECURITY.md](SECURITY.md#limit-blast-radius).
|
|
556
560
|
|
|
@@ -627,11 +631,13 @@ The skill is automatically included when you install the MCP server. Find it at:
|
|
|
627
631
|
skill/
|
|
628
632
|
├── SKILL.md # Bitcoin L1 core workflows
|
|
629
633
|
└── references/
|
|
634
|
+
├── at-stake.md # El Salvador prediction market & side legions
|
|
630
635
|
├── genesis-lifecycle.md # Agent registration & check-in
|
|
631
636
|
├── inscription-workflow.md # Bitcoin inscription guide
|
|
632
637
|
├── pillar-wallet.md # Pillar smart wallet guide
|
|
633
638
|
├── stacks-defi.md # Stacks L2 / DeFi operations
|
|
634
|
-
|
|
639
|
+
├── troubleshooting.md # Common issues and solutions
|
|
640
|
+
└── x402-inbox.md # x402 inbox messaging
|
|
635
641
|
```
|
|
636
642
|
|
|
637
643
|
## Development
|
package/dist/bridge/index.js
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
*/
|
|
30
30
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
31
31
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
32
|
-
import {
|
|
32
|
+
import { STATIC_ENDPOINTS } from "../endpoints/registry.js";
|
|
33
33
|
const OPENROUTER_URL = "https://openrouter.ai/api/v1/chat/completions";
|
|
34
34
|
const DEFAULT_MODEL = "anthropic/claude-3.5-haiku";
|
|
35
35
|
/**
|
|
@@ -154,7 +154,7 @@ function printSafetyReceipt(opts, exposed, totalTools) {
|
|
|
154
154
|
` write_tool_count=${writeToolCount}`,
|
|
155
155
|
` blocked_tool_count=${opts.block.size}`,
|
|
156
156
|
` session_spend_cap=${opts.maxSpendUstx ?? "default"} uSTX / ${opts.maxSpendSats ?? "default"} sats`,
|
|
157
|
-
`
|
|
157
|
+
` x402_static_endpoints=${STATIC_ENDPOINTS.length}`,
|
|
158
158
|
" (reports configured execution boundaries only; no value has moved)",
|
|
159
159
|
];
|
|
160
160
|
console.error(lines.join("\n"));
|
|
@@ -9,10 +9,10 @@ export declare const MAINNET_CONTRACTS: {
|
|
|
9
9
|
readonly SBTC_WITHDRAWAL: "SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-withdrawal";
|
|
10
10
|
readonly USDCX: "SP120SBRBQJ00MCWS7TM5R8WJNTTKD5K0HFRC2CNE.usdcx";
|
|
11
11
|
readonly BNS: "SP000000000000000000002Q6VF78.bns";
|
|
12
|
-
readonly
|
|
12
|
+
readonly POX_5: "SP000000000000000000002Q6VF78.pox-5";
|
|
13
13
|
readonly ALEX_AMM_POOL: "SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.amm-swap-pool-v1-1";
|
|
14
14
|
readonly ALEX_TOKEN: "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-alex";
|
|
15
|
-
readonly ALEX_WSTX: "
|
|
15
|
+
readonly ALEX_WSTX: "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-wstx-v2";
|
|
16
16
|
readonly ZEST_MARKET: "SP1A27KFY4XERQCCRCARCYD1CC5N7M6688BSYADJ7.v0-4-market";
|
|
17
17
|
readonly ZEST_DATA: "SP1A27KFY4XERQCCRCARCYD1CC5N7M6688BSYADJ7.protocol-data";
|
|
18
18
|
readonly ZEST_MARKET_VAULT: "SP1A27KFY4XERQCCRCARCYD1CC5N7M6688BSYADJ7.v0-market-vault";
|
|
@@ -57,7 +57,7 @@ export declare const TESTNET_CONTRACTS: {
|
|
|
57
57
|
readonly SBTC_WITHDRAWAL: "ST1F7QA2MDF17S807EPA36TSS8AMEFY4KA9TVGWXT.sbtc-withdrawal";
|
|
58
58
|
readonly USDCX: "ST1F7QA2MDF17S807EPA36TSS8AMEFY4KA9TVGWXT.usdcx";
|
|
59
59
|
readonly BNS: "ST000000000000000000002AMW42H.bns";
|
|
60
|
-
readonly
|
|
60
|
+
readonly POX_5: "ST000000000000000000002AMW42H.pox-5";
|
|
61
61
|
readonly IDENTITY_REGISTRY: "ST3YT0XW92E6T2FE59B2G5N2WNNFSBZ6MZKQS5D18.identity-registry-v2";
|
|
62
62
|
readonly REPUTATION_REGISTRY: "ST3YT0XW92E6T2FE59B2G5N2WNNFSBZ6MZKQS5D18.reputation-registry-v2";
|
|
63
63
|
readonly VALIDATION_REGISTRY: "ST3YT0XW92E6T2FE59B2G5N2WNNFSBZ6MZKQS5D18.validation-registry-v2";
|
|
@@ -72,10 +72,10 @@ export declare function getContracts(network: Network): {
|
|
|
72
72
|
readonly SBTC_WITHDRAWAL: "SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-withdrawal";
|
|
73
73
|
readonly USDCX: "SP120SBRBQJ00MCWS7TM5R8WJNTTKD5K0HFRC2CNE.usdcx";
|
|
74
74
|
readonly BNS: "SP000000000000000000002Q6VF78.bns";
|
|
75
|
-
readonly
|
|
75
|
+
readonly POX_5: "SP000000000000000000002Q6VF78.pox-5";
|
|
76
76
|
readonly ALEX_AMM_POOL: "SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.amm-swap-pool-v1-1";
|
|
77
77
|
readonly ALEX_TOKEN: "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-alex";
|
|
78
|
-
readonly ALEX_WSTX: "
|
|
78
|
+
readonly ALEX_WSTX: "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-wstx-v2";
|
|
79
79
|
readonly ZEST_MARKET: "SP1A27KFY4XERQCCRCARCYD1CC5N7M6688BSYADJ7.v0-4-market";
|
|
80
80
|
readonly ZEST_DATA: "SP1A27KFY4XERQCCRCARCYD1CC5N7M6688BSYADJ7.protocol-data";
|
|
81
81
|
readonly ZEST_MARKET_VAULT: "SP1A27KFY4XERQCCRCARCYD1CC5N7M6688BSYADJ7.v0-market-vault";
|
|
@@ -96,7 +96,7 @@ export declare function getContracts(network: Network): {
|
|
|
96
96
|
readonly SBTC_WITHDRAWAL: "ST1F7QA2MDF17S807EPA36TSS8AMEFY4KA9TVGWXT.sbtc-withdrawal";
|
|
97
97
|
readonly USDCX: "ST1F7QA2MDF17S807EPA36TSS8AMEFY4KA9TVGWXT.usdcx";
|
|
98
98
|
readonly BNS: "ST000000000000000000002AMW42H.bns";
|
|
99
|
-
readonly
|
|
99
|
+
readonly POX_5: "ST000000000000000000002AMW42H.pox-5";
|
|
100
100
|
readonly IDENTITY_REGISTRY: "ST3YT0XW92E6T2FE59B2G5N2WNNFSBZ6MZKQS5D18.identity-registry-v2";
|
|
101
101
|
readonly REPUTATION_REGISTRY: "ST3YT0XW92E6T2FE59B2G5N2WNNFSBZ6MZKQS5D18.reputation-registry-v2";
|
|
102
102
|
readonly VALIDATION_REGISTRY: "ST3YT0XW92E6T2FE59B2G5N2WNNFSBZ6MZKQS5D18.validation-registry-v2";
|
|
@@ -118,7 +118,7 @@ export declare const WELL_KNOWN_TOKENS: {
|
|
|
118
118
|
readonly sBTC: "SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token";
|
|
119
119
|
readonly USDCx: "SP120SBRBQJ00MCWS7TM5R8WJNTTKD5K0HFRC2CNE.usdcx";
|
|
120
120
|
readonly ALEX: "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-alex";
|
|
121
|
-
readonly wSTX: "
|
|
121
|
+
readonly wSTX: "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-wstx-v2";
|
|
122
122
|
};
|
|
123
123
|
readonly testnet: {
|
|
124
124
|
readonly STX: "native";
|
|
@@ -146,7 +146,7 @@ export declare function getWellKnownTokens(network: Network): {
|
|
|
146
146
|
readonly sBTC: "SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token";
|
|
147
147
|
readonly USDCx: "SP120SBRBQJ00MCWS7TM5R8WJNTTKD5K0HFRC2CNE.usdcx";
|
|
148
148
|
readonly ALEX: "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-alex";
|
|
149
|
-
readonly wSTX: "
|
|
149
|
+
readonly wSTX: "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-wstx-v2";
|
|
150
150
|
} | {
|
|
151
151
|
readonly STX: "native";
|
|
152
152
|
readonly sBTC: "ST1F7QA2MDF17S807EPA36TSS8AMEFY4KA9TVGWXT.sbtc-token";
|
package/dist/config/contracts.js
CHANGED
|
@@ -12,11 +12,11 @@ export const MAINNET_CONTRACTS = {
|
|
|
12
12
|
// BNS
|
|
13
13
|
BNS: "SP000000000000000000002Q6VF78.bns",
|
|
14
14
|
// Stacking
|
|
15
|
-
|
|
15
|
+
POX_5: "SP000000000000000000002Q6VF78.pox-5",
|
|
16
16
|
// ALEX DEX (SDK handles most operations, but we need pool contract for queries)
|
|
17
17
|
ALEX_AMM_POOL: "SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.amm-swap-pool-v1-1",
|
|
18
18
|
ALEX_TOKEN: "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-alex",
|
|
19
|
-
ALEX_WSTX: "
|
|
19
|
+
ALEX_WSTX: "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-wstx-v2",
|
|
20
20
|
// Zest Protocol v2
|
|
21
21
|
ZEST_MARKET: "SP1A27KFY4XERQCCRCARCYD1CC5N7M6688BSYADJ7.v0-4-market",
|
|
22
22
|
ZEST_DATA: "SP1A27KFY4XERQCCRCARCYD1CC5N7M6688BSYADJ7.protocol-data", // read-only helper for v0-4-market positions
|
|
@@ -112,7 +112,7 @@ export const TESTNET_CONTRACTS = {
|
|
|
112
112
|
// BNS
|
|
113
113
|
BNS: "ST000000000000000000002AMW42H.bns",
|
|
114
114
|
// Stacking
|
|
115
|
-
|
|
115
|
+
POX_5: "ST000000000000000000002AMW42H.pox-5",
|
|
116
116
|
// ERC-8004 Identity & Reputation
|
|
117
117
|
IDENTITY_REGISTRY: "ST3YT0XW92E6T2FE59B2G5N2WNNFSBZ6MZKQS5D18.identity-registry-v2",
|
|
118
118
|
REPUTATION_REGISTRY: "ST3YT0XW92E6T2FE59B2G5N2WNNFSBZ6MZKQS5D18.reputation-registry-v2",
|
|
@@ -1,41 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Static x402 endpoint entries for hosts that do not publish an OpenAPI spec.
|
|
3
|
+
*
|
|
4
|
+
* x402.aibtc.com and stx402.com publish `openapi.json`, so their endpoints are
|
|
5
|
+
* discovered live (see services/x402-discovery.service.ts) instead of listed here.
|
|
4
6
|
*/
|
|
5
|
-
export type
|
|
7
|
+
export type StaticX402Source = "x402.biwas.xyz" | "aibtc.com";
|
|
6
8
|
export interface X402Endpoint {
|
|
7
9
|
path: string;
|
|
8
10
|
method: "GET" | "POST" | "PUT" | "DELETE";
|
|
9
11
|
description: string;
|
|
10
12
|
cost: string;
|
|
11
13
|
category: string;
|
|
12
|
-
source:
|
|
14
|
+
source: string;
|
|
13
15
|
params?: Record<string, string>;
|
|
14
16
|
body?: Record<string, string>;
|
|
15
17
|
}
|
|
16
|
-
export declare const
|
|
17
|
-
/**
|
|
18
|
-
* Search endpoints by keyword
|
|
19
|
-
*/
|
|
20
|
-
export declare function searchEndpoints(query: string): X402Endpoint[];
|
|
21
|
-
/**
|
|
22
|
-
* Get endpoints by source
|
|
23
|
-
*/
|
|
24
|
-
export declare function getEndpointsBySource(source: X402Source): X402Endpoint[];
|
|
18
|
+
export declare const STATIC_ENDPOINTS: X402Endpoint[];
|
|
25
19
|
/**
|
|
26
|
-
* Format endpoints for display
|
|
20
|
+
* Format endpoints for display, grouped by category and source.
|
|
27
21
|
*/
|
|
28
22
|
export declare function formatEndpointsTable(endpoints: X402Endpoint[]): string;
|
|
29
|
-
/**
|
|
30
|
-
* Get all unique categories
|
|
31
|
-
*/
|
|
32
|
-
export declare function getCategories(): string[];
|
|
33
|
-
/**
|
|
34
|
-
* Lookup an endpoint in the registry by method, path, and source URL.
|
|
35
|
-
* Used to determine if an endpoint is known-FREE or known-PAID before
|
|
36
|
-
* deciding whether to use a payment-capable client.
|
|
37
|
-
*
|
|
38
|
-
* Supports path patterns with placeholders like {address}, {messageId}, etc.
|
|
39
|
-
*/
|
|
40
|
-
export declare function lookupEndpoint(method: string, path: string, sourceUrl: string): X402Endpoint | undefined;
|
|
41
23
|
//# sourceMappingURL=registry.d.ts.map
|