Get the FREE Ultimate OpenClaw Setup Guide →

LNbits

An MCP server for LNbits

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio lnbits-lnbits-mcp-server python -m lnbits_mcp_server.server \
  --env LNBITS_URL="Base LNbits URL (e.g., https://your-lnbit-instance.com)" \
  --env LNBITS_API_KEY="Your LNbits API key (required if using api_key_header/auth)" \
  --env LNBITS_TIMEOUT="Request timeout in seconds (default 30)" \
  --env LNBITS_AUTH_METHOD="Authentication method (api_key_header, api_key_query, http_bearer, oauth2). Defaults to api_key_header" \
  --env LNBITS_MAX_RETRIES="Maximum request retries (default 3)" \
  --env LNBITS_BEARER_TOKEN="Bearer token for LNbits authentication" \
  --env LNBITS_OAUTH2_TOKEN="OAuth2 token for LNbits authentication" \
  --env LNBITS_RATE_LIMIT_PER_MINUTE="Allowed requests per minute (default 60)"

How to use

LNbits MCP Server provides a structured interface to manage a LNbits wallet, perform payments and invoices, and interact with LNbits extensions. The server exposes a suite of tools categorized into configuration, core wallet operations, payments, invoices, extensions, and admin capabilities. You can drive these tools via an LLM or a client by sending tool invocations such as get_wallet_balance, create_invoice, pay_invoice, or pay_lightning_address. The server supports runtime configuration, so you can configure LNbits connections and operational parameters directly from your MCP client without restarting the server. Authentication can be configured with API keys, Bearer tokens, or OAuth2, and the server includes type-safe models and structured logging for easier debugging and observability.

How to install

Prerequisites:

  • Python 3.10+ installed on the host
  • git available
  • Optional: virtual environment (recommended)

Installation steps:

  1. Clone the repository: git clone https://github.com/your-repo/lnbits-mcp-server
  2. Change into the project directory: cd lnbits-mcp-server
  3. Install the package (editable mode, includes runtime dependencies): pip install -e .
  4. (Optional for development) Install extra dev dependencies: pip install -e .[dev]
  5. Run the server:

    Using the recommended Python entrypoint

    python -m lnbits_mcp_server.server

Notes:

  • If you prefer a different command, you can run via your environment’s entry points or a startup script that points to python -m lnbits_mcp_server.server.
  • For production deployments, consider using a process manager (e.g., systemd, PM2 for NodeScript wrappers, or Docker) to ensure the MCP server stays running and restarts on failures.

Additional notes

Tips and common considerations:

  • Runtime configuration is supported; prefer configuring LNbits connection parameters at runtime from your MCP client to avoid editing environment variables or restarting the server.
  • If you enable extensions (LNURLp, TPoS, SatsPay, etc.), ensure the respective endpoints are reachable and authenticated as needed.
  • Ensure your LNbits instance URL and authentication method are correctly set to prevent authentication failures.
  • Use the provided admin tools only if you have appropriate access; some admin operations require elevated permissions.
  • Enable logging and consider configuring a suitable log level to aid debugging in production.

Related MCP Servers

Sponsor this space

Reach thousands of developers