AgentBTC MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "AGENTBTC_LND_HOST=${AGENTBTC_LND_HOST}" -e "AGENTBTC_LND_MACAROON=${AGENTBTC_LND_MACAROON}" agentbtc -- npx agentbtc-mcp start
Required:AGENTBTC_LND_HOSTAGENTBTC_LND_MACAROON+ 2 optional
README.md

BYON (Bring Your Own Node) Bitcoin payments for AI agents

AgentBTC MCP Server

BYON (Bring Your Own Node) Bitcoin payments for AI agents via Model Context Protocol

The world's first Bitcoin/Lightning MCP server. Your Lightning node credentials never leave your machine. Works with Claude Desktop, OpenClaw, and any MCP-compatible AI tool.

๐ŸŒŸ Features

  • ๐Ÿ”’ True BYON: Your Lightning credentials never leave your machine โ€” zero-trust architecture
  • โšก Lightning Network: Fast, cheap Bitcoin micropayments (~200ms per payment)
  • ๐Ÿค– 13 MCP Tools: Complete wallet management, payments, invoices, channels, and L402
  • ๐Ÿ“Š L402 Protocol: HTTP 402 "Payment Required" for API monetization
  • ๐Ÿ›ก๏ธ Non-Custodial: Zero counterparty risk โ€” you control your Bitcoin
  • ๐Ÿท๏ธ Lightning Addresses: Send to bot@yourname.agentbtc.io
  • ๐Ÿ’ณ Spending Policies: Per-transaction, daily, and monthly limits for agent wallets

๐Ÿš€ Quick Start

Option 1: npx (no install)

npx agentbtc-mcp start

Option 2: Global install

npm install -g agentbtc-mcp
agentbtc-mcp start

Claude Desktop Config

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "agentbtc": {
      "command": "npx",
      "args": ["-y", "agentbtc-mcp", "start"],
      "env": {
        "AGENTBTC_LND_HOST": "your-node:8080",
        "AGENTBTC_LND_MACAROON": "/path/to/readonly.macaroon",
        "AGENTBTC_API_URL": "https://agentbtc.io",
        "AGENTBTC_API_KEY": "your-api-key"
      }
    }
  }
}

๐Ÿ”ง Available Tools (13)

Tool Description
list_agent_wallets List all agent wallets
get_agent_balance Check wallet balance
create_agent_wallet Create a new agent wallet
delete_agent_wallet Remove an agent wallet
get_node_info Lightning node status
create_lightning_invoice Generate payment requests
pay_lightning_invoice Send Lightning payments
send_to_lightning_address Pay Lightning addresses
decode_invoice Decode BOLT11 invoices
check_channel_balance Channel liquidity info
list_channels List Lightning channels
get_transaction_history Payment history
access_l402_api Access L402-protected APIs

โš™๏ธ Configuration

Environment Variables

Variable Required Description
AGENTBTC_LND_HOST Yes LND REST API endpoint (e.g., localhost:8080)
AGENTBTC_LND_MACAROON Yes Path to LND macaroon file
AGENTBTC_API_URL No AgentBTC server URL (default: http://localhost:8000)
AGENTBTC_API_KEY No Your owner API key for wallet management

CLI Commands

agentbtc-mcp start          # Start MCP server
agentbtc-mcp setup          # Interactive Claude Desktop setup
agentbtc-mcp test           # Test Lightning node connection
agentbtc-mcp config         # Show current configuration
agentbtc-mcp version        # Show version

๐Ÿ“‹ Requirements

  • Node.js 18+
  • Lightning Node โ€” LND with REST API enabled
  • MCP Client โ€” Claude Desktop, OpenClaw, or compatible

๐Ÿ”’ Security Model

AgentBTC uses a BYON (Bring Your Own Node) architecture:

  1. Your Lightning node credentials stay on your machine
  2. The MCP server runs locally, connecting directly to your node
  3. No credentials are ever transmitted to AgentBTC servers
  4. Agent wallets have configurable spending limits
  5. All payments are logged with full audit trail

๐Ÿงช Testing

# Test with testnet
export AGENTBTC_LND_HOST=your-testnet-node:8080
export AGENTBTC_LND_MACAROON=/path/to/testnet/readonly.macaroon
agentbtc-mcp test

๐Ÿ†˜ Troubleshooting

"Connection refused"

  • Verify your Lightning node is running
  • Check AGENTBTC_LND_HOST โ€” usually localhost:8080 for LND REST
  • For Voltage nodes: use your-node.t.voltageapp.io:8080

"Permission denied"

  • Check macaroon file exists and is readable
  • Use readonly.macaroon for safety

"Invalid macaroon"

  • Ensure you're using the correct network (mainnet vs testnet)
  • Try copying the macaroon to a new path

๐ŸŒ Links

๐Ÿ“œ License

MIT โ€” see LICENSE.

Built by BK Block Solutions โšก

Tools (13)

list_agent_walletsList all agent wallets
get_agent_balanceCheck wallet balance
create_agent_walletCreate a new agent wallet
delete_agent_walletRemove an agent wallet
get_node_infoLightning node status
create_lightning_invoiceGenerate payment requests
pay_lightning_invoiceSend Lightning payments
send_to_lightning_addressPay Lightning addresses
decode_invoiceDecode BOLT11 invoices
check_channel_balanceChannel liquidity info
list_channelsList Lightning channels
get_transaction_historyPayment history
access_l402_apiAccess L402-protected APIs

Environment Variables

AGENTBTC_LND_HOSTrequiredLND REST API endpoint
AGENTBTC_LND_MACAROONrequiredPath to LND macaroon file
AGENTBTC_API_URLAgentBTC server URL
AGENTBTC_API_KEYYour owner API key for wallet management

Configuration

claude_desktop_config.json
{"mcpServers": {"agentbtc": {"command": "npx", "args": ["-y", "agentbtc-mcp", "start"], "env": {"AGENTBTC_LND_HOST": "your-node:8080", "AGENTBTC_LND_MACAROON": "/path/to/readonly.macaroon", "AGENTBTC_API_URL": "https://agentbtc.io", "AGENTBTC_API_KEY": "your-api-key"}}}}

Try it

โ†’Check the current balance of my agent wallet.
โ†’Create a new Lightning invoice for 5000 sats.
โ†’Pay this Lightning invoice: [invoice_string].
โ†’List my current Lightning channels and check their liquidity.
โ†’Access the L402-protected API at [url] using my wallet.

Frequently Asked Questions

What are the key features of AgentBTC?

Zero-trust architecture where Lightning credentials stay local. Support for Lightning Network micropayments. Complete wallet management and payment processing tools. L402 protocol support for API monetization. Configurable spending limits for agent wallets.

What can I use AgentBTC for?

Enabling AI agents to pay for API access via L402. Automating micropayments for content or services. Managing agent-specific budgets for autonomous tasks. Monitoring Lightning node liquidity and status via AI.

How do I install AgentBTC?

Install AgentBTC by running: npx agentbtc-mcp start

What MCP clients work with AgentBTC?

AgentBTC works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep AgentBTC docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare