loading…
Search for a command to run...
loading…
Am MCP server for LNbits Lightning Network wallet integration.
Am MCP server for LNbits Lightning Network wallet integration.
Give your AI assistant a Lightning wallet. The LNbits MCP Server connects any MCP-compatible AI client to your LNbits instance - check balances, create invoices, send payments, and manage extensions, all through natural language.
Model Context Protocol (MCP) is an open standard that lets AI assistants use external tools. Instead of copy-pasting API responses into a chat, MCP gives your AI direct access to your LNbits wallet. You talk naturally, the AI calls the right API endpoint, and you see the result - all in one conversation.
Three steps, takes about two minutes.
git clone https://github.com/lnbits/LNbits-MCP-Server.git
cd LNbits-MCP-Server
pip install -e .
You need Python 3.10+ installed. If you're unsure, run
python3 --versionfirst.
Tell your MCP client where the server lives. For Claude Desktop, edit the config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"lnbits": {
"command": "lnbits-mcp-server"
}
}
}
Restart Claude Desktop after saving. The server only activates after a restart.
Now just talk to your AI. No extra config files needed - tell it your credentials in plain language:
Configure lnbits.
URL: https://your-lnbits-instance.com
Key: your_api_key_here
Auth method: api_key_header
That's it. Try asking "What's my wallet balance?" to confirm it works.
Where's my API key? Open your LNbits instance, look in the sidebar under "Node URL, API keys and API docs". Use the Admin key if you want to send payments, or the Invoice key if you only need to check balances and create invoices.
Just talk naturally. The AI figures out which tool to call.
"Check my wallet balance"
"Create an invoice for 1000 sats with memo 'Coffee payment'"
"Pay this invoice: lnbc10u1p3..."
"Send 500 sats to [email protected]"
"Show me my recent payments"
"Decode this invoice and tell me what it's for"
You can also chain requests: "Create a 5000 sat invoice and show me the QR code" or "Check if that last payment went through, and if so, what's my new balance?"
These are the tools the AI uses behind the scenes. You don't need to call them directly - just describe what you want and the AI picks the right one.
| Tool | Description |
|---|---|
configure_lnbits |
Set LNbits URL, API key, and auth method at runtime |
get_lnbits_configuration |
Show current connection settings |
test_lnbits_configuration |
Verify the connection works |
You only need to configure once per session. The server remembers your settings until you restart it.
| Tool | Description |
|---|---|
get_wallet_details |
Wallet info including balance and keys |
get_wallet_balance |
Current balance |
get_payments |
Payment history |
check_connection |
Test connection to LNbits |
| Tool | Description |
|---|---|
pay_invoice |
Pay a BOLT11 Lightning invoice |
pay_lightning_address |
Pay a Lightning address ([email protected]) |
get_payment_status |
Check status by payment hash |
decode_invoice |
Decode and inspect a Lightning invoice |
create_invoice |
Create a new Lightning invoice |
Tip: You can pay Lightning addresses directly - just say "Send 1000 sats to [email protected]". No need to create an invoice first.
These tools appear when you have the corresponding extensions installed on your LNbits instance.
| Tool | Description |
|---|---|
create_lnurlp_link / get_lnurlp_links |
LNURLp pay links |
create_tpos / get_tpos_list |
TPoS terminals |
create_satspay_charge / get_satspay_charges |
SatsPay charges |
create_watchonly_wallet / get_watchonly_wallets |
Watch-only wallets |
Only available when you connect with a Super User or admin-level API key.
| Tool | Description |
|---|---|
get_node_info |
Lightning node information |
list_users / create_user |
User management |
get_system_stats |
System statistics |
Most people just use the runtime config (step 3 above). But if you prefer environment variables, these work too:
| Variable | Description | Default |
|---|---|---|
LNBITS_URL |
LNbits instance URL | https://demo.lnbits.com |
LNBITS_API_KEY |
API key | - |
LNBITS_BEARER_TOKEN |
Bearer token (alternative auth) | - |
LNBITS_OAUTH2_TOKEN |
OAuth2 token (alternative auth) | - |
LNBITS_AUTH_METHOD |
api_key_header, api_key_query, http_bearer, or oauth2 |
api_key_header |
LNBITS_TIMEOUT |
Request timeout (seconds) | 30 |
LNBITS_MAX_RETRIES |
Max retries on failure | 3 |
LNBITS_RATE_LIMIT_PER_MINUTE |
Rate limit | 60 |
At least one auth method is required. For most setups,
LNBITS_API_KEYwithapi_key_headeris all you need.
Your AI client usually starts the server automatically. But if you want to test it directly or debug connection issues, you can run it yourself:
# Using the installed command
lnbits-mcp-server
# Or run directly with Python
python -m lnbits_mcp_server.server
You can also set credentials via environment variables instead of runtime config:
export LNBITS_URL="https://your-lnbits-instance.com"
export LNBITS_API_KEY="your_api_key_here"
lnbits-mcp-server
This is useful for testing outside an AI client, running in Docker, or integrating into scripts.
Server won't start
python3 --versionpip install -e . from the repo directorylnbits-mcp-server command is available: which lnbits-mcp-serverConnection fails after configuring
https:// for remote instancesAI client doesn't show LNbits tools
claude_desktop_config.json is correctPayments fail
git clone https://github.com/lnbits/LNbits-MCP-Server.git
cd LNbits-MCP-Server
pip install -e .[dev]
# Run tests
pytest
# Format
black src tests
isort src tests
# Type check
mypy src
Questions? Drop by the Telegram group first - a quick chat often saves a round-trip on the PR.
LNbits is a free and open-source Lightning accounts system.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"lnbits-lnbits-mcp-server": {
"command": "npx",
"args": []
}
}
}