A Model Context Protocol (MCP) server for LNbits Lightning Network wallet integration. This server allows AI assistants to interact with LNbits through a comprehensive set of tools for wallet management, payments, invoices, and extensions. Once configured, you can interact with your LNbits wallet through your favorite AI assistant. - ⚡ Core Wallet Operations: Get wallet details, balance, and trans
Add this skill
npx mdskills install lnbits/lnbits-mcp-serverComprehensive Lightning Network integration with runtime configuration and extensive wallet management tools
A Model Context Protocol (MCP) server for LNbits Lightning Network wallet integration. This server allows AI assistants to interact with LNbits through a comprehensive set of tools for wallet management, payments, invoices, and extensions.
Once configured, you can interact with your LNbits wallet through your favorite AI assistant.
"Check my wallet balance"
"Create an invoice for 1000 sats with memo 'Coffee payment'"
"Pay this invoice: lnbc10u1p3..."
"Send 500 sats to bc@sats.pw"
"Pay Lightning address alice@lnbits.com 1000 sats with comment 'Thanks for the coffee!'"
"Show me my recent payments"
"What's the status of payment hash abc123..."
git clone https://github.com/your-repo/lnbits-mcp-server
cd lnbits-mcp-server
pip install -e .
git clone https://github.com/your-repo/lnbits-mcp-server
cd lnbits-mcp-server
pip install -e .[dev]
The LNbits MCP server supports runtime configuration through MCP tools, allowing you to configure the server directly from your LLM client without needing to modify environment variables or restart the server.
Configure lnbits.
URL: https://demo.lnbits.com
Key: [your api key]
Auth method: api_key_header
Available configuration tools:
configure_lnbits - Configure LNbits connection parameters at runtimeget_lnbits_configuration - Get current configuration statustest_lnbits_configuration - Test the current configurationThe server still supports environment variable configuration for backward compatibility:
# LNbits instance URL
LNBITS_URL=https://your-lnbits-instance.com
# Authentication (choose one method)
LNBITS_API_KEY=your_api_key_here
LNBITS_BEARER_TOKEN=your_bearer_token
LNBITS_OAUTH2_TOKEN=your_oauth2_token
# Authentication method (optional, defaults to api_key_header)
LNBITS_AUTH_METHOD=api_key_header # or api_key_query, http_bearer, oauth2
# Request settings (optional)
LNBITS_TIMEOUT=30
LNBITS_MAX_RETRIES=3
LNBITS_RATE_LIMIT_PER_MINUTE=60
| Variable | Description | Default | Required |
|---|---|---|---|
LNBITS_URL | Base URL for LNbits instance | https://demo.lnbits.com | No |
LNBITS_API_KEY | API key for authentication | None | Yes* |
LNBITS_BEARER_TOKEN | Bearer token for authentication | None | Yes* |
LNBITS_OAUTH2_TOKEN | OAuth2 token for authentication | None | Yes* |
LNBITS_AUTH_METHOD | Authentication method | api_key_header | No |
LNBITS_TIMEOUT | Request timeout in seconds | 30 | No |
LNBITS_MAX_RETRIES | Maximum request retries | 3 | No |
LNBITS_RATE_LIMIT_PER_MINUTE | Rate limit per minute | 60 | No |
*At least one authentication method must be provided.
# Using the installed command
lnbits-mcp-server
# Or run directly with Python
python -m lnbits_mcp_server.server
For Claude Desktop, add to your claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\\Claude\\claude_desktop_config.json
{
"mcpServers": {
"lnbits": {
"command": "/Users/[username]/Desktop/lnbits-mcp-server/venv/bin/lnbits-mcp-server"
}
}
}
Note: With runtime configuration, you no longer need to set environment variables in the config file. Configure the server directly through your LLM client after setup.
Add the server to your MCP client configuration:
{
"mcpServers": {
"lnbits": {
"command": "lnbits-mcp-server"
}
}
}
Note: With runtime configuration, you can configure the server directly through your MCP client after setup.
configure_lnbits - Configure LNbits connection parameters at runtimeget_lnbits_configuration - Get current configuration statustest_lnbits_configuration - Test the current configurationget_wallet_details - Get wallet information including balance and keysget_wallet_balance - Get current wallet balanceget_payments - Get payment historycheck_connection - Test connection to LNbits instancepay_invoice - Pay a Lightning invoice (BOLT11)pay_lightning_address - Pay a Lightning address (e.g., user@domain.com)get_payment_status - Check payment status by hashdecode_invoice - Decode and analyze a Lightning invoicecreate_invoice - Create a new Lightning invoicecreate_lnurlp_link - Create LNURLp pay linksget_lnurlp_links - List LNURLp pay linkscreate_tpos - Create TPoS terminalsget_tpos_list - List TPoS terminalscreate_satspay_charge - Create SatsPay chargesget_satspay_charges - List SatsPay chargescreate_watchonly_wallet - Create watch-only walletsget_watchonly_wallets - List watch-only walletsget_node_info - Get Lightning node informationlist_users - List all userscreate_user - Create new usersget_system_stats - Get system statisticsfrom lnbits_mcp_server.client import LNbitsClient
async def example():
client = LNbitsClient()
# Get wallet balance
balance = await client.get_wallet_balance()
print(f"Current balance: {balance['balance']} msats")
# Create an invoice
invoice = await client.create_invoice(
amount=1000, # 1000 sats
memo="Test payment"
)
print(f"Invoice: {invoice['bolt11']}")
# Pay an invoice
payment = await client.pay_invoice("lnbc1...")
print(f"Payment hash: {payment['payment_hash']}")
# Pay a Lightning address
lightning_payment = await client.pay_lightning_address(
lightning_address="edward@sats.pw",
amount_sats=1000,
comment="Payment via Lightning address"
)
print(f"Lightning address payment hash: {lightning_payment['payment_hash']}")
git clone https://github.com/your-repo/lnbits-mcp-server
cd lnbits-mcp-server
pip install -e .[dev]
pytest
# Format code
black src tests
isort src tests
# Type checking
mypy src
Configure lnbits.
URL: https://demo.lnbits.com
Key: [your api key]
Auth method: api_key_header
The server follows a modular architecture:
server.py: Main MCP server implementationclient.py: HTTP client for LNbits APItools/: Tool implementations organized by functionality
core.py: Wallet operationspayments.py: Payment processinginvoices.py: Invoice managementextensions.py: Extension integrationsadmin.py: Administrative toolsmodels/: Pydantic data modelsutils/: Utility functions and authenticationMIT License - see LICENSE file for details.
pip install -e .claude_desktop_config.jsonFor detailed setup instructions, see QUICK_START.md
Built with ❤️ for the Bitcoin Lightning Network community
Install via CLI
npx mdskills install lnbits/lnbits-mcp-serverLNbits MCP Server is a free, open-source AI agent skill. A Model Context Protocol (MCP) server for LNbits Lightning Network wallet integration. This server allows AI assistants to interact with LNbits through a comprehensive set of tools for wallet management, payments, invoices, and extensions. Once configured, you can interact with your LNbits wallet through your favorite AI assistant. - ⚡ Core Wallet Operations: Get wallet details, balance, and trans
Install LNbits MCP Server with a single command:
npx mdskills install lnbits/lnbits-mcp-serverThis downloads the skill files into your project and your AI agent picks them up automatically.
LNbits MCP Server works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Gemini Cli, Amp, Roo Code, Goose. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.