@aibtc/mcp-server 1.71.0 → 1.72.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.
Files changed (123) hide show
  1. package/README.md +36 -3
  2. package/dist/bridge/index.js +2 -2
  3. package/dist/config/networks.js +4 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +118 -43
  6. package/dist/tools/arxiv-research.tools.d.ts +1 -1
  7. package/dist/tools/arxiv-research.tools.js +6 -6
  8. package/dist/tools/at-stake-legion.tools.d.ts +1 -1
  9. package/dist/tools/at-stake-legion.tools.js +14 -14
  10. package/dist/tools/at-stake.tools.d.ts +1 -1
  11. package/dist/tools/at-stake.tools.js +17 -17
  12. package/dist/tools/bitcoin.tools.d.ts +1 -1
  13. package/dist/tools/bitcoin.tools.js +12 -12
  14. package/dist/tools/bitflow.tools.d.ts +1 -1
  15. package/dist/tools/bitflow.tools.js +21 -21
  16. package/dist/tools/bns.tools.d.ts +1 -1
  17. package/dist/tools/bns.tools.js +18 -18
  18. package/dist/tools/bounty-hint.d.ts +1 -1
  19. package/dist/tools/bounty-scanner.tools.d.ts +1 -1
  20. package/dist/tools/bounty-scanner.tools.js +20 -20
  21. package/dist/tools/child-inscription.tools.d.ts +1 -1
  22. package/dist/tools/child-inscription.tools.js +6 -6
  23. package/dist/tools/competition.tools.d.ts +1 -1
  24. package/dist/tools/competition.tools.js +4 -4
  25. package/dist/tools/contract.tools.d.ts +1 -1
  26. package/dist/tools/contract.tools.js +8 -8
  27. package/dist/tools/credentials.tools.d.ts +1 -1
  28. package/dist/tools/credentials.tools.js +8 -8
  29. package/dist/tools/defi.tools.d.ts +1 -1
  30. package/dist/tools/defi.tools.js +21 -21
  31. package/dist/tools/dual-stacking.tools.d.ts +1 -1
  32. package/dist/tools/dual-stacking.tools.js +7 -7
  33. package/dist/tools/earning.tools.d.ts +1 -1
  34. package/dist/tools/earning.tools.js +2 -2
  35. package/dist/tools/endpoint.tools.d.ts +1 -1
  36. package/dist/tools/endpoint.tools.js +14 -13
  37. package/dist/tools/identity.tools.d.ts +1 -1
  38. package/dist/tools/identity.tools.js +19 -19
  39. package/dist/tools/inbox-x402.tools.d.ts +1 -1
  40. package/dist/tools/inbox-x402.tools.js +2 -2
  41. package/dist/tools/inbox.tools.d.ts +1 -1
  42. package/dist/tools/inbox.tools.js +2 -2
  43. package/dist/tools/index.d.ts +6 -3
  44. package/dist/tools/index.js +69 -58
  45. package/dist/tools/inference-marketplace.tools.d.ts +1 -1
  46. package/dist/tools/inference-marketplace.tools.js +10 -10
  47. package/dist/tools/jingswap.tools.d.ts +1 -1
  48. package/dist/tools/jingswap.tools.js +30 -30
  49. package/dist/tools/legion.tools.d.ts +1 -1
  50. package/dist/tools/legion.tools.js +20 -20
  51. package/dist/tools/lightning.tools.d.ts +1 -1
  52. package/dist/tools/lightning.tools.js +14 -14
  53. package/dist/tools/mempool.tools.d.ts +1 -1
  54. package/dist/tools/mempool.tools.js +5 -5
  55. package/dist/tools/news.tools.d.ts +1 -1
  56. package/dist/tools/news.tools.js +2 -1
  57. package/dist/tools/nft.tools.d.ts +1 -1
  58. package/dist/tools/nft.tools.js +12 -12
  59. package/dist/tools/nonce.tools.d.ts +1 -1
  60. package/dist/tools/nonce.tools.js +8 -8
  61. package/dist/tools/nostr.tools.d.ts +1 -1
  62. package/dist/tools/nostr.tools.js +12 -12
  63. package/dist/tools/openrouter.tools.d.ts +1 -1
  64. package/dist/tools/openrouter.tools.js +4 -4
  65. package/dist/tools/ordinals-marketplace.tools.d.ts +1 -1
  66. package/dist/tools/ordinals-marketplace.tools.js +10 -10
  67. package/dist/tools/ordinals-p2p.tools.d.ts +1 -1
  68. package/dist/tools/ordinals-p2p.tools.js +18 -18
  69. package/dist/tools/ordinals.tools.d.ts +1 -1
  70. package/dist/tools/ordinals.tools.js +8 -8
  71. package/dist/tools/pillar-direct.tools.d.ts +1 -1
  72. package/dist/tools/pillar-direct.tools.js +36 -36
  73. package/dist/tools/pillar.tools.d.ts +1 -1
  74. package/dist/tools/pillar.tools.js +28 -26
  75. package/dist/tools/profiles.d.ts +51 -0
  76. package/dist/tools/profiles.js +111 -0
  77. package/dist/tools/psbt.tools.d.ts +1 -1
  78. package/dist/tools/psbt.tools.js +8 -8
  79. package/dist/tools/query.tools.d.ts +1 -1
  80. package/dist/tools/query.tools.js +12 -12
  81. package/dist/tools/relay-diagnostic.tools.d.ts +1 -1
  82. package/dist/tools/relay-diagnostic.tools.js +3 -3
  83. package/dist/tools/reputation.tools.d.ts +1 -1
  84. package/dist/tools/reputation.tools.js +22 -22
  85. package/dist/tools/runes.tools.d.ts +1 -1
  86. package/dist/tools/runes.tools.js +18 -18
  87. package/dist/tools/sbtc.tools.d.ts +1 -1
  88. package/dist/tools/sbtc.tools.js +12 -12
  89. package/dist/tools/scaffold.tools.d.ts +1 -1
  90. package/dist/tools/scaffold.tools.js +4 -4
  91. package/dist/tools/settings.tools.d.ts +1 -1
  92. package/dist/tools/settings.tools.js +9 -9
  93. package/dist/tools/signing.tools.d.ts +1 -1
  94. package/dist/tools/signing.tools.js +20 -20
  95. package/dist/tools/souldinals.tools.d.ts +1 -1
  96. package/dist/tools/souldinals.tools.js +10 -10
  97. package/dist/tools/stacking-lottery.tools.d.ts +1 -1
  98. package/dist/tools/stacking-lottery.tools.js +11 -11
  99. package/dist/tools/stacking.tools.d.ts +1 -1
  100. package/dist/tools/stacking.tools.js +13 -13
  101. package/dist/tools/stacks-market.tools.d.ts +1 -1
  102. package/dist/tools/stacks-market.tools.js +22 -22
  103. package/dist/tools/styx.tools.d.ts +1 -1
  104. package/dist/tools/styx.tools.js +11 -11
  105. package/dist/tools/taproot-multisig.tools.d.ts +1 -1
  106. package/dist/tools/taproot-multisig.tools.js +5 -5
  107. package/dist/tools/tenero.tools.d.ts +1 -1
  108. package/dist/tools/tenero.tools.js +22 -22
  109. package/dist/tools/tokens.tools.d.ts +1 -1
  110. package/dist/tools/tokens.tools.js +10 -10
  111. package/dist/tools/transfer.tools.d.ts +1 -1
  112. package/dist/tools/transfer.tools.js +4 -4
  113. package/dist/tools/wallet-management.tools.d.ts +1 -1
  114. package/dist/tools/wallet-management.tools.js +16 -16
  115. package/dist/tools/wallet.tools.d.ts +1 -1
  116. package/dist/tools/wallet.tools.js +2 -2
  117. package/dist/tools/yield-dashboard.tools.d.ts +1 -1
  118. package/dist/tools/yield-dashboard.tools.js +5 -5
  119. package/dist/tools/yield-hunter.tools.d.ts +1 -1
  120. package/dist/tools/yield-hunter.tools.js +6 -6
  121. package/dist/utils/fee.js +1 -1
  122. package/package.json +7 -6
  123. package/skill/SKILL.md +1 -1
