LNbits MCP Server

LNbits MCP Server

Enables AI assistants to manage Lightning wallets through LNbits, including balance checks, invoice creation, payments, and extension operations, all via natural language.

Category
访问服务器

README

<a href="https://lnbits.com" target="_blank" rel="noopener noreferrer"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://i.imgur.com/QE6SIrs.png"> <img src="https://i.imgur.com/fyKPgVT.png" alt="LNbits" style="width:280px"> </picture> </a>

LNbits MCP Server

License: MIT Built for LNbits

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.

What is MCP?

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.

Features

  • Wallet operations - check balances, view transaction history, get wallet details
  • Send and receive - pay Lightning invoices, pay Lightning addresses, create invoices
  • Extension support - LNURLp, TPoS, SatsPay, Watch-only wallets
  • Admin tools - node info, user management, system stats
  • Runtime config - configure your LNbits connection through chat, no env files needed
  • Secure - API keys are stored in memory only, never logged; HTTPS recommended for production
  • Rate limited - built-in request throttling to prevent accidental API floods

<a href="https://rumble.com/v6vxr70-lnbits-mcp-server-lnbits-in-your-ai.html"> <img src="https://github.com/lnbits/LNbits-MCP-Server/blob/main/LNbits_MCP.png" width="600" alt="Watch the LNbits MCP Server demo" /> <br/> <img src="https://img.shields.io/badge/%E2%96%B6%20Watch%20Demo-LNbits%20MCP%20in%20Action-7C3AED?style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0id2hpdGUiPjxwYXRoIGQ9Ik04IDV2MTRsMTEtN3oiLz48L3N2Zz4=&logoColor=white" alt="Watch Demo" /> </a>


Table of Contents


Quick Start

Three steps, takes about two minutes.

1. Install

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 --version first.

2. Add to your AI client

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.

3. Connect to your LNbits

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.

What you can say

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 alice@lnbits.com"
"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?"

Available Tools

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.

Configuration

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.

Wallet

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

Payments

Tool Description
pay_invoice Pay a BOLT11 Lightning invoice
pay_lightning_address Pay a Lightning address (user@domain.com)
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 user@domain.com". No need to create an invoice first.

Extensions (when enabled)

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

Admin (requires admin key)

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

Configuration Reference

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_KEY with api_key_header is all you need.

Running the Server Manually

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.

Troubleshooting

Server won't start

  • Check that Python 3.10+ is installed: python3 --version
  • Make sure you ran pip install -e . from the repo directory
  • Verify the lnbits-mcp-server command is available: which lnbits-mcp-server

Connection fails after configuring

  • Verify your LNbits instance is running and reachable from your machine
  • Double-check the API key - Admin and Invoice keys are different
  • Make sure you're using https:// for remote instances

AI client doesn't show LNbits tools

  • Restart your AI client after editing the config file
  • Check that the path in claude_desktop_config.json is correct
  • Look at your client's logs for MCP connection errors

Payments fail

  • Invoice key can only create invoices and check balances - use Admin key for sending payments
  • Check that your LNbits wallet has sufficient balance
  • For Lightning address payments, the recipient's server must be reachable

Development

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

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes and add tests
  4. Submit a pull request

Questions? Drop by the Telegram group first - a quick chat often saves a round-trip on the PR.

Powered by LNbits

LNbits is a free and open-source Lightning accounts system.

LNbits Docs Visit LNbits Shop Try myLNbits SaaS

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选