lightning-wallet-mcp 1.8.0 → 1.9.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 CHANGED
@@ -163,10 +163,10 @@ Every command prints JSON to stdout (add `--human` for a readable view). Errors
163
163
 
164
164
  ## Pricing
165
165
 
166
- - Platform fee: **1% of the amount, rounded down**. Payments under 100 sats pay no fee.
166
+ - Platform fee: **1% of the amount, rounded down, no minimum** (payments under 100 sats pay no fee) on payments (`pay_invoice`, `pay_lightning_address`, `keysend`, `nostr_zap`) and on paid-API pay-through (`pay_l402_api`). Never more than 1%. `get_info` returns the live schedule as `platform_fees`.
167
167
  - Routing fees: charged at cost. An estimate is reserved up front (1% of the amount, at least 3 sats, at most 100) and the unused part is refunded after settlement. Pass `max_fee_sats` to override.
168
- - Deposits, receiving, same-operator agent transfers and webhooks: free.
169
- - Withdrawals: 1% platform fee plus routing, minimum 10 sats.
168
+ - Deposits, receiving, operator-to-agent and same-operator agent transfers, and webhooks: free. A payment to another operator's agent pays the 1% payment fee.
169
+ - Withdrawals to your own wallet (`withdraw`, `create_withdraw_link`): **no platform fee**, routing at cost, minimum 10 sats.
170
170
  - X402 payments: 1% platform fee plus a 1% exchange spread on the USDC conversion.
171
171
 
172
172
  Every payment response includes `platform_fee_sats`, `routing_fee_sats` and `total_cost`.
package/dist/index.js CHANGED
@@ -375,7 +375,7 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
375
375
  },