@@ -114,13 +114,13 @@ export function registerPillarDirectTools(server) {
114
114
  description: "Generate a new secp256k1 signing keypair for Pillar smart wallet direct operations. " +
115
115
  "Returns the compressed public key (33 bytes hex). " +
116
116
  "After generation, propose this pubkey on your smart wallet contract (admin must do this).",
117
- inputSchema: {
117
+ inputSchema: z.object({
118
118
  smartWallet: z
119
119
  .string()
120
120
  .default("pending")
121
121
  .describe("Smart wallet contract ID this key is for (e.g. SPV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RCJDC22.my-wallet). " +
122
122
  "Use 'pending' if creating a new wallet — pillar_direct_create_wallet will update it automatically."),
123
- },
123
+ }),
124
124
  }, async ({ smartWallet }) => {
125
125
  try {
126
126
  const keyService = getSigningKeyService();
@@ -141,12 +141,12 @@ export function registerPillarDirectTools(server) {
141
141
  server.registerTool("pillar_key_unlock", {
142
142
  description: "Unlock a signing key for Pillar direct operations. " +
143
143
  "Uses auto-derived password. Usually not needed — tools auto-unlock on first use.",
144
- inputSchema: {
144
+ inputSchema: z.object({
145
145
  keyId: z
146
146
  .string()
147
147
  .optional()
148
148
  .describe("The signing key ID to unlock. If omitted, unlocks the first stored key."),
149
- },
149
+ }),
150
150
  }, async ({ keyId }) => {
151
151
  try {
152
152
  const keyService = getSigningKeyService();
@@ -175,7 +175,7 @@ export function registerPillarDirectTools(server) {
175
175
  });
176
176
  server.registerTool("pillar_key_lock", {
177
177
  description: "Lock the signing key, clearing sensitive data from memory.",
178
- inputSchema: {},
178
+ inputSchema: z.object({}),
179
179
  }, async () => {
180
180
  try {
181
181
  const keyService = getSigningKeyService();
@@ -191,7 +191,7 @@ export function registerPillarDirectTools(server) {
191
191
  });
192
192
  server.registerTool("pillar_key_info", {
193
193
  description: "Show signing key info: pubkey, smart wallet, lock status, and all stored keys.",
194
- inputSchema: {},
194
+ inputSchema: z.object({}),
195
195
  }, async () => {
196
196
  try {
197
197
  const keyService = getSigningKeyService();
@@ -230,7 +230,7 @@ export function registerPillarDirectTools(server) {
230
230
  "Agent-signed, no browser needed. Your sBTC is supplied to Zest, borrowed against, " +
231
231
  "and re-supplied for amplified Bitcoin exposure. Backend sponsors gas. " +
232
232
  "For simple yield without leverage, use pillar_direct_supply instead.",
233
- inputSchema: {
233
+ inputSchema: z.object({
234
234
  sbtcAmount: z
235
235
  .number()
236
236
  .positive()
@@ -243,7 +243,7 @@ export function registerPillarDirectTools(server) {
243
243
  .number()
244
244
  .positive()
245
245
  .describe("Min sBTC from swap in sats (slippage protection)"),
246
- },
246
+ }),
247
247
  }, async ({ sbtcAmount, aeUsdcToBorrow, minSbtcFromSwap }) => {
248
248
  try {
249
249
  const { keyService, session } = await requireActiveKey();
@@ -280,7 +280,7 @@ export function registerPillarDirectTools(server) {
280
280
  server.registerTool("pillar_direct_unwind", {
281
281
  description: "Close or reduce your leveraged sBTC position. Agent-signed, no browser needed. " +
282
282
  "Swaps sBTC to aeUSDC to repay debt, then withdraws remaining sBTC collateral. Backend sponsors gas.",
283
- inputSchema: {
283
+ inputSchema: z.object({
284
284
  sbtcToSwap: z
285
285
  .number()
286
286
  .positive()
@@ -293,7 +293,7 @@ export function registerPillarDirectTools(server) {
293
293
  .number()
294
294
  .positive()
295
295
  .describe("Min aeUSDC from swap (slippage protection, 6 decimals)"),
296
- },
296
+ }),
297
297
  }, async ({ sbtcToSwap, sbtcToWithdraw, minAeUsdcFromSwap }) => {
298
298
  try {
299
299
  const { keyService, session } = await requireActiveKey();
@@ -332,12 +332,12 @@ export function registerPillarDirectTools(server) {
332
332
  description: "Earn yield on your Bitcoin. Supply sBTC from your Pillar smart wallet to Zest Protocol. " +
333
333
  "No leverage, no liquidation risk. Agent-signed, no browser needed. Backend sponsors gas. " +
334
334
  "For leveraged exposure (1.5x), use pillar_direct_boost instead.",
335
- inputSchema: {
335
+ inputSchema: z.object({
336
336
  sbtcAmount: z
337
337
  .number()
338
338
  .positive()
339
339
  .describe("sBTC amount in sats to supply"),
340
- },
340
+ }),
341
341
  }, async ({ sbtcAmount }) => {
342
342
  try {
343
343
  const { keyService, session } = await requireActiveKey();
@@ -372,7 +372,7 @@ export function registerPillarDirectTools(server) {
372
372
  description: "Send sBTC from your Pillar smart wallet to a recipient. " +
373
373
  "Agent-signed, no browser needed. Supports BNS names, wallet names, or Stacks addresses. " +
374
374
  "Backend sponsors gas.",
375
- inputSchema: {
375
+ inputSchema: z.object({
376
376
  to: z
377
377
  .string()
378
378
  .describe("Recipient: BNS name (muneeb.btc), Pillar wallet name, or Stacks address (SP...)"),
@@ -384,7 +384,7 @@ export function registerPillarDirectTools(server) {
384
384
  .enum(["bns", "wallet", "address"])
385
385
  .default("bns")
386
386
  .describe("Type of recipient: 'bns' (default), 'wallet', or 'address'"),
387
- },
387
+ }),
388
388
  }, async ({ to, amount, recipientType }) => {
389
389
  try {
390
390
  const { keyService, session } = await requireActiveKey();
@@ -450,7 +450,7 @@ export function registerPillarDirectTools(server) {
450
450
  description: "Configure auto-compound for your Pillar wallet. " +
451
451
  "When enabled, a keeper automatically boosts when sBTC accumulates above the trigger. " +
452
452
  "Agent-signed, no browser needed. Backend sponsors gas.",
453
- inputSchema: {
453
+ inputSchema: z.object({
454
454
  enabled: z.boolean().describe("Enable or disable auto-compound"),
455
455
  minSbtc: z
456
456
  .number()
@@ -460,7 +460,7 @@ export function registerPillarDirectTools(server) {
460
460
  .number()
461
461
  .positive()
462
462
  .describe("sBTC amount above minimum that triggers auto-compound (in sats)"),
463
- },
463
+ }),
464
464
  }, async ({ enabled, minSbtc, trigger }) => {
465
465
  try {
466
466
  const { keyService, session } = await requireActiveKey();
@@ -498,7 +498,7 @@ export function registerPillarDirectTools(server) {
498
498
  server.registerTool("pillar_direct_position", {
499
499
  description: "View your Pillar smart wallet balances (STX, sBTC, aeUSDC) and Zest position. " +
500
500
  "No signing needed — reads on-chain data.",
501
- inputSchema: {},
501
+ inputSchema: z.object({}),
502
502
  }, async () => {
503
503
  try {
504
504
  const { session } = await requireActiveKey();
@@ -599,12 +599,12 @@ export function registerPillarDirectTools(server) {
599
599
  server.registerTool("pillar_direct_withdraw_collateral", {
600
600
  description: "Withdraw sBTC collateral from Zest on the Pillar smart wallet. " +
601
601
  "Agent-signed, no browser needed. Backend sponsors gas.",
602
- inputSchema: {
602
+ inputSchema: z.object({
603
603
  sbtcAmount: z
604
604
  .number()
605
605
  .positive()
606
606
  .describe("sBTC amount in sats to withdraw"),
607
- },
607
+ }),
608
608
  }, async ({ sbtcAmount }) => {
609
609
  try {
610
610
  const { keyService, session } = await requireActiveKey();
@@ -638,11 +638,11 @@ export function registerPillarDirectTools(server) {
638
638
  description: "Add a backup admin address to your Pillar smart wallet for recovery purposes. " +
639
639
  "Agent-signed, no browser needed. The admin can help recover funds if you lose access to your passkey. " +
640
640
  "Backend sponsors gas.",
641
- inputSchema: {
641
+ inputSchema: z.object({
642
642
  newAdmin: z
643
643
  .string()
644
644
  .describe("Stacks address (SP...) to add as backup admin"),
645
- },
645
+ }),
646
646
  }, async ({ newAdmin }) => {
647
647
  try {
648
648
  const { keyService, session } = await requireActiveKey();
@@ -681,7 +681,7 @@ export function registerPillarDirectTools(server) {
681
681
  "and deploys a new smart wallet with the pubkey registered. " +
682
682
  "Backend deploys the contract and calls onboard() in background. " +
683
683
  "After ~20-30 seconds the wallet is ready for pillar_direct_* operations.",
684
- inputSchema: {
684
+ inputSchema: z.object({
685
685
  walletName: z
686
686
  .string()
687
687
  .min(3)
@@ -693,7 +693,7 @@ export function registerPillarDirectTools(server) {
693
693
  .default("SPV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RCJDC22.beta-v2-wallet")
694
694
  .describe("Contract address of the referring wallet. " +
695
695
  "Defaults to the Pillar team wallet if not provided."),
696
- },
696
+ }),
697
697
  }, async ({ walletName, referredBy }) => {
698
698
  try {
699
699
  const api = getPillarApi();
@@ -759,11 +759,11 @@ export function registerPillarDirectTools(server) {
759
759
  server.registerTool("pillar_direct_dca_invite", {
760
760
  description: "Invite a DCA partner by email or wallet address. " +
761
761
  "DCA partners hold each other accountable — both must boost each week to keep the streak alive.",
762
- inputSchema: {
762
+ inputSchema: z.object({
763
763
  partner: z
764
764
  .string()
765
765
  .describe("Partner's email address or Stacks wallet address (SP...)"),
766
- },
766
+ }),
767
767
  }, async ({ partner }) => {
768
768
  try {
769
769
  const { session } = await requireActiveKey();
@@ -793,7 +793,7 @@ export function registerPillarDirectTools(server) {
793
793
  server.registerTool("pillar_direct_dca_partners", {
794
794
  description: "View your DCA partners and weekly status. " +
795
795
  "Shows active partnerships with streak, PnL, and weekly status badges, plus any pending invites.",
796
- inputSchema: {},
796
+ inputSchema: z.object({}),
797
797
  }, async () => {
798
798
  try {
799
799
  const { session } = await requireActiveKey();
@@ -831,7 +831,7 @@ export function registerPillarDirectTools(server) {
831
831
  // --- pillar_direct_dca_leaderboard (twin of pillar_dca_leaderboard) ---
832
832
  server.registerTool("pillar_direct_dca_leaderboard", {
833
833
  description: "View the DCA streak leaderboard. Shows top partnerships by streak length, and highlights your entry if you have one.",
834
- inputSchema: {},
834
+ inputSchema: z.object({}),
835
835
  }, async () => {
836
836
  try {
837
837
  const { session } = await requireActiveKey();
@@ -869,7 +869,7 @@ export function registerPillarDirectTools(server) {
869
869
  server.registerTool("pillar_direct_dca_status", {
870
870
  description: "Check your DCA schedule status. Shows all active DCA schedules (up to 10) with chunk progress " +
871
871
  "(completed, pending, failed) and next execution time.",
872
- inputSchema: {},
872
+ inputSchema: z.object({}),
873
873
  }, async () => {
874
874
  try {
875
875
  const { session } = await requireActiveKey();
@@ -960,12 +960,12 @@ export function registerPillarDirectTools(server) {
960
960
  server.registerTool("pillar_direct_quote", {
961
961
  description: "Get a boost quote showing projected leverage, LTV, and swap details. " +
962
962
  "No signing needed. Use this to determine aeUsdcToBorrow and minSbtcFromSwap before calling pillar_direct_boost.",
963
- inputSchema: {
963
+ inputSchema: z.object({
964
964
  sbtcAmount: z
965
965
  .number()
966
966
  .positive()
967
967
  .describe("sBTC amount in sats to boost"),
968
- },
968
+ }),
969
969
  }, async ({ sbtcAmount }) => {
970
970
  try {
971
971
  const api = getPillarApi();
@@ -985,7 +985,7 @@ export function registerPillarDirectTools(server) {
985
985
  description: "Resolve a recipient before sending. Resolves BNS names (.btc) via backend, " +
986
986
  "Pillar wallet names via backend, or validates a Stacks address. " +
987
987
  "Use this BEFORE pillar_direct_send to confirm the resolved address with the user.",
988
- inputSchema: {
988
+ inputSchema: z.object({
989
989
  to: z
990
990
  .string()
991
991
  .describe("Recipient: BNS name (muneeb.btc), Pillar wallet name, or Stacks address (SP...)"),
@@ -993,7 +993,7 @@ export function registerPillarDirectTools(server) {
993
993
  .enum(["bns", "wallet", "address"])
994
994
  .default("bns")
995
995
  .describe("Type of recipient: 'bns' (default), 'wallet', or 'address'"),
996
- },
996
+ }),
997
997
  }, async ({ to, recipientType }) => {
998
998
  try {
999
999
  const api = getPillarApi();
@@ -1060,7 +1060,7 @@ export function registerPillarDirectTools(server) {
1060
1060
  "pox-4 is not the active PoX contract (PoX-5 is live; use stack_stx for PoX-5 staking). " +
1061
1061
  "Stacking DAO deposits STX into Stacking DAO core for stSTX yield. " +
1062
1062
  "Your wallet must be enrolled in dual stacking first (automatic for v2 wallets with sBTC).",
1063
- inputSchema: {
1063
+ inputSchema: z.object({
1064
1064
  stxAmount: z
1065
1065
  .number()
1066
1066
  .positive()
@@ -1069,7 +1069,7 @@ export function registerPillarDirectTools(server) {
1069
1069
  .enum(["fast-pool", "stacking-dao"])
1070
1070
  .describe("Stacking pool to use: 'fast-pool' (delegates to pox4-fast-pool-v3) " +
1071
1071
  "or 'stacking-dao' (deposits into Stacking DAO for stSTX)"),
1072
- },
1072
+ }),
1073
1073
  }, async ({ stxAmount, pool }) => {
1074
1074
  try {
1075
1075
  if (pool === "fast-pool") {
@@ -1122,7 +1122,7 @@ export function registerPillarDirectTools(server) {
1122
1122
  "refused while pox-4 is not the active PoX contract). " +
1123
1123
  "Agent-signed, no browser needed. Backend sponsors gas. " +
1124
1124
  "After revoking, STX stays locked until the current PoX cycle ends, then returns to liquid.",
1125
- inputSchema: {},
1125
+ inputSchema: z.object({}),
1126
1126
  }, async () => {
1127
1127
  try {
1128
1128
  await assertFastPoolPoxActive("Revoking Fast Pool");
@@ -1159,7 +1159,7 @@ export function registerPillarDirectTools(server) {
1159
1159
  "No signing needed — reads on-chain data. " +
1160
1160
  "Shows STX balance (locked vs liquid), current PoX cycle info, " +
1161
1161
  "and dual stacking enrollment status.",
1162
- inputSchema: {},
1162
+ inputSchema: z.object({}),
1163
1163
  }, async () => {
1164
1164
  try {
1165
1165
  const { session } = await requireActiveKey();
@@ -1,3 +1,3 @@
1
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
1
+ import { McpServer } from "@modelcontextprotocol/server";
2
2
  export declare function registerPillarTools(server: McpServer): void;
3
3
  //# sourceMappingURL=pillar.tools.d.ts.map
@@ -1,3 +1,5 @@
1
+ // Pillar MCP Tools - Handoff model
2
+ // MCP creates intent → Opens frontend → Frontend handles signing → MCP polls for result
1
3
  import { z } from "zod";
2
4
  import { getPillarApi } from "../services/pillar-api.service.js";
3
5
  import { createJsonResponse, createErrorResponse } from "../utils/index.js";
@@ -89,7 +91,7 @@ export function registerPillarTools(server) {
89
91
  server.registerTool("pillar_connect", {
90
92
  description: "Connect to your Pillar smart wallet. Opens the Pillar website - if you're logged in, " +
91
93
  "it will automatically connect and return your wallet address. Use this first before other Pillar actions.",
92
- inputSchema: {},
94
+ inputSchema: z.object({}),
93
95
  }, async () => {
94
96
  try {
95
97
  const api = getPillarApi();
@@ -143,7 +145,7 @@ export function registerPillarTools(server) {
143
145
  // Tool 2: Disconnect from Pillar
144
146
  server.registerTool("pillar_disconnect", {
145
147
  description: "Disconnect from Pillar. Clears locally stored wallet address.",
146
- inputSchema: {},
148
+ inputSchema: z.object({}),
147
149
  }, async () => {
148
150
  const session = await loadSession();
149
151
  await clearSession();
@@ -157,7 +159,7 @@ export function registerPillarTools(server) {
157
159
  // Tool 3: Get Pillar connection status
158
160
  server.registerTool("pillar_status", {
159
161
  description: "Check if you're connected to Pillar and get your wallet address.",
160
- inputSchema: {},
162
+ inputSchema: z.object({}),
161
163
  }, async () => {
162
164
  const session = await loadSession();
163
165
  if (session) {
@@ -178,11 +180,11 @@ export function registerPillarTools(server) {
178
180
  description: "Send sBTC from your Pillar smart wallet. Requires being connected first (use pillar_connect). " +
179
181
  "Opens the frontend for signing, then waits for confirmation. " +
180
182
  "Supports three recipient types: 'bns' for BNS names (muneeb.btc), 'wallet' for Pillar wallet names (iphone), 'address' for Stacks addresses (SP...).",
181
- inputSchema: {
183
+ inputSchema: z.object({
182
184
  to: z.string().describe("Recipient: BNS name (muneeb.btc), Pillar wallet name (iphone), or Stacks address (SP...)"),
183
185
  amount: z.number().positive().describe("Amount in satoshis"),
184
186
  recipientType: z.enum(["bns", "wallet", "address"]).optional().describe("Type of recipient: 'bns' (default), 'wallet' for Pillar smart wallets, or 'address' for raw Stacks addresses"),
185
- },
187
+ }),
186
188
  }, async ({ to, amount, recipientType }) => {
187
189
  try {
188
190
  // Get wallet address from session
@@ -249,10 +251,10 @@ export function registerPillarTools(server) {
249
251
  "- 'btc': Deposit BTC from your Leather/Xverse wallet - auto-converts to sBTC\n" +
250
252
  "- 'sbtc': Deposit sBTC directly from your Leather/Xverse wallet\n" +
251
253
  "Opens the frontend with the appropriate deposit flow.",
252
- inputSchema: {
254
+ inputSchema: z.object({
253
255
  method: z.enum(["exchange", "btc", "sbtc"]).describe("Funding method: 'exchange' (deposit from Coinbase/Binance), 'btc' (from Leather/Xverse BTC), 'sbtc' (from Leather/Xverse sBTC)"),
254
256
  amount: z.number().positive().optional().describe("Amount in satoshis to deposit (optional, can be set in UI)"),
255
- },
257
+ }),
256
258
  }, async ({ method, amount }) => {
257
259
  try {
258
260
  const session = await loadSession();
@@ -300,9 +302,9 @@ export function registerPillarTools(server) {
300
302
  server.registerTool("pillar_add_admin", {
301
303
  description: "Add a backup admin address to your Pillar smart wallet for recovery purposes. " +
302
304
  "The admin can help recover funds if you lose access to your passkey.",
303
- inputSchema: {
305
+ inputSchema: z.object({
304
306
  adminAddress: z.string().optional().describe("Stacks address (SP...) to add as backup admin (can be set in UI)"),
305
- },
307
+ }),
306
308
  }, async ({ adminAddress }) => {
307
309
  try {
308
310
  const session = await loadSession();
@@ -346,9 +348,9 @@ export function registerPillarTools(server) {
346
348
  description: "Earn yield on your Bitcoin. Supply sBTC from your Pillar smart wallet to Zest Protocol. " +
347
349
  "Your sBTC earns interest with no leverage and no liquidation risk. " +
348
350
  "This is the simplest way to earn on Pillar (Earn tab). For leveraged exposure, use pillar_boost instead.",
349
- inputSchema: {
351
+ inputSchema: z.object({
350
352
  amount: z.number().positive().optional().describe("Amount in satoshis to supply (optional, can be set in UI)"),
351
- },
353
+ }),
352
354
  }, async ({ amount }) => {
353
355
  try {
354
356
  const session = await loadSession();
@@ -391,10 +393,10 @@ export function registerPillarTools(server) {
391
393
  server.registerTool("pillar_auto_compound", {
392
394
  description: "Configure auto-compound for your Pillar wallet. " +
393
395
  "When enabled, a keeper will automatically boost your position when sBTC accumulates in your wallet.",
394
- inputSchema: {
396
+ inputSchema: z.object({
395
397
  minSbtc: z.number().nonnegative().optional().describe("Minimum sBTC to keep in wallet (in sats)"),
396
398
  trigger: z.number().positive().optional().describe("Amount above minimum that triggers auto-compound (in sats)"),
397
- },
399
+ }),
398
400
  }, async ({ minSbtc, trigger }) => {
399
401
  try {
400
402
  const session = await loadSession();
@@ -435,9 +437,9 @@ export function registerPillarTools(server) {
435
437
  server.registerTool("pillar_unwind", {
436
438
  description: "Close or reduce your leveraged sBTC position. " +
437
439
  "Opens a modal to repay borrowed sBTC and withdraw collateral back to your wallet.",
438
- inputSchema: {
440
+ inputSchema: z.object({
439
441
  percentage: z.number().min(1).max(100).optional().describe("Percentage of position to unwind (1-100, optional, can be set in UI)"),
440
- },
442
+ }),
441
443
  }, async ({ percentage }) => {
442
444
  try {
443
445
  const session = await loadSession();
@@ -484,9 +486,9 @@ export function registerPillarTools(server) {
484
486
  "For simple yield without leverage, use pillar_supply (Earn) instead. " +
485
487
  "Amounts over 100,000 sats automatically enter DCA mode -- split into daily 100k-sat chunks " +
486
488
  "(max 700k sats per schedule). The first chunk executes immediately, the rest follow daily.",
487
- inputSchema: {
489
+ inputSchema: z.object({
488
490
  amount: z.number().positive().optional().describe("Amount in satoshis to boost (optional, shown as suggestion)"),
489
- },
491
+ }),
490
492
  }, async ({ amount }) => {
491
493
  try {
492
494
  const session = await loadSession();
@@ -529,7 +531,7 @@ export function registerPillarTools(server) {
529
531
  server.registerTool("pillar_position", {
530
532
  description: "View your Pillar wallet balance and Zest position. " +
531
533
  "Opens the Position page in the browser AND returns the data (sBTC balance, collateral, borrowed, LTV, liquidation price).",
532
- inputSchema: {},
534
+ inputSchema: z.object({}),
533
535
  }, async () => {
534
536
  try {
535
537
  const session = await loadSession();
@@ -606,9 +608,9 @@ export function registerPillarTools(server) {
606
608
  description: "Create a new Pillar smart wallet. Opens the Pillar website to complete registration. " +
607
609
  "You'll need to enter your email to receive updates. " +
608
610
  "If the user doesn't have a referral link, tell them they can DM @pillar_btc on X (https://x.com/pillar_btc) to request one before signing up.",
609
- inputSchema: {
611
+ inputSchema: z.object({
610
612
  referral: z.string().optional().describe("Referral wallet address (optional, defaults to MCP referral)"),
611
- },
613
+ }),
612
614
  }, async ({ referral }) => {
613
615
  try {
614
616
  // Check if already connected
@@ -662,7 +664,7 @@ export function registerPillarTools(server) {
662
664
  // Tool 13: Get referral/invite link
663
665
  server.registerTool("pillar_invite", {
664
666
  description: "Get your Pillar referral link to invite friends. Share this link and earn rewards when friends sign up.",
665
- inputSchema: {},
667
+ inputSchema: z.object({}),
666
668
  }, async () => {
667
669
  try {
668
670
  const session = await loadSession();
@@ -688,9 +690,9 @@ export function registerPillarTools(server) {
688
690
  server.registerTool("pillar_dca_invite", {
689
691
  description: "Invite a DCA partner by email or wallet address. " +
690
692
  "DCA partners hold each other accountable — both must boost each week to keep the streak alive.",
691
- inputSchema: {
693
+ inputSchema: z.object({
692
694
  partner: z.string().describe("Partner's email address or Stacks wallet address (SP...)"),
693
- },
695
+ }),
694
696
  }, async ({ partner }) => {
695
697
  try {
696
698
  const session = await loadSession();
@@ -724,7 +726,7 @@ export function registerPillarTools(server) {
724
726
  server.registerTool("pillar_dca_partners", {
725
727
  description: "View your DCA partners and weekly status. " +
726
728
  "Shows active partnerships with streak, PnL, and weekly status badges, plus any pending invites.",
727
- inputSchema: {},
729
+ inputSchema: z.object({}),
728
730
  }, async () => {
729
731
  try {
730
732
  const session = await loadSession();
@@ -766,7 +768,7 @@ export function registerPillarTools(server) {
766
768
  // Tool 16: DCA streak leaderboard (direct API)
767
769
  server.registerTool("pillar_dca_leaderboard", {
768
770
  description: "View the DCA streak leaderboard. Shows top partnerships by streak length, and highlights your entry if you have one.",
769
- inputSchema: {},
771
+ inputSchema: z.object({}),
770
772
  }, async () => {
771
773
  try {
772
774
  const session = await loadSession();
@@ -806,7 +808,7 @@ export function registerPillarTools(server) {
806
808
  server.registerTool("pillar_dca_status", {
807
809
  description: "Check your DCA schedule status. Shows all active DCA schedules (up to 10) with chunk progress " +
808
810
  "(completed, pending, failed) and next execution time.",
809
- inputSchema: {},
811
+ inputSchema: z.object({}),
810
812
  }, async () => {
811
813
  try {
812
814
  const session = await loadSession();
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Tool profiles: which tools the server exposes.
3
+ *
4
+ * Every tool definition is sent to the client's model on each session, so
5
+ * `--install` writes `AIBTC_TOOLS=core`: a lean set covering wallet, balances,
6
+ * transfers, x402 and earning. Other groups are added with
7
+ * `AIBTC_TOOLS=core,defi,ordinals` (the core set is always included).
8
+ *
9
+ * An unset AIBTC_TOOLS loads every tool: configs written before profiles
10
+ * existed have no AIBTC_TOOLS, and their users keep the tools they had.
11
+ */
12
+ /** Tools exposed by default, whatever groups are enabled. */
13
+ export declare const CORE_TOOLS: ReadonlySet<string>;
14
+ export declare const TOOL_GROUPS: {
15
+ readonly wallet: "Wallet management extras, encrypted credential store";
16
+ readonly stacks: "Stacks transactions, contracts, tokens, NFTs, chain queries, nonce tools";
17
+ readonly sbtc: "sBTC deposit/withdraw, Styx BTC→sBTC";
18
+ readonly bitcoin: "Bitcoin L1 UTXOs, mempool watch";
19
+ readonly lightning: "Lightning (Spark) wallet and L402 payments";
20
+ readonly stacking: "PoX stacking, dual stacking, StackSpot";
21
+ readonly defi: "ALEX, Zest, Bitflow, Jingswap, yield hunter/dashboard, Tenero analytics";
22
+ readonly pillar: "Pillar smart wallet";
23
+ readonly ordinals: "Inscriptions, runes, PSBT, ordinals marketplace/P2P, taproot multisig";
24
+ readonly bns: "BNS names";
25
+ readonly identity: "ERC-8004 identity and reputation, message signing";
26
+ readonly social: "Nostr, AIBTC inbox";
27
+ readonly earn: "Bounty board (create, accept, pay, my views)";
28
+ readonly legion: "AIBTC News Legion";
29
+ readonly markets: "Stacks prediction market, At Stake";
30
+ readonly dev: "Scaffolding, OpenRouter, settings, inference marketplace, arXiv";
31
+ };
32
+ export type ToolGroup = keyof typeof TOOL_GROUPS;
33
+ /** Which tools to expose: every tool, or the core set plus the named groups. */
34
+ export type ToolSelection = {
35
+ all: true;
36
+ } | {
37
+ all: false;
38
+ groups: ReadonlySet<ToolGroup>;
39
+ };
40
+ export declare const ALL_TOOLS: ToolSelection;
41
+ export declare function isToolGroup(name: string): name is ToolGroup;
42
+ export declare function isToolSelected(selection: ToolSelection, name: string, group: ToolGroup): boolean;
43
+ /**
44
+ * Resolve the selection from `--profile <lean|full>` and `AIBTC_TOOLS`
45
+ * (`all`, or `core` and/or comma-separated group names; unset means `all`).
46
+ * Unknown values throw so a typo doesn't silently hide tools.
47
+ */
48
+ export declare function resolveToolSelection(argv?: readonly string[], env?: NodeJS.ProcessEnv): ToolSelection;
49
+ /** Server-instructions paragraph telling the agent what is off and how to turn it on. */
50
+ export declare function describeSelection(selection: ToolSelection): string;
51
+ //# sourceMappingURL=profiles.d.ts.map
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Tool profiles: which tools the server exposes.
3
+ *
4
+ * Every tool definition is sent to the client's model on each session, so
5
+ * `--install` writes `AIBTC_TOOLS=core`: a lean set covering wallet, balances,
6
+ * transfers, x402 and earning. Other groups are added with
7
+ * `AIBTC_TOOLS=core,defi,ordinals` (the core set is always included).
8
+ *
9
+ * An unset AIBTC_TOOLS loads every tool: configs written before profiles
10
+ * existed have no AIBTC_TOOLS, and their users keep the tools they had.
11
+ */
12
+ /** Tools exposed by default, whatever groups are enabled. */
13
+ export const CORE_TOOLS = new Set([
14
+ // Wallet
15
+ "get_wallet_info",
16
+ "wallet_status",
17
+ "wallet_create",
18
+ "wallet_import",
19
+ "wallet_unlock",
20
+ "wallet_lock",
21
+ "wallet_export",
22
+ "wallet_rotate_password",
23
+ // Balances
24
+ "get_stx_balance",
25
+ "get_btc_balance",
26
+ "sbtc_get_balance",
27
+ "get_token_balance",
28
+ // Move funds
29
+ "transfer_stx",
30
+ "transfer_btc",
31
+ "sbtc_transfer",
32
+ "get_transaction_status",
33
+ "get_btc_fees",
34
+ // x402
35
+ "list_x402_endpoints",
36
+ "probe_x402_endpoint",
37
+ "execute_x402_endpoint",
38
+ // Earn (bounty_submit requires a registered identity)
39
+ "earning_opportunities",
40
+ "bounty_list",
41
+ "bounty_get",
42
+ "bounty_submit",
43
+ "identity_register",
44
+ ]);
45
+ export const TOOL_GROUPS = {
46
+ wallet: "Wallet management extras, encrypted credential store",
47
+ stacks: "Stacks transactions, contracts, tokens, NFTs, chain queries, nonce tools",
48
+ sbtc: "sBTC deposit/withdraw, Styx BTC→sBTC",
49
+ bitcoin: "Bitcoin L1 UTXOs, mempool watch",
50
+ lightning: "Lightning (Spark) wallet and L402 payments",
51
+ stacking: "PoX stacking, dual stacking, StackSpot",
52
+ defi: "ALEX, Zest, Bitflow, Jingswap, yield hunter/dashboard, Tenero analytics",
53
+ pillar: "Pillar smart wallet",
54
+ ordinals: "Inscriptions, runes, PSBT, ordinals marketplace/P2P, taproot multisig",
55
+ bns: "BNS names",
56
+ identity: "ERC-8004 identity and reputation, message signing",
57
+ social: "Nostr, AIBTC inbox",
58
+ earn: "Bounty board (create, accept, pay, my views)",
59
+ legion: "AIBTC News Legion",
60
+ markets: "Stacks prediction market, At Stake",
61
+ dev: "Scaffolding, OpenRouter, settings, inference marketplace, arXiv",
62
+ };
63
+ export const ALL_TOOLS = { all: true };
64
+ export function isToolGroup(name) {
65
+ return Object.prototype.hasOwnProperty.call(TOOL_GROUPS, name);
66
+ }
67
+ export function isToolSelected(selection, name, group) {
68
+ return selection.all || CORE_TOOLS.has(name) || selection.groups.has(group);
69
+ }
70
+ /**
71
+ * Resolve the selection from `--profile <lean|full>` and `AIBTC_TOOLS`
72
+ * (`all`, or `core` and/or comma-separated group names; unset means `all`).
73
+ * Unknown values throw so a typo doesn't silently hide tools.
74
+ */
75
+ export function resolveToolSelection(argv = process.argv, env = process.env) {
76
+ const flag = argv.indexOf("--profile");
77
+ const profile = flag === -1 ? undefined : argv[flag + 1];
78
+ if (profile !== undefined && profile !== "lean" && profile !== "full") {
79
+ throw new Error(`Unknown --profile "${profile}". Use "lean" or "full".`);
80
+ }
81
+ if (profile === "full")
82
+ return ALL_TOOLS;
83
+ if (profile === "lean")
84
+ return { all: false, groups: new Set() };
85
+ const names = (env.AIBTC_TOOLS ?? "all")
86
+ .split(",")
87
+ .map((s) => s.trim().toLowerCase())
88
+ .filter((n) => n && n !== "core");
89
+ if (names.includes("all"))
90
+ return ALL_TOOLS;
91
+ const unknown = names.filter((n) => !isToolGroup(n));
92
+ if (unknown.length > 0) {
93
+ throw new Error(`Unknown AIBTC_TOOLS group(s): ${unknown.join(", ")}. ` +
94
+ `Valid: all, core, ${Object.keys(TOOL_GROUPS).join(", ")}.`);
95
+ }
96
+ return { all: false, groups: new Set(names) };
97
+ }
98
+ /** Server-instructions paragraph telling the agent what is off and how to turn it on. */
99
+ export function describeSelection(selection) {
100
+ if (selection.all)
101
+ return "All tool groups are enabled.";
102
+ const off = Object.keys(TOOL_GROUPS).filter((g) => !selection.groups.has(g));
103
+ const on = [...selection.groups];
104
+ return [
105
+ `Tool profile: lean core${on.length > 0 ? ` + ${on.join(", ")}` : ""}.`,
106
+ "These groups are not loaded; if the user needs one, tell them to set",
107
+ "AIBTC_TOOLS=core,<group,...> (or all) in this server's config and restart:",
108
+ ...off.map((g) => `- ${g}: ${TOOL_GROUPS[g]}`),
109
+ ].join("\n");
110
+ }
111
+ //# sourceMappingURL=profiles.js.map
@@ -1,3 +1,3 @@
1
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
1
+ import { McpServer } from "@modelcontextprotocol/server";
2
2
  export declare function registerPsbtTools(server: McpServer): void;
3
3
  //# sourceMappingURL=psbt.tools.d.ts.map