agenticbtc-mcp 1.0.5 → 1.0.7

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/server.js +87 -46
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agenticbtc-mcp",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Privacy-intelligent payments for AI agents — your privacy, your choice. Universal payment router with Lightning, Strike, Coinbase, PayPal, Venmo support.",
5
5
  "keywords": [
6
6
  "bitcoin",
package/src/server.js CHANGED
@@ -259,55 +259,35 @@ server.tool(
259
259
  agent: z.string().optional().describe("Agent wallet name or ID (optional)"),
260
260
  },
261
261
  async ({ amount_sats, description, agent }) => {
262
- if (!LND_HOST) {
263
- return { content: [{ type: "text", text: "Error: LND node not configured. Set AGENTBTC_LND_HOST environment variable." }] };
264
- }
265
-
266
- // Resolve agent if provided (for logging/tracking)
267
- let agentName = null;
268
- if (agent) {
269
- const resolved = await resolveAgent(agent);
270
- if (!resolved) {
271
- return { content: [{ type: "text", text: `Error: Agent '${agent}' not found` }] };
272
- }
273
- agentName = resolved.name;
274
- }
275
-
276
262
  try {
277
- // Create invoice directly via LND REST API
278
- const res = await fetch(`${LND_HOST}/v1/invoices`, {
263
+ // Route through the AgenticBTC API so the invoice is stored in the DB
264
+ // and the settlement poller can credit the agent wallet on payment
265
+ const { status, data } = await apiCall("/api/v1/invoices", {
279
266
  method: "POST",
280
- headers: {
281
- "Grpc-Metadata-macaroon": LND_MACAROON,
282
- "Content-Type": "application/json",
283
- },
284
267
  body: JSON.stringify({
285
- value: amount_sats,
286
- memo: description + (agentName ? ` [${agentName}]` : ""),
287
- expiry: "3600",
268
+ amount_sats,
269
+ description,
288
270
  }),
289
271
  });
290
- const data = await res.json();
291
272
 
292
- if (res.ok && data.payment_request) {
273
+ if (status === 200 && data.invoice) {
293
274
  return {
294
275
  content: [{
295
276
  type: "text",
296
277
  text: JSON.stringify({
297
278
  success: true,
298
- invoice: data.payment_request,
299
- amount_sats: amount_sats,
300
- description: description,
301
- agent: agentName,
302
- payment_hash: data.r_hash,
303
- expires: "1 hour",
279
+ invoice: data.invoice,
280
+ amount_sats,
281
+ description: data.description || description,
282
+ payment_hash: data.payment_hash,
283
+ expires: data.expires_in || "1 hour",
304
284
  }, null, 2),
305
285
  }],
306
286
  };
307
287
  }
308
- return { content: [{ type: "text", text: `Error creating invoice: ${JSON.stringify(data)}` }] };
288
+ return { content: [{ type: "text", text: `Error creating invoice: ${data?.detail || JSON.stringify(data)}` }] };
309
289
  } catch (e) {
310
- return { content: [{ type: "text", text: `LND connection error: ${e.message}` }] };
290
+ return { content: [{ type: "text", text: `Error: ${e.message}` }] };
311
291
  }
312
292
  }
313
293
  );
@@ -1212,19 +1192,80 @@ server.tool(
1212
1192
  type: "text",
1213
1193
  text: JSON.stringify({
1214
1194
  success: true,
1215
- onboarding_prompt: `You are helping a user set up AgenticBTC — a payment system that lets AI agents send and receive Bitcoin payments via Lightning Network.
1216
-
1217
- Guide the user through these steps in a friendly, conversational way:
1218
-
1219
- STEP 1: Check current status — Call setup_check_status to see what's already configured.
1220
- STEP 2: API Key — If no API key, ask them to sign up at https://agenticbtc.app/dashboard
1221
- STEP 3: Lightning Node (optional) — Ask if they have one. If yes, use setup_configure_lightning. If no, recommend Voltage (voltage.cloud).
1222
- STEP 4: Test Everything Call setup_test_payment_capabilities
1223
- STEP 5: Complete — Call setup_complete_onboarding
1224
-
1225
- IMPORTANT: Do NOT create wallets for the user. Wallet creation is always a deliberate owner action done through the dashboard. Your job is to get them connected and verified — not to create anything on their behalf.
1226
-
1227
- Be patient, explain everything in plain language, celebrate small wins.`,
1195
+ onboarding_prompt: `You are helping a user set up AgenticBTC — a platform that lets AI agents send and receive Bitcoin payments via Lightning Network.
1196
+
1197
+ Your job is to guide them through setup conversationally. Be friendly, patient, and explain everything in plain language. One step at a time never dump multiple questions at once.
1198
+
1199
+ ---
1200
+
1201
+ STEP 1: Check current status
1202
+ Call setup_check_status first. This tells you exactly what's already configured and what's missing. Use this to skip steps the user has already completed.
1203
+
1204
+ ---
1205
+
1206
+ STEP 2: API Key
1207
+ If no API key is configured:
1208
+ - Ask them to open https://agenticbtc.app/dashboard in their browser
1209
+ - Tell them to create an account if they don't have one (takes 2 minutes)
1210
+ - Once logged in, go to Settings → API Keys → copy their Owner API Key
1211
+ - Ask them to paste it here
1212
+ - Call setup_validate_credentials to confirm it works
1213
+
1214
+ ---
1215
+
1216
+ STEP 3: Lightning Node
1217
+ Ask: "Do you already have a Lightning Network node set up?"
1218
+
1219
+ IF YES — they have a node:
1220
+ - Ask what type (Voltage, Umbrel, Start9, BTCPay, other)
1221
+ - For Voltage: ask for their node's REST URL and admin macaroon
1222
+ - REST URL format: https://yournode.m.voltageapp.io:8080
1223
+ - Macaroon: found in Voltage dashboard → Node → Connection Details → Admin Macaroon (hex)
1224
+ - For Umbrel: ask for their lndconnect URL
1225
+ - Found in: Lightning Node app → ⋯ menu → Connect Wallet → REST Local Network
1226
+ - Call setup_configure_lightning with their credentials
1227
+ - Call setup_validate_credentials to test the connection
1228
+
1229
+ IF NO — they don't have a node:
1230
+ - Explain: "Lightning lets your AI agents make instant Bitcoin payments. You'll need a node to use it. The easiest option is Voltage Cloud — it takes about 5 minutes and costs around $20/month."
1231
+ - Walk them through Voltage signup step by step:
1232
+ 1. Go to https://voltage.cloud and click "Start Building"
1233
+ 2. Create an account with email + password
1234
+ 3. Click "Create Node" → select "LND" → choose "Testnet" (for testing) or "Mainnet"
1235
+ 4. Pick the smallest plan (Standard is fine to start)
1236
+ 5. Wait 2-3 minutes for the node to initialize
1237
+ 6. Once ready, go to your node dashboard → click "Connect" → copy the REST API URL and Admin Macaroon
1238
+ 7. Paste both here and I'll configure the connection
1239
+ - After they have credentials, call setup_configure_lightning
1240
+ - Call setup_validate_credentials to confirm
1241
+
1242
+ IF SKIPPING Lightning:
1243
+ - That's fine — AgenticBTC works without Lightning for wallet management and other payment rails
1244
+ - Tell them they can add Lightning later from the dashboard Settings
1245
+
1246
+ ---
1247
+
1248
+ STEP 4: Test everything
1249
+ Call setup_test_payment_capabilities to verify the full stack is working.
1250
+ Report results clearly — what passed, what failed, and why.
1251
+
1252
+ ---
1253
+
1254
+ STEP 5: Complete onboarding
1255
+ Call setup_complete_onboarding to mark setup as done and return a summary.
1256
+ Tell the user:
1257
+ - Their dashboard: https://agenticbtc.app/dashboard
1258
+ - To create agent wallets: go to Dashboard → Wallets → Create Wallet
1259
+ - Wallets are created by the owner through the dashboard — not automatically
1260
+
1261
+ ---
1262
+
1263
+ CRITICAL RULES:
1264
+ - NEVER create wallets for the user. Ever. Wallet creation is always a deliberate owner action.
1265
+ - NEVER store or repeat credentials back to the user in plain text after they've been submitted.
1266
+ - NEVER rush — one question at a time, wait for confirmation before moving on.
1267
+ - If something fails, call setup_diagnose_issues and explain the fix in plain language.
1268
+ - Celebrate wins: "✅ API key confirmed!", "⚡ Lightning node connected!", etc.`,
1228
1269
  }, null, 2),
1229
1270
  }],
1230
1271
  };