376
376
  {
377
377
  name: 'pay_l402_api',
378
- description: 'Make a request to a paid API. Supports L402 (Lightning) and X402 (USDC on Base) protocols. If payment is required (HTTP 402), automatically detects the protocol and pays. L402 is preferred when both are available. Works with an operator key (pays from the operator wallet; a default agent is provisioned automatically) or an agent key.',
378
+ description: 'Make a request to a paid API. Supports L402 (Lightning) and X402 (USDC on Base) protocols. Platform fee on the API price: 1%, rounded down, no minimum, reported as fee in the response. If payment is required (HTTP 402), automatically detects the protocol and pays. L402 is preferred when both are available. Works with an operator key (pays from the operator wallet; a default agent is provisioned automatically) or an agent key.',
379
379
  inputSchema: {
380
380
  type: 'object',
381
381
  properties: {
@@ -400,7 +400,7 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
400
400
  },
401
401
  {
402
402
  name: 'pay_invoice',
403
- description: 'Pay a BOLT11 Lightning invoice. Returns the preimage as proof of payment. Works with an operator key (pays from the operator wallet; a default agent is provisioned automatically) or an agent key. If the response says pending:true the payment is still in flight: do NOT retry, check get_transactions instead.',
403
+ description: 'Pay a BOLT11 Lightning invoice. Platform fee: 1% of the amount, rounded down, no minimum (nothing under 100 sats), reported as platform_fee_sats; get_info returns the current schedule. Returns the preimage as proof of payment. Works with an operator key (pays from the operator wallet; a default agent is provisioned automatically) or an agent key. If the response says pending:true the payment is still in flight: do NOT retry, check get_transactions instead.',
404
404
  inputSchema: {
405
405
  type: 'object',
406
406
  properties: {
@@ -511,7 +511,7 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
511
511
  },
512
512
  {
513
513
  name: 'fund_agent',
514
- description: 'Transfer sats from operator balance to an agent.',
514
+ description: 'Transfer sats from operator balance to an agent. No platform fee.',
515
515
  inputSchema: {
516
516
  type: 'object',
517
517
  properties: {
@@ -626,7 +626,7 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
626
626
  // ==========================================
627
627
  {
628
628
  name: 'get_budget_status',
629
- description: 'Get budget status for an agent - shows limit, spent, and remaining. Works with operator or agent keys.',
629
+ description: 'Get budget status for an agent - shows limit, spent, remaining and the platform_fees schedule that counts against it. Works with operator or agent keys.',
630
630
  inputSchema: {
631
631
  type: 'object',
632
632
  properties: {
@@ -702,7 +702,7 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
702
702
  // ==========================================
703
703
  {
704
704
  name: 'get_info',
705
- description: 'Get service information including version, status, limits, and supported features. No API key required — works before registering.',
705
+ description: 'Get service information including version, status, limits, supported features and the current platform_fees schedule (percent and minimum per action). No API key required — works before registering.',
706
706
  inputSchema: {
707
707
  type: 'object',
708
708
  properties: {},
@@ -734,7 +734,7 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
734
734
  // ==========================================
735
735
  {
736
736
  name: 'withdraw',
737
- description: 'Withdraw funds from the operator account to an external Lightning invoice (minimum 10 sats; 1% platform fee, none under 100 sats; unused routing reserve refunded). REQUIRES OPERATOR KEY. Subject to a security cooldown after key rotation.',
737
+ description: 'Withdraw funds from the operator account to an external Lightning invoice (minimum 10 sats; no platform fee, only the Lightning routing fee at cost; unused routing reserve refunded). REQUIRES OPERATOR KEY. Subject to a security cooldown after key rotation.',
738
738
  inputSchema: {
739
739
  type: 'object',
740
740
  properties: {
@@ -745,7 +745,7 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
745
745
  },
746
746
  {
747
747
  name: 'create_withdraw_link',
748
- description: 'Create an LNURL-withdraw link for the operator to receive funds. Opens in browser for QR code scanning with any Lightning wallet. Omit amount_sats to sweep full balance (minimum 10 sats after fees). REQUIRES OPERATOR KEY.',
748
+ description: 'Create an LNURL-withdraw link for the operator to receive funds. Opens in browser for QR code scanning with any Lightning wallet. Omit amount_sats to sweep full balance (minimum 10 sats after the routing reserve). No platform fee. REQUIRES OPERATOR KEY.',
749
749
  inputSchema: {
750
750
  type: 'object',
751
751
  properties: {
@@ -773,7 +773,7 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
773
773
  },
774
774
  {
775
775
  name: 'pay_lightning_address',
776
- description: 'Pay to a Lightning address (user@domain.com format). Works with an operator key (pays from the operator wallet) or an agent key.',
776
+ description: 'Pay to a Lightning address (user@domain.com format). Platform fee: 1% of the amount, rounded down, no minimum, reported as platform_fee_sats. Works with an operator key (pays from the operator wallet) or an agent key.',
777
777
  inputSchema: {
778
778
  type: 'object',
779
779
  properties: {
@@ -808,7 +808,7 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
808
808
  },
809
809
  {
810
810
  name: 'nostr_zap',
811
- description: 'Send a Nostr zap (NIP-57 Lightning payment with optional Nostr event). If the recipient supports NIP-57, a proper zap receipt is created. Otherwise falls back to a regular Lightning address payment. REQUIRES AGENT KEY with Nostr identity set.',
811
+ description: 'Send a Nostr zap (NIP-57 Lightning payment with optional Nostr event). If the recipient supports NIP-57, a proper zap receipt is created. Otherwise falls back to a regular Lightning address payment. REQUIRES AGENT KEY with Nostr identity set. Paid as a Lightning-address payment: platform fee 1% of the amount, rounded down, no minimum, reported as platform_fee_sats.',
812
812
  inputSchema: {
813
813
  type: 'object',
814
814
  properties: {
@@ -827,7 +827,7 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
827
827
  // ==========================================
828
828
  {
829
829
  name: 'transfer_to_agent',
830
- description: 'Transfer sats between agents or from operator to agent. REQUIRES OPERATOR KEY.',
830
+ description: 'Transfer sats between agents or from operator to agent. No platform fee. REQUIRES OPERATOR KEY.',
831
831
  inputSchema: {
832
832
  type: 'object',
833
833
  properties: {
@@ -877,7 +877,7 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
877
877
  },
878
878
  {
879
879
  name: 'keysend',
880
- description: 'Send a payment directly to a node without an invoice (keysend/spontaneous payment). REQUIRES AGENT KEY.',
880
+ description: 'Send a payment directly to a node without an invoice (keysend/spontaneous payment). Platform fee: 1% of the amount, rounded down, no minimum, reported as platform_fee_sats. REQUIRES AGENT KEY.',
881
881
  inputSchema: {
882
882
  type: 'object',
883
883
  properties: {
@@ -1546,6 +1546,7 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
1546
1546
  total_spent_sats: result.totalSpentSats,
1547
1547
  remaining_sats: result.remainingSats,
1548
1548
  has_budget: result.hasBudget,
1549
+ platform_fees: result.rawResponse?.platform_fees,
1549
1550
  }, null, 2),
1550
1551
  },
1551
1552
  ],
@@ -1684,6 +1685,7 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
1684
1685
  max_payment_sats: result.maxPaymentSats,
1685
1686
  min_payment_sats: result.minPaymentSats,
1686
1687
  supported_features: result.supportedFeatures,
1688
+ platform_fees: result.rawResponse?.platform_fees,
1687
1689
  }, null, 2),
1688
1690
  },
1689
1691
  ],
@@ -1813,6 +1815,8 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
1813
1815
  message: `Paid ${parsed.amount_sats} sats to ${parsed.address}`,
1814
1816
  amount_sats: result.amountSats,
1815
1817
  fee_sats: result.feeSats,
1818
+ routing_fee_sats: result.routingFeeSats,
1819
+ platform_fee_sats: result.platformFeeSats,
1816
1820
  payment_hash: result.paymentHash,
1817
1821
  new_balance: result.newBalance,
1818
1822
  }, null, 2),
@@ -1869,6 +1873,8 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
1869
1873
  (result.zapType === 'nip57' ? ' (NIP-57 zap receipt created)' : ' (regular payment, recipient does not support NIP-57)'),
1870
1874
  amount_sats: result.amountSats,
1871
1875
  fee_sats: result.feeSats,
1876
+ routing_fee_sats: result.routingFeeSats,
1877
+ platform_fee_sats: result.platformFeeSats,
1872
1878
  payment_hash: result.paymentHash,
1873
1879
  new_balance: result.newBalance,
1874
1880
  zap_type: result.zapType,
@@ -522,6 +522,8 @@ export declare class LightningFaucetClient {
522
522
  nostrZap(address: string, amountSats: number, recipientPubkey?: string, content?: string, eventId?: string, relays?: string[]): Promise<{
523
523
  amountSats: number;
524
524
  feeSats: number;
525
+ routingFeeSats: number;
526
+ platformFeeSats: number;
525
527
  paymentHash: string;
526
528
  newBalance: number;
527
529
  zapType: 'nip57' | 'fallback';
@@ -864,9 +864,16 @@ class LightningFaucetClient {
864
864
  if (relays)
865
865
  data.relays = relays;
866
866
  const result = await this.request('nostr_zap', data);
867
+ // The backend settles a zap through the Lightning-address path, which reports
868
+ // routing_fee_sats and platform_fee_sats separately; keep the split so the tool
869
+ // can show the platform fee it advertised, plus the combined feeSats.
870
+ const routingFeeSats = result.routing_fee_sats || 0;
871
+ const platformFeeSats = result.platform_fee_sats || 0;
867
872
  return {
868
873
  amountSats: result.amount_sats || amountSats,
869
- feeSats: result.fee_sats ?? ((result.routing_fee_sats || 0) + (result.platform_fee_sats || 0)),
874
+ feeSats: result.fee_sats ?? (routingFeeSats + platformFeeSats),
875
+ routingFeeSats,
876
+ platformFeeSats,
870
877
  paymentHash: result.payment_hash || '',
871
878
  newBalance: result.new_balance || 0,
872
879
  zapType: result.zap_type || 'fallback',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lightning-wallet-mcp",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "mcpName": "io.github.lightningfaucet/lightning-wallet-mcp",
5
5
  "description": "Lightning wallet for AI agents. MCP server + CLI. Works with Claude Code, OpenClaw, Cursor, and any agent framework.",
6
6
  "main": "dist/index.js",