跳到主要内容

Alby Bitcoin Payments 扩展

本教程介绍如何将 Alby Bitcoin Payments MCP 服务器 添加为 goose 扩展,以便与 Lightning 钱包交互、收付款、列出交易、把法币金额换算为 sats、向 Lightning 地址请求发票,以及与付费 MCP 工具交互(例如用 PaidMCP 构建的工具)。

信息

你需要一个支持 NWC 的 Lightning 钱包。如果还没有,可以试试 Alby Hub。

快速安装

环境变量

NWC_CONNECTION_STRING: nostr+walletconnect://...

配置​

信息

运行此命令需要在系统上安装 Node.js,因为它使用 npx。

或者你可以使用 Alby 托管的 MCP(见下方远程选项)。

  1. Launch the installer
  2. Click Yes to confirm the installation
  3. 从你的 Lightning 钱包获取 NWC 连接密钥(nostr+walletconnect://...),并粘贴到 “NWC Connection Secret” 字段
  4. Click Add Extension
  5. Click the button in the top-left to open the sidebar
  6. Navigate to the chat

使用示例​

Memory 扩展

使用内置的 memory 扩展保存联系人。例如:“我朋友 Rene 的 Lightning 地址是 reneaaron@getalby.com。请把它保存到你的记忆里。”

goose 提示词​

向 Rene 支付 1 美元,附言 “Hi Rene, it's Roland. I'm making a goose tutorial!”

goose 输出​

CLI
工具调用

─── fiat_to_sats | alby ──────────────────────────

fiat_amount: 1

fiat_currency: USD

─── request_invoice | alby ──────────────────────────

amount_in_sats: 935

description: ...

lightning_address: reneaaron@getalby.com

─── pay_invoice | alby ──────────────────────────

invoice: ...

✅ 支付成功!

我已成功向 Rene 的 reneaaron@getalby.com 发送 1 美元(935 sats),附言为:“Hi Rene, it's Roland. I'm making a goose tutorial!”

交易详情:

  • 金额:935 sats(1 美元)
  • 手续费:3 sats
  • 总花费:938 sats
  • 附言:“Hi Rene, it's Roland. I'm making a goose tutorial!”
  • 支付哈希:cd30642470d81c2e8eb04c9ac95e679c53778537aecdf5554b15288ac42fe129

Rene 会收到确认消息 “Thanks, sats received!”。