@aibtc/mcp-server 1.71.0 → 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.
Files changed (122) 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.js +118 -42
  5. package/dist/tools/arxiv-research.tools.d.ts +1 -1
  6. package/dist/tools/arxiv-research.tools.js +6 -6
  7. package/dist/tools/at-stake-legion.tools.d.ts +1 -1
  8. package/dist/tools/at-stake-legion.tools.js +14 -14
  9. package/dist/tools/at-stake.tools.d.ts +1 -1
  10. package/dist/tools/at-stake.tools.js +17 -17
  11. package/dist/tools/bitcoin.tools.d.ts +1 -1
  12. package/dist/tools/bitcoin.tools.js +12 -12
  13. package/dist/tools/bitflow.tools.d.ts +1 -1
  14. package/dist/tools/bitflow.tools.js +21 -21
  15. package/dist/tools/bns.tools.d.ts +1 -1
  16. package/dist/tools/bns.tools.js +18 -18
  17. package/dist/tools/bounty-hint.d.ts +1 -1
  18. package/dist/tools/bounty-scanner.tools.d.ts +1 -1
  19. package/dist/tools/bounty-scanner.tools.js +20 -20
  20. package/dist/tools/child-inscription.tools.d.ts +1 -1
  21. package/dist/tools/child-inscription.tools.js +6 -6
  22. package/dist/tools/competition.tools.d.ts +1 -1
  23. package/dist/tools/competition.tools.js +4 -4
  24. package/dist/tools/contract.tools.d.ts +1 -1
  25. package/dist/tools/contract.tools.js +8 -8
  26. package/dist/tools/credentials.tools.d.ts +1 -1
  27. package/dist/tools/credentials.tools.js +8 -8
  28. package/dist/tools/defi.tools.d.ts +1 -1
  29. package/dist/tools/defi.tools.js +21 -21
  30. package/dist/tools/dual-stacking.tools.d.ts +1 -1
  31. package/dist/tools/dual-stacking.tools.js +7 -7
  32. package/dist/tools/earning.tools.d.ts +1 -1
  33. package/dist/tools/earning.tools.js +2 -2
  34. package/dist/tools/endpoint.tools.d.ts +1 -1
  35. package/dist/tools/endpoint.tools.js +14 -13
  36. package/dist/tools/identity.tools.d.ts +1 -1
  37. package/dist/tools/identity.tools.js +19 -19
  38. package/dist/tools/inbox-x402.tools.d.ts +1 -1
  39. package/dist/tools/inbox-x402.tools.js +2 -2
  40. package/dist/tools/inbox.tools.d.ts +1 -1
  41. package/dist/tools/inbox.tools.js +2 -2
  42. package/dist/tools/index.d.ts +6 -3
  43. package/dist/tools/index.js +69 -58
  44. package/dist/tools/inference-marketplace.tools.d.ts +1 -1
  45. package/dist/tools/inference-marketplace.tools.js +10 -10
  46. package/dist/tools/jingswap.tools.d.ts +1 -1
  47. package/dist/tools/jingswap.tools.js +30 -30
  48. package/dist/tools/legion.tools.d.ts +1 -1
  49. package/dist/tools/legion.tools.js +20 -20
  50. package/dist/tools/lightning.tools.d.ts +1 -1
  51. package/dist/tools/lightning.tools.js +14 -14
  52. package/dist/tools/mempool.tools.d.ts +1 -1
  53. package/dist/tools/mempool.tools.js +5 -5
  54. package/dist/tools/news.tools.d.ts +1 -1
  55. package/dist/tools/news.tools.js +2 -1
  56. package/dist/tools/nft.tools.d.ts +1 -1
  57. package/dist/tools/nft.tools.js +12 -12
  58. package/dist/tools/nonce.tools.d.ts +1 -1
  59. package/dist/tools/nonce.tools.js +8 -8
  60. package/dist/tools/nostr.tools.d.ts +1 -1
  61. package/dist/tools/nostr.tools.js +12 -12
  62. package/dist/tools/openrouter.tools.d.ts +1 -1
  63. package/dist/tools/openrouter.tools.js +4 -4
  64. package/dist/tools/ordinals-marketplace.tools.d.ts +1 -1
  65. package/dist/tools/ordinals-marketplace.tools.js +10 -10
  66. package/dist/tools/ordinals-p2p.tools.d.ts +1 -1
  67. package/dist/tools/ordinals-p2p.tools.js +18 -18
  68. package/dist/tools/ordinals.tools.d.ts +1 -1
  69. package/dist/tools/ordinals.tools.js +8 -8
  70. package/dist/tools/pillar-direct.tools.d.ts +1 -1
  71. package/dist/tools/pillar-direct.tools.js +36 -36
  72. package/dist/tools/pillar.tools.d.ts +1 -1
  73. package/dist/tools/pillar.tools.js +28 -26
  74. package/dist/tools/profiles.d.ts +51 -0
  75. package/dist/tools/profiles.js +111 -0
  76. package/dist/tools/psbt.tools.d.ts +1 -1
  77. package/dist/tools/psbt.tools.js +8 -8
  78. package/dist/tools/query.tools.d.ts +1 -1
  79. package/dist/tools/query.tools.js +12 -12
  80. package/dist/tools/relay-diagnostic.tools.d.ts +1 -1
  81. package/dist/tools/relay-diagnostic.tools.js +3 -3
  82. package/dist/tools/reputation.tools.d.ts +1 -1
  83. package/dist/tools/reputation.tools.js +22 -22
  84. package/dist/tools/runes.tools.d.ts +1 -1
  85. package/dist/tools/runes.tools.js +18 -18
  86. package/dist/tools/sbtc.tools.d.ts +1 -1
  87. package/dist/tools/sbtc.tools.js +12 -12
  88. package/dist/tools/scaffold.tools.d.ts +1 -1
  89. package/dist/tools/scaffold.tools.js +4 -4
  90. package/dist/tools/settings.tools.d.ts +1 -1
  91. package/dist/tools/settings.tools.js +9 -9
  92. package/dist/tools/signing.tools.d.ts +1 -1
  93. package/dist/tools/signing.tools.js +20 -20
  94. package/dist/tools/souldinals.tools.d.ts +1 -1
  95. package/dist/tools/souldinals.tools.js +10 -10
  96. package/dist/tools/stacking-lottery.tools.d.ts +1 -1
  97. package/dist/tools/stacking-lottery.tools.js +11 -11
  98. package/dist/tools/stacking.tools.d.ts +1 -1
  99. package/dist/tools/stacking.tools.js +13 -13
  100. package/dist/tools/stacks-market.tools.d.ts +1 -1
  101. package/dist/tools/stacks-market.tools.js +22 -22
  102. package/dist/tools/styx.tools.d.ts +1 -1
  103. package/dist/tools/styx.tools.js +11 -11
  104. package/dist/tools/taproot-multisig.tools.d.ts +1 -1
  105. package/dist/tools/taproot-multisig.tools.js +5 -5
  106. package/dist/tools/tenero.tools.d.ts +1 -1
  107. package/dist/tools/tenero.tools.js +22 -22
  108. package/dist/tools/tokens.tools.d.ts +1 -1
  109. package/dist/tools/tokens.tools.js +10 -10
  110. package/dist/tools/transfer.tools.d.ts +1 -1
  111. package/dist/tools/transfer.tools.js +4 -4
  112. package/dist/tools/wallet-management.tools.d.ts +1 -1
  113. package/dist/tools/wallet-management.tools.js +16 -16
  114. package/dist/tools/wallet.tools.d.ts +1 -1
  115. package/dist/tools/wallet.tools.js +2 -2
  116. package/dist/tools/yield-dashboard.tools.d.ts +1 -1
  117. package/dist/tools/yield-dashboard.tools.js +5 -5
  118. package/dist/tools/yield-hunter.tools.d.ts +1 -1
  119. package/dist/tools/yield-hunter.tools.js +6 -6
  120. package/dist/utils/fee.js +1 -1
  121. package/package.json +4 -3
  122. package/skill/SKILL.md +1 -1
@@ -140,7 +140,7 @@ Sources:
140
140
  - directory: third-party endpoints registered at stx402.com (live, mainnet). Unverified entries are hidden unless includeUnverified is true — probe before paying.
141
141
 
142
142
  Costs from live specs are tiers ("paid (standard)", "paid (dynamic)"); use probe_x402_endpoint for the exact price.`,
143
- inputSchema: {
143
+ inputSchema: z.object({
144
144
  source: z
145
145
  .enum(["x402.biwas.xyz", "x402.aibtc.com", "stx402.com", "aibtc.com", "directory", "all"])
146
146
  .optional()
@@ -167,7 +167,7 @@ Costs from live specs are tiers ("paid (standard)", "paid (dynamic)"); use probe
167
167
  .optional()
168
168
  .default(false)
169
169
  .describe("Include unverified third-party entries from the stx402.com directory"),
170
- },
170
+ }),
171
171
  }, async ({ source, category, search, showFreeOnly, showPaidOnly, includeUnverified }) => {
172
172
  try {
173
173
  const wanted = source ?? "all";
@@ -249,7 +249,8 @@ Costs from live specs are tiers ("paid (standard)", "paid (dynamic)"); use probe
249
249
  (endpoints.length > 0 ? `\n${formatEndpointsTable(endpoints)}` : "") +
250
250
  directoryText +
251
251
  unavailableText +
252
- `\n\n---\nUse execute_x402_endpoint to call an endpoint (full url for directory entries). ` +
252
+ `\n\n---\nUse execute_x402_endpoint to call an endpoint: pass apiUrl="https://<source>" with the path ` +
253
+ `(the source is in each heading; a bare path goes to ${API_URL}), or the full url for directory entries. ` +
253
254
  `Use probe_x402_endpoint first to see the exact price.`,
254
255
  },
255
256
  ],
@@ -264,8 +265,8 @@ Costs from live specs are tiers ("paid (standard)", "paid (dynamic)"); use probe
264
265
  description: `Execute an x402 API endpoint. Payment is handled automatically.
265
266
 
266
267
  Supported sources:
267
- - x402.biwas.xyz (default): Use path like "/api/pools/trending"
268
- - x402.aibtc.com (mainnet) / x402.aibtc.dev (testnet): Use apiUrl="https://x402.aibtc.com" with path like "/inference/openrouter/chat"
268
+ - x402.aibtc.com (mainnet) / x402.aibtc.dev (testnet), the default: Use path like "/inference/openrouter/chat"
269
+ - x402.biwas.xyz: Use apiUrl="https://x402.biwas.xyz" with path like "/api/pools/trending"
269
270
  - stx402.com: Use apiUrl="https://stx402.com" with path like "/registry/list"
270
271
  - aibtc.com (mainnet) / aibtc.dev (testnet): Use apiUrl="https://aibtc.com" with path like "/api/inbox/{address}"
271
272
  - Any x402-compatible URL: Use url parameter with full endpoint URL
@@ -273,7 +274,7 @@ Supported sources:
273
274
  Use list_x402_endpoints to discover available endpoints.
274
275
 
275
276
  For aibtc.com inbox messages, use send_inbox_message_direct instead — it signs a standard sBTC transfer and settles directly through the x402 facilitator.`,
276
- inputSchema: {
277
+ inputSchema: z.object({
277
278
  method: z
278
279
  .enum(["GET", "POST", "PUT", "DELETE"])
279
280
  .default("GET")
@@ -291,7 +292,7 @@ For aibtc.com inbox messages, use send_inbox_message_direct instead — it signs
291
292
  .string()
292
293
  .url()
293
294
  .optional()
294
- .describe("API base URL. Known sources: x402.biwas.xyz, x402.aibtc.com, stx402.com, aibtc.com. Defaults to configured API_URL."),
295
+ .describe("API base URL: https:// plus the source host from list_x402_endpoints (x402.aibtc.com, x402.biwas.xyz, stx402.com, aibtc.com). Defaults to x402.aibtc.com (testnet x402.aibtc.dev)."),
295
296
  params: z
296
297
  .record(z.string(), z.string())
297
298
  .optional()
@@ -309,7 +310,7 @@ For aibtc.com inbox messages, use send_inbox_message_direct instead — it signs
309
310
  .string()
310
311
  .optional()
311
312
  .describe("Which asset to pay with when the endpoint accepts several. Accepts a symbol (\"sBTC\", \"STX\") or a full contract identifier. Defaults to the first asset this client can pay. Only STX and sBTC can be signed; requesting any other asset returns an error listing what is accepted."),
312
- },
313
+ }),
313
314
  }, async ({ method, url, path, apiUrl, params, data, autoApprove, asset }) => {
314
315
  let fullUrl = "";
315
316
  // Hoisted so the catch can record a broadcast payment for dedup — a
@@ -504,12 +505,12 @@ For paid endpoints, returns payment details (amount, asset, recipient) without e
504
505
  After probing a paid endpoint, use execute_x402_endpoint to actually execute and pay.
505
506
 
506
507
  Supported sources:
507
- - x402.biwas.xyz (default): Use path like "/api/pools/trending"
508
- - x402.aibtc.com (mainnet) / x402.aibtc.dev (testnet): Use apiUrl="https://x402.aibtc.com" with path like "/inference/openrouter/chat"
508
+ - x402.aibtc.com (mainnet) / x402.aibtc.dev (testnet), the default: Use path like "/inference/openrouter/chat"
509
+ - x402.biwas.xyz: Use apiUrl="https://x402.biwas.xyz" with path like "/api/pools/trending"
509
510
  - stx402.com: Use apiUrl="https://stx402.com" with path like "/registry/list"
510
511
  - aibtc.com (mainnet) / aibtc.dev (testnet): Use apiUrl="https://aibtc.com" with path like "/api/inbox/{address}"
511
512
  - Any x402-compatible URL: Use url parameter with full endpoint URL`,
512
- inputSchema: {
513
+ inputSchema: z.object({
513
514
  method: z
514
515
  .enum(["GET", "POST", "PUT", "DELETE"])
515
516
  .default("GET")
@@ -527,7 +528,7 @@ Supported sources:
527
528
  .string()
528
529
  .url()
529
530
  .optional()
530
- .describe("API base URL. Known sources: x402.biwas.xyz, x402.aibtc.com, stx402.com, aibtc.com. Defaults to configured API_URL."),
531
+ .describe("API base URL: https:// plus the source host from list_x402_endpoints (x402.aibtc.com, x402.biwas.xyz, stx402.com, aibtc.com). Defaults to x402.aibtc.com (testnet x402.aibtc.dev)."),
531
532
  params: z
532
533
  .record(z.string(), z.string())
533
534
  .optional()
@@ -540,7 +541,7 @@ Supported sources:
540
541
  .string()
541
542
  .optional()
542
543
  .describe("Quote the cost in this asset when the endpoint accepts several. Accepts a symbol (\"sBTC\", \"STX\") or a full contract identifier. Defaults to the first asset this client can pay; the full accepts[] list is always returned."),
543
- },
544
+ }),
544
545
  }, async ({ method, url, path, apiUrl, params, data, asset }) => {
545
546
  let fullUrl = "";
546
547
  try {
@@ -17,6 +17,6 @@
17
17
  * - identity_unset_wallet - Remove agent wallet association
18
18
  * - identity_transfer - Transfer identity NFT to new owner
19
19
  */
20
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
20
+ import { McpServer } from "@modelcontextprotocol/server";
21
21
  export declare function registerIdentityTools(server: McpServer): void;
22
22
  //# sourceMappingURL=identity.tools.d.ts.map
@@ -36,7 +36,7 @@ export function registerIdentityTools(server) {
36
36
  server.registerTool("identity_get_last_id", {
37
37
  description: "Get the most recently minted agent ID from the ERC-8004 identity registry. " +
38
38
  "Returns null if no agents have been registered.",
39
- inputSchema: {},
39
+ inputSchema: z.object({}),
40
40
  }, async () => {
41
41
  try {
42
42
  const callerAddress = getCallerAddress();
@@ -57,9 +57,9 @@ export function registerIdentityTools(server) {
57
57
  server.registerTool("identity_get", {
58
58
  description: "Get agent identity information from ERC-8004 identity registry. " +
59
59
  "Returns owner address, URI, and wallet address if set.",
60
- inputSchema: {
60
+ inputSchema: z.object({
61
61
  agentId: z.number().int().min(0).describe("Agent ID to look up"),
62
- },
62
+ }),
63
63
  }, async ({ agentId }) => {
64
64
  try {
65
65
  const callerAddress = getCallerAddress();
@@ -87,10 +87,10 @@ export function registerIdentityTools(server) {
87
87
  server.registerTool("identity_get_metadata", {
88
88
  description: "Read a single metadata value by key from an agent's ERC-8004 identity. " +
89
89
  "Returns the raw buffer value as a hex string.",
90
- inputSchema: {
90
+ inputSchema: z.object({
91
91
  agentId: z.number().int().min(0).describe("Agent ID to query"),
92
92
  key: z.string().max(MAX_METADATA_KEY_LENGTH).describe("Metadata key to read"),
93
- },
93
+ }),
94
94
  }, async ({ agentId, key }) => {
95
95
  try {
96
96
  const callerAddress = getCallerAddress();
@@ -122,7 +122,7 @@ export function registerIdentityTools(server) {
122
122
  description: "Register a new agent identity on-chain using ERC-8004 identity registry. " +
123
123
  "Returns a transaction ID. Check the transaction result to get the assigned agent ID. " +
124
124
  "Requires an unlocked wallet.",
125
- inputSchema: {
125
+ inputSchema: z.object({
126
126
  uri: z
127
127
  .string()
128
128
  .optional()
@@ -139,7 +139,7 @@ export function registerIdentityTools(server) {
139
139
  .optional()
140
140
  .describe('Fee preset ("low", "medium", "high") or micro-STX amount. Optional.'),
141
141
  sponsored: sponsoredSchema,
142
- },
142
+ }),
143
143
  }, async ({ uri, metadata, fee, sponsored }) => {
144
144
  try {
145
145
  const walletManager = getWalletManager();
@@ -185,7 +185,7 @@ export function registerIdentityTools(server) {
185
185
  server.registerTool("identity_set_uri", {
186
186
  description: "Update the URI for an agent identity in the ERC-8004 identity registry. " +
187
187
  "Requires an unlocked wallet. Must be called by agent owner or approved operator.",
188
- inputSchema: {
188
+ inputSchema: z.object({
189
189
  agentId: z.number().int().min(0).describe("Agent ID to update"),
190
190
  uri: z.string().describe("New URI pointing to agent metadata (IPFS, HTTP, etc.)"),
191
191
  fee: z
@@ -193,7 +193,7 @@ export function registerIdentityTools(server) {
193
193
  .optional()
194
194
  .describe('Fee preset ("low", "medium", "high") or micro-STX amount. Optional.'),
195
195
  sponsored: sponsoredSchema,
196
- },
196
+ }),
197
197
  }, async ({ agentId, uri, fee, sponsored }) => {
198
198
  try {
199
199
  const walletManager = getWalletManager();
@@ -222,7 +222,7 @@ export function registerIdentityTools(server) {
222
222
  "Value must be a hex-encoded buffer (max 512 bytes). " +
223
223
  'The key "agentWallet" is reserved — use identity_set_wallet instead. ' +
224
224
  "Requires an unlocked wallet.",
225
- inputSchema: {
225
+ inputSchema: z.object({
226
226
  agentId: z.number().int().min(0).describe("Agent ID to update"),
227
227
  key: z.string().max(MAX_METADATA_KEY_LENGTH).describe("Metadata key (max 128 chars)"),
228
228
  value: z
@@ -233,7 +233,7 @@ export function registerIdentityTools(server) {
233
233
  .optional()
234
234
  .describe('Fee preset ("low", "medium", "high") or micro-STX amount. Optional.'),
235
235
  sponsored: sponsoredSchema,
236
- },
236
+ }),
237
237
  }, async ({ agentId, key, value, fee, sponsored }) => {
238
238
  try {
239
239
  if (key === "agentWallet") {
@@ -269,7 +269,7 @@ export function registerIdentityTools(server) {
269
269
  description: "Approve or revoke an operator for an agent identity in the ERC-8004 identity registry. " +
270
270
  "An approved operator can update URI, metadata, and wallet on behalf of the owner. " +
271
271
  "Only the NFT owner can call this. Requires an unlocked wallet.",
272
- inputSchema: {
272
+ inputSchema: z.object({
273
273
  agentId: z.number().int().min(0).describe("Agent ID to update"),
274
274
  operator: z.string().describe("Stacks address of the operator to approve or revoke"),
275
275
  approved: z
@@ -282,7 +282,7 @@ export function registerIdentityTools(server) {
282
282
  .optional()
283
283
  .describe('Fee preset ("low", "medium", "high") or micro-STX amount. Optional.'),
284
284
  sponsored: sponsoredSchema,
285
- },
285
+ }),
286
286
  }, async ({ agentId, operator, approved, fee, sponsored }) => {
287
287
  try {
288
288
  const walletManager = getWalletManager();
@@ -310,14 +310,14 @@ export function registerIdentityTools(server) {
310
310
  server.registerTool("identity_set_wallet", {
311
311
  description: "Link the active Stacks wallet address to an agent identity in the ERC-8004 identity registry. " +
312
312
  "Requires an unlocked wallet.",
313
- inputSchema: {
313
+ inputSchema: z.object({
314
314
  agentId: z.number().int().min(0).describe("Agent ID to update"),
315
315
  fee: z
316
316
  .string()
317
317
  .optional()
318
318
  .describe('Fee preset ("low", "medium", "high") or micro-STX amount. Optional.'),
319
319
  sponsored: sponsoredSchema,
320
- },
320
+ }),
321
321
  }, async ({ agentId, fee, sponsored }) => {
322
322
  try {
323
323
  const walletManager = getWalletManager();
@@ -343,14 +343,14 @@ export function registerIdentityTools(server) {
343
343
  server.registerTool("identity_unset_wallet", {
344
344
  description: "Remove the agent wallet association from an agent identity in the ERC-8004 identity registry. " +
345
345
  "Requires an unlocked wallet.",
346
- inputSchema: {
346
+ inputSchema: z.object({
347
347
  agentId: z.number().int().min(0).describe("Agent ID to update"),
348
348
  fee: z
349
349
  .string()
350
350
  .optional()
351
351
  .describe('Fee preset ("low", "medium", "high") or micro-STX amount. Optional.'),
352
352
  sponsored: sponsoredSchema,
353
- },
353
+ }),
354
354
  }, async ({ agentId, fee, sponsored }) => {
355
355
  try {
356
356
  const walletManager = getWalletManager();
@@ -377,7 +377,7 @@ export function registerIdentityTools(server) {
377
377
  description: "Transfer an agent identity NFT to a new owner in the ERC-8004 identity registry. " +
378
378
  "This clears the agent wallet association — run identity_set_wallet after if needed. " +
379
379
  "Requires an unlocked wallet.",
380
- inputSchema: {
380
+ inputSchema: z.object({
381
381
  agentId: z.number().int().min(0).describe("Agent ID (token ID) to transfer"),
382
382
  recipient: z.string().describe("Stacks address of the new owner"),
383
383
  fee: z
@@ -385,7 +385,7 @@ export function registerIdentityTools(server) {
385
385
  .optional()
386
386
  .describe('Fee preset ("low", "medium", "high") or micro-STX amount. Optional.'),
387
387
  sponsored: sponsoredSchema,
388
- },
388
+ }),
389
389
  }, async ({ agentId, recipient, fee, sponsored }) => {
390
390
  try {
391
391
  const walletManager = getWalletManager();
@@ -1,4 +1,4 @@
1
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
1
+ import { McpServer } from "@modelcontextprotocol/server";
2
2
  /**
3
3
  * Pre-flight balance check for a non-sponsored sBTC inbox payment.
4
4
  * Verifies the wallet holds enough sBTC for the message AND enough STX for a
@@ -80,7 +80,7 @@ export function registerInboxX402Tools(server) {
80
80
  "message cost AND your own STX gas fee. No relay sits in the middle of the payment; the inbox settles " +
81
81
  "the signed transaction via the x402 facilitator.\n\n" +
82
82
  "Requires an unlocked wallet holding sBTC (message cost) and STX (gas). Mainnet only.",
83
- inputSchema: {
83
+ inputSchema: z.object({
84
84
  recipientBtcAddress: z
85
85
  .string()
86
86
  .describe("Recipient's Bitcoin address (bc1...)"),
@@ -91,7 +91,7 @@ export function registerInboxX402Tools(server) {
91
91
  .string()
92
92
  .max(500)
93
93
  .describe("Message content (max 500 characters)"),
94
- },
94
+ }),
95
95
  }, async ({ recipientBtcAddress, recipientStxAddress, content }) => {
96
96
  try {
97
97
  // Network mismatch guard: the inbox at aibtc.com is mainnet-only.
@@ -1,3 +1,3 @@
1
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
1
+ import { McpServer } from "@modelcontextprotocol/server";
2
2
  export declare function registerInboxTools(server: McpServer): void;
3
3
  //# sourceMappingURL=inbox.tools.d.ts.map
@@ -21,7 +21,7 @@ export function registerInboxTools(server) {
21
21
  "Use send_inbox_message_direct instead. It signs a standard sBTC transfer and settles directly " +
22
22
  "through the x402 facilitator (no relay). Requires an unlocked wallet holding sBTC (message cost) " +
23
23
  "and STX (gas). Mainnet only.",
24
- inputSchema: {
24
+ inputSchema: z.object({
25
25
  recipientBtcAddress: z
26
26
  .string()
27
27
  .describe("Recipient's Bitcoin address (bc1...)"),
@@ -32,7 +32,7 @@ export function registerInboxTools(server) {
32
32
  .string()
33
33
  .max(500)
34
34
  .describe("Message content (max 500 characters)"),
35
- },
35
+ }),
36
36
  }, async () => {
37
37
  return createJsonResponse({
38
38
  success: false,
@@ -1,6 +1,9 @@
1
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
1
+ import { McpServer } from "@modelcontextprotocol/server";
2
+ import { type ToolSelection } from "./profiles.js";
2
3
  /**
3
- * Register all tools with the MCP server
4
+ * Register the selected tools with the MCP server. Each registration module
5
+ * belongs to one group; a tool is registered when it is in the core set or its
6
+ * group is selected (see profiles.ts).
4
7
  */
5
- export declare function registerAllTools(server: McpServer): void;
8
+ export declare function registerAllTools(server: McpServer, selection: ToolSelection): void;
6
9
  //# sourceMappingURL=index.d.ts.map
@@ -53,6 +53,7 @@ import { registerInboxX402Tools } from "./inbox-x402.tools.js";
53
53
  import { registerArxivResearchTools } from "./arxiv-research.tools.js";
54
54
  import { registerEarningTools } from "./earning.tools.js";
55
55
  import { getSkillForTool } from "./skill-mappings.js";
56
+ import { isToolSelected } from "./profiles.js";
56
57
  /**
57
58
  * One-line pointer appended to every tool's description (except the earning tool
58
59
  * itself) so agents stay oriented toward how they can put their assets to work.
@@ -60,16 +61,19 @@ import { getSkillForTool } from "./skill-mappings.js";
60
61
  const EARNING_TIP = "\n\nTip: call `earning_opportunities` to see how to put your assets to work.";
61
62
  /**
62
63
  * Wraps server.registerTool to:
64
+ * - skip tools outside the active selection,
63
65
  * - inject _meta.skill from TOOL_SKILL_MAP when a mapping exists, and
64
66
  * - append the earning-opportunities tip to each tool's description.
65
67
  * Returns a cleanup function that restores the original method.
66
68
  */
67
- function withSkillMeta(server) {
69
+ function withSkillMeta(server, selection, currentGroup) {
68
70
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
69
71
  const original = server.registerTool;
70
72
  const hasOwn = Object.prototype.hasOwnProperty.call(server, "registerTool");
71
73
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
72
74
  server.registerTool = function (name, config, cb) {
75
+ if (!isToolSelected(selection, name, currentGroup()))
76
+ return undefined;
73
77
  const skill = getSkillForTool(name);
74
78
  let patched = skill
75
79
  ? { ...config, _meta: { ...(config._meta ?? {}), skill } }
@@ -91,118 +95,125 @@ function withSkillMeta(server) {
91
95
  };
92
96
  }
93
97
  /**
94
- * Register all tools with the MCP server
98
+ * Register the selected tools with the MCP server. Each registration module
99
+ * belongs to one group; a tool is registered when it is in the core set or its
100
+ * group is selected (see profiles.ts).
95
101
  */
96
- export function registerAllTools(server) {
97
- const restoreRegisterTool = withSkillMeta(server);
102
+ export function registerAllTools(server, selection) {
103
+ let currentGroup = "wallet";
104
+ const restoreRegisterTool = withSkillMeta(server, selection, () => currentGroup);
105
+ const inGroup = (group, register) => {
106
+ currentGroup = group;
107
+ register(server);
108
+ };
98
109
  // Wallet & Balance
99
- registerWalletTools(server);
110
+ inGroup("wallet", registerWalletTools);
100
111
  // Wallet Management (create, import, unlock, lock, etc.)
101
- registerWalletManagementTools(server);
112
+ inGroup("wallet", registerWalletManagementTools);
102
113
  // Transfers
103
- registerTransferTools(server);
114
+ inGroup("stacks", registerTransferTools);
104
115
  // Smart Contracts
105
- registerContractTools(server);
116
+ inGroup("stacks", registerContractTools);
106
117
  // sBTC
107
- registerSbtcTools(server);
118
+ inGroup("sbtc", registerSbtcTools);
108
119
  // Tokens (SIP-010)
109
- registerTokenTools(server);
120
+ inGroup("stacks", registerTokenTools);
110
121
  // NFTs (SIP-009)
111
- registerNftTools(server);
122
+ inGroup("stacks", registerNftTools);
112
123
  // Stacking / PoX
113
- registerStackingTools(server);
124
+ inGroup("stacking", registerStackingTools);
114
125
  // Dual Stacking (sBTC yield via Dual Stacking protocol)
115
- registerDualStackingTools(server);
126
+ inGroup("stacking", registerDualStackingTools);
116
127
  // Stacking Lottery (StackSpot — pool STX, VRF picks sBTC winner)
117
- registerStackingLotteryTools(server);
128
+ inGroup("stacking", registerStackingLotteryTools);
118
129
  // BNS Domains
119
- registerBnsTools(server);
130
+ inGroup("bns", registerBnsTools);
120
131
  // Blockchain Queries
121
- registerQueryTools(server);
132
+ inGroup("stacks", registerQueryTools);
122
133
  // Reputation (ERC-8004 feedback lifecycle)
123
- registerReputationTools(server);
134
+ inGroup("identity", registerReputationTools);
124
135
  // x402 Endpoints
125
- registerEndpointTools(server);
136
+ inGroup("dev", registerEndpointTools);
126
137
  // DeFi (ALEX DEX, Zest Protocol)
127
- registerDefiTools(server);
138
+ inGroup("defi", registerDefiTools);
128
139
  // Bitflow DEX (public API — no key required, key only raises rate limits)
129
- registerBitflowTools(server);
140
+ inGroup("defi", registerBitflowTools);
130
141
  // Styx BTC→sBTC conversion
131
- registerStyxTools(server);
142
+ inGroup("sbtc", registerStyxTools);
132
143
  // Scaffolding (generate x402 endpoint projects)
133
- registerScaffoldTools(server);
144
+ inGroup("dev", registerScaffoldTools);
134
145
  // OpenRouter AI (call AI models directly)
135
- registerOpenRouterTools(server);
146
+ inGroup("dev", registerOpenRouterTools);
136
147
  // Yield Hunter (autonomous sBTC yield farming)
137
- registerYieldHunterTools(server);
148
+ inGroup("defi", registerYieldHunterTools);
138
149
  // Yield Dashboard (read-only cross-protocol DeFi yield aggregation)
139
- registerYieldDashboardTools(server);
150
+ inGroup("defi", registerYieldDashboardTools);
140
151
  // Pillar (handoff to frontend + polling)
141
- registerPillarTools(server);
152
+ inGroup("pillar", registerPillarTools);
142
153
  // Pillar Direct (agent-signed, no browser handoff)
143
- registerPillarDirectTools(server);
154
+ inGroup("pillar", registerPillarDirectTools);
144
155
  // Bitcoin L1 (read-only: balance, fees, UTXOs)
145
- registerBitcoinTools(server);
156
+ inGroup("bitcoin", registerBitcoinTools);
146
157
  // Lightning Network (L402 auto-pay, Spark-backed wallet)
147
- registerLightningTools(server);
158
+ inGroup("lightning", registerLightningTools);
148
159
  // Mempool Watch (read-only: mempool stats, tx status, address tx history)
149
- registerMempoolTools(server);
160
+ inGroup("bitcoin", registerMempoolTools);
150
161
  // Nostr protocol (publish notes, read feed, manage profile)
151
- registerNostrTools(server);
162
+ inGroup("social", registerNostrTools);
152
163
  // Relay Diagnostics (sponsor relay health, nonce status, stuck transactions)
153
- registerRelayDiagnosticTools(server);
164
+ inGroup("stacks", registerRelayDiagnosticTools);
154
165
  // Nonce Diagnostics (sender nonce health, gap-fill — issue #413)
155
- registerNonceTools(server);
166
+ inGroup("stacks", registerNonceTools);
156
167
  // Stacks Market prediction market trading
157
- registerStacksMarketTools(server);
168
+ inGroup("markets", registerStacksMarketTools);
158
169
  // Tenero market analytics (token info, gainers/losers, trending pools, wallet trades)
159
- registerTeneroTools(server);
170
+ inGroup("defi", registerTeneroTools);
160
171
  // Ordinals P2P trading (ledger.drx4.xyz — offers, counters, transfers, PSBT swaps)
161
- registerOrdinalsP2PTools(server);
172
+ inGroup("ordinals", registerOrdinalsP2PTools);
162
173
  // Ordinals Marketplace (Magic Eden — browse listings, list/buy/cancel via PSBT)
163
- registerOrdinalsMarketplaceTools(server);
174
+ inGroup("ordinals", registerOrdinalsMarketplaceTools);
164
175
  // Taproot Multisig (M-of-N coordination via OP_CHECKSIGADD, BIP-341/342)
165
- registerTaprootMultisigTools(server);
176
+ inGroup("ordinals", registerTaprootMultisigTools);
166
177
  // PSBT sign/broadcast/decode (used by the ordinals marketplace, P2P and taproot multisig flows)
167
- registerPsbtTools(server);
178
+ inGroup("ordinals", registerPsbtTools);
168
179
  // Settings (Hiro API key, custom Stacks API URL, server version)
169
- registerSettingsTools(server);
180
+ inGroup("dev", registerSettingsTools);
170
181
  // Jingswap Auction (blind batch auctions for STX/sBTC)
171
- registerJingswapTools(server);
182
+ inGroup("defi", registerJingswapTools);
172
183
  // Message Signing (BTC BIP-322, Stacks SIWS, SIP-018 structured data, Nostr NIP-01)
173
- registerSigningTools(server);
184
+ inGroup("identity", registerSigningTools);
174
185
  // AIBTC Inference Marketplace (list/manage a paid model endpoint via wallet signature)
175
- registerInferenceMarketplaceTools(server);
186
+ inGroup("dev", registerInferenceMarketplaceTools);
176
187
  // AIBTC News (deprecated — API retired; each tool redirects to legion_*)
177
- registerNewsTools(server);
188
+ inGroup("legion", registerNewsTools);
178
189
  // AIBTC News Legion (mainnet aibtc-news-gov — inscribe, propose, vote, conclude)
179
- registerLegionTools(server);
190
+ inGroup("legion", registerLegionTools);
180
191
  // At Stake (elsalvadorstakesbtc.com — complete-set prediction market)
181
- registerAtStakeTools(server);
192
+ inGroup("markets", registerAtStakeTools);
182
193
  // At Stake side legions (aibtc.com/legions — weight is the share balance)
183
- registerAtStakeLegionTools(server);
194
+ inGroup("markets", registerAtStakeLegionTools);
184
195
  // Identity (ERC-8004 on-chain agent identity management)
185
- registerIdentityTools(server);
196
+ inGroup("identity", registerIdentityTools);
186
197
  // Credentials (encrypted credential store — list, get, set, delete, unlock)
187
- registerCredentialsTools(server);
198
+ inGroup("wallet", registerCredentialsTools);
188
199
  // Ordinals (genesis inscriptions — taproot address, estimate fee, inscribe, reveal, lookup)
189
- registerOrdinalsTools(server);
200
+ inGroup("ordinals", registerOrdinalsTools);
190
201
  // Souldinals (soul.md child inscriptions — inscribe, reveal, list, load, display traits)
191
- registerSouldinalsTools(server);
202
+ inGroup("ordinals", registerSouldinalsTools);
192
203
  // Child inscriptions (parent-child provenance — estimate fee, commit, reveal)
193
- registerChildInscriptionTools(server);
204
+ inGroup("ordinals", registerChildInscriptionTools);
194
205
  // Bounty board (aibtc.com/api/bounties — list, get, submit, accept, pay, cancel, my-views)
195
- registerBountyScannerTools(server);
206
+ inGroup("earn", registerBountyScannerTools);
196
207
  // Runes (Bitcoin-native fungible tokens — list, query, holders, activity, balances)
197
- registerRunesTools(server);
208
+ inGroup("ordinals", registerRunesTools);
198
209
  // Inbox (AIBTC agent messaging — send paid inbox messages)
199
- registerInboxTools(server);
210
+ inGroup("social", registerInboxTools);
200
211
  // Inbox direct x402 (non-sponsored — sender pays own STX gas, no relay)
201
- registerInboxX402Tools(server);
212
+ inGroup("social", registerInboxX402Tools);
202
213
  // arXiv Research (public arXiv Atom API — paper search and digest compilation)
203
- registerArxivResearchTools(server);
214
+ inGroup("dev", registerArxivResearchTools);
204
215
  // Earning Opportunities (static "how to put your assets to work" menu)
205
- registerEarningTools(server);
216
+ inGroup("earn", registerEarningTools);
206
217
  restoreRegisterTool();
207
218
  }
208
219
  //# sourceMappingURL=index.js.map
@@ -17,7 +17,7 @@
17
17
  * enforces the network), that the endpoint is reachable AND serving inference,
18
18
  * and that model ids are real, text-generation, commercially-licensed HF repos.
19
19
  */
20
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
20
+ import { McpServer } from "@modelcontextprotocol/server";
21
21
  type AuthAction = "register" | "update" | "reveal-key";
22
22
  /** The exact message the gateway rebuilds and verifies. Must match byte-for-byte. */
23
23
  export declare function authMessage(action: AuthAction, providerId: string, timestamp: number): string;
@@ -118,7 +118,7 @@ export function registerInferenceMarketplaceTools(server) {
118
118
  "The gateway verifies the signature recovers to payoutAddress, that the endpoint is reachable AND actually " +
119
119
  "serving inference, and that model ids are real/commercial Hugging Face repos — then lists it. " +
120
120
  "Requires an unlocked wallet on the gateway's network.",
121
- inputSchema: {
121
+ inputSchema: z.object({
122
122
  name: z.string().describe("Display name for your node, e.g. \"Alice's Qwen node\"."),
123
123
  endpoint: z
124
124
  .string()
@@ -138,7 +138,7 @@ export function registerInferenceMarketplaceTools(server) {
138
138
  .describe("Optional: a key your endpoint requires. Locks the endpoint so only the gateway (which presents it) can call it."),
139
139
  gateway: gatewayArg,
140
140
  allowUnsafeGateway: allowUnsafeGatewayArg,
141
- },
141
+ }),
142
142
  }, async ({ name, endpoint, models, payoutAddress, apiKey, gateway, allowUnsafeGateway }) => {
143
143
  try {
144
144
  const account = requireUnlockedWallet();
@@ -176,7 +176,7 @@ export function registerInferenceMarketplaceTools(server) {
176
176
  description: "Update your marketplace listing in place — name, models, payout address, endpoint, or description — no delete/re-add. " +
177
177
  "Signs an update message with the unlocked payout wallet and PATCHes it. Only fields you pass change. " +
178
178
  "Changing the endpoint re-verifies reachability before taking effect. Requires an unlocked wallet.",
179
- inputSchema: {
179
+ inputSchema: z.object({
180
180
  providerId: z.string().describe("The provider id returned at registration (from inference_list_providers)."),
181
181
  name: z.string().optional().describe("New display name."),
182
182
  endpoint: z.string().url().optional().describe("New OpenAI-compatible base URL (re-verified before it takes effect)."),
@@ -186,7 +186,7 @@ export function registerInferenceMarketplaceTools(server) {
186
186
  apiKey: z.string().optional().describe("Set/replace the key your endpoint requires (locks the endpoint)."),
187
187
  gateway: gatewayArg,
188
188
  allowUnsafeGateway: allowUnsafeGatewayArg,
189
- },
189
+ }),
190
190
  }, async ({ providerId, name, endpoint, models, payoutAddress, description, apiKey, gateway, allowUnsafeGateway }) => {
191
191
  try {
192
192
  const account = requireUnlockedWallet();
@@ -230,12 +230,12 @@ export function registerInferenceMarketplaceTools(server) {
230
230
  description: "Reveal or rotate your provider's shared key — the gateway↔endpoint credential the gateway presents when it " +
231
231
  "calls your endpoint (NOT an ownership token; ownership is your wallet). The gateway stores it write-only, so a " +
232
232
  "wallet signature is the only way to read it back. Pass rotate=true to issue a new one. Requires an unlocked wallet.",
233
- inputSchema: {
233
+ inputSchema: z.object({
234
234
  providerId: z.string().describe("The provider id (from inference_list_providers)."),
235
235
  rotate: z.boolean().optional().describe("true = generate and return a NEW key (invalidates the old one). false/omitted = reveal the current key."),
236
236
  gateway: gatewayArg,
237
237
  allowUnsafeGateway: allowUnsafeGatewayArg,
238
- },
238
+ }),
239
239
  }, async ({ providerId, rotate, gateway, allowUnsafeGateway }) => {
240
240
  try {
241
241
  const account = requireUnlockedWallet();
@@ -264,11 +264,11 @@ export function registerInferenceMarketplaceTools(server) {
264
264
  server.registerTool("inference_check_provider", {
265
265
  description: "Re-run the marketplace's health + functional probe for a provider on demand (checks the endpoint is reachable and " +
266
266
  "actually returns a completion). No signature required. Useful right after (re)starting your node or tunnel.",
267
- inputSchema: {
267
+ inputSchema: z.object({
268
268
  providerId: z.string().describe("The provider id to check."),
269
269
  gateway: gatewayArg,
270
270
  allowUnsafeGateway: allowUnsafeGatewayArg,
271
- },
271
+ }),
272
272
  }, async ({ providerId, gateway, allowUnsafeGateway }) => {
273
273
  try {
274
274
  const base = resolveGateway(gateway, allowUnsafeGateway ?? false);
@@ -285,10 +285,10 @@ export function registerInferenceMarketplaceTools(server) {
285
285
  server.registerTool("inference_list_providers", {
286
286
  description: "List providers registered on the marketplace with their models, health/status, and flagged state. No signature " +
287
287
  "required. Use it to find your provider id (match on payoutAddress) after registering.",
288
- inputSchema: {
288
+ inputSchema: z.object({
289
289
  gateway: gatewayArg,
290
290
  allowUnsafeGateway: allowUnsafeGatewayArg,
291
- },
291
+ }),
292
292
  }, async ({ gateway, allowUnsafeGateway }) => {
293
293
  try {
294
294
  const base = resolveGateway(gateway, allowUnsafeGateway ?? false);
@@ -1,3 +1,3 @@
1
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
1
+ import { McpServer } from "@modelcontextprotocol/server";
2
2
  export declare function registerJingswapTools(server: McpServer): void;
3
3
  //# sourceMappingURL=jingswap.tools.d.ts.map