Skip to content
Skills Library
Finance & accounting · Tool integration

lnbits-mcp

/lnbits-mcp

Connect nostr-core to a LNbits Lightning wallet via NWC and set up the LNbits MCP Server for conversational wallet control. Covers getting an NWC connection string from LNbits, connecting with the NWC class, verifying capabilities, installing and configuring the LNbits MCP Server (30+ tools), and Claude Desktop integration. Use when user mentions LNbits, wants to set up a Lightning wallet, or asks about MCP integration.

Repository
nostr-core ↗
Licence
MIT
Last repository change
13.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
10
Deprecation

No signals detected. Repository changed on 13.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Connect nostr-core to a LNbits Lightning wallet via NWC and set up the LNbits MCP Server for conversational wallet control. Covers getting an NWC connection string from LNbits, connecting with the NWC class, verifying capabilities, installing and configuring the LNbits MCP Server (30+ tools), and Claude Desktop integration. Use when user mentions LNbits, wants to set up a Lightning wallet, or asks about MCP integration.

Arguments

/lnbits-mcp [connect, mcp, or full]
Original author description

Connect nostr-core to a LNbits Lightning wallet via NWC and set up the LNbits MCP Server for conversational wallet control. Covers getting an NWC connection string from LNbits, connecting with the NWC class, verifying capabilities, installing and configuring the LNbits MCP Server (30+ tools), and Claude Desktop integration. Use when user mentions LNbits, wants to set up a Lightning wallet, or asks about MCP integration.

How it works

  1. What You Need
  2. Step 1: Get an NWC Connection String from LNbits
  3. Step 2: Connect with nostr-core
  4. Step 3: Verify Capabilities
  5. Step 4: Basic Operations
  6. Error Handling
  7. LNbits MCP Server (Optional)
  8. Resources
Original SKILL.md headings · 222 lines, 754 words
SKILL.md preview
---
name: lnbits-mcp
description: Connect nostr-core to a LNbits Lightning wallet via NWC and set up the LNbits MCP Server for conversational wallet control. Covers getting an NWC connection string from LNbits, connecting with the NWC class, verifying capabilities, installing and configuring the LNbits MCP Server (30+ tools), and Claude Desktop integration. Use when user mentions LNbits, wants to set up a Lightning wallet, or asks about MCP integration.
user-invocable: true
argument-hint: "[connect, mcp, or full]"
---

# LNbits MCP Integration with nostr-core

You are an expert in connecting nostr-core to LNbits and setting up the LNbits MCP Server for AI agent wallet control. You help developers get NWC connection strings from LNbits, wire up nostr-core's NWC client, verify wallet capabilities, and configure the LNbits MCP Server so AI agents can manage wallets through natural conversation. You know both the programmatic (nostr-core) and conversational (MCP) paths and recommend the right one for each use case.

## What You Need

| Component | What it does | Link |
|-----------|-------------|------|
| LNbits instance | Lightning wallet backend | https://lnbits.com |
| NWC extension | Generates NWC connection strings | Enabled in LNbits Extensions |
| nostr-core | Connects to the wallet via NWC | `npm install nostr-core` |

## Step 1: Get an NWC Connection String from LNbits

1. Open your LNbits instance (self-hosted or `https://demo.lnbits.com` for testing)
2. Go to **Extensions** in the sidebar
3. Enable the **Nostr Wallet Connect (NWC)** extension
4. Open the NWC extension and create a new connection
5. Set permissions (which methods the connection can use) and budget limits
6. Copy the connection string -- it starts with `nostr+walletconnect://`

Store it securely:

```
# .env (never commit this file)
NWC_CONNECTION_STRING=nostr+walletconnect://pubkey?relay=wss://...&secret=...
```

## Step 2: Connect with nostr-core

```ts
import { NWC } from 'nostr-core'

const nwc = new NWC(process.env.NWC_CONNECTION_STRING)

try {
  await nwc.connect()

  const info = await nwc.getInfo()
  console.log('Wallet:', info.alias)
  console.log('Methods:', info.methods)

  const { balance } = await nwc.getBalance()
  console.log('Balance:', Math.floor(balance / 1000), 'sats')
} finally {
  nwc.close()
}
```

## Step 3: Verify Capabilities

LNbits NWC connections can have restricted permissions. Always check:

```ts
const info = await nwc.getInfo()

const can = {
  pay:          info.methods.includes('pay_invoice'),
  receive:      info.methods.includes('make_invoice'),
  history:      info.methods.includes('list_transactions'),
  balance:      info.methods.includes('get_balance'),
  budget:       info.methods.includes('get_budget'),
  notifications: info.methods.includes('notifications')
}

console.log('Capabilities:', can)
```

> If a method is missing, the LNbits NWC connection was created without that permission. Go back to LNbits and update the connection settings.

## Step 4: Basic Operations

### Check balance

```ts
const { balance } = await nwc.getBalance()
console.log(Math.floor(balance / 1000), 'sats')
```

### Create an invoice

```ts
const invoice = await nwc.makeInvoice({
  amount: 1000 * 1000, // 1000 sats in msats
  description: 'Payment to agent'
})
console.log('Invoice:', invoice.invoice)
```

### Pay an invoice

```ts
import { NWCWalletError } from 'nostr-core'

try {
  const result = await nwc.payInvoice('lnbc...')
  console.log('Preimage:', result.preimage)
} catch (err) {
  if (err instanceof NWCWalletError) {
    console.error(err.code, err.message)
  }
}
```

### Listen for payments

```ts
nwc.on('payment_received', (notification) => {
  const sats = Math.floor(notification.notification.amount / 1000)
  console.log(`Received ${sats} sats`)
})
```

## Error Handling

```ts
import {
  NWCWalletError,
  NWCTimeoutError,
  NWCConnectionError,
  NWCDecryptionError
} from 'nostr-core'

try {
  await nwc.payInvoice(bolt11)
} catch (err) {
  if (err instanceof NWCWalletError) {
    // INSUFFICIENT_BALANCE, PAYMENT_FAILED, QUOTA_EXCEEDED, etc.
    console.error('Wallet:', err.code)
  } else if (err instanceof NWCTimeoutError) {
    // No response within timeout
    console.error('Timeout:', err.code)
  } else if (err instanceof NWCConnectionError) {
    // Relay unreachable
    console.error('Connection failed')
  } else if (err instanceof NWCDecryptionError) {
    // Wrong key or encryption mismatch
    console.error('Decryption failed')
  }
}
```

## LNbits MCP Server (Optional)

The LNbits MCP Server exposes 30+ wallet operations as MCP tools. AI agents can call them directly without writing code.

### Install

```bash
git clone https://github.com/lnbits/LNbits-MCP-Server.git
cd LNbits-MCP-Server
pip install -e .
```

Requires Python 3.10+.

### Configure Claude Desktop

Add to your config file:

- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
  "mcpServers": {
    "lnbits": {
      "command": "lnbits-mcp-server"
    }
  }
}
```

Restart Claude Desktop after saving.

### Connect

Tell the agent:

```
Configure lnbits.
URL: https://your-lnbits-instance.com
Key: your_admin_api_key
Auth method: api_key_header
```

The API key is in the LNbits sidebar under **Node URL, API keys and API docs**. Use the **Admin key** for full access or **Invoice key** for read-only + invoicing.

### Available MCP Tools

| Category | Tools |
|----------|-------|
| Wallet | `get_wallet_balance`, `get_wallet_details`, `get_payments`, `check_connection` |
| Payments | `create_invoice`, `pay_invoice`, `pay_lightning_address`, `decode_invoice`, `get_payment_status` |
| Config | `configure_lnbits`, `get_lnbits_configuration`, `test_lnbits_configuration` |
| Extensions | `create_lnurlp_link`, `create_tpos`, `create_satspay_charge`, `create_watchonly_wallet` |
| Admin | `get_node_info`, `list_users`, `create_user`, `get_system_stats` |

### Environment Variables (Alternative to Runtime Config)

```bash
export LNBITS_URL="https://your-lnbits-instance.com"
export LNBITS_API_KEY="your_api_key"
lnbits-mcp-server
```

### When to Use MCP vs nostr-core

- **MCP Server:** Conversational wallet control, quick operations, no code needed, Claude Desktop or Cursor
- **nostr-core:** Programmatic control, custom logic, payment flows, Nostr messaging, runs anywhere

Use both when you need conversational access AND protocol-level code.

## Resources

- LNbits: https://lnbits.com
- LNbits docs: https://docs.lnbits.com
- LNbits MCP Server: https://github.com/lnbits/LNbits-MCP-Server
- LNbits docs for agents: https://docs.lnbits.com/llm/
- NWC spec (NIP-47): https://github.com/nostr-protocol/nips/blob/master/47.md

Versions

The database has no other skills named lnbits-mcp.

Database snapshot: 13.11.2026 · package version 21f5bb58ad7d (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100nwc-integrate
    Set up a project with nostr-core and connect to any NWC-compatible Lightning wallet. Scaffolds connection lifecycle, environment configuration, capability detection, and error handling. Use when integrating Lightning wallet functionality into a JavaScript or TypeScript application.
  • 95lightning-nwc
    Nostr Wallet Connect (NWC, NIP-47): wallet remote control via Nostr relays. App on one device drives wallet on another via signed JSON messages over Nostr. USE WHEN: integrating wallet-side or app-side NWC, designing remote-control flows, evaluating NWC vs WebLN.
  • 100lightning-agent
    Scaffold a complete Lightning-enabled Nostr agent class using nostr-core. Provides a copy-paste agent with wallet operations, Nostr messaging, profile management, and event publishing. Use when the user wants a ready-made agent class, a starting template, or asks "build me an agent.
  • 100wosbot
    Read the balance and history of a Wallet of Satoshi wallet, create Lightning invoices that pay it, and ask its owner to make Lightning payments, each of which they approve in their app. Use when the user gives you a WosBot connection string (an address ending in /mcp/wosbot_...…
  • 100mcp-client-integration
    Connect MCP servers to AI clients — Claude Desktop, Claude Code, Cursor, the Claude Agent SDK, and custom apps — including config file locations, auth, and debugging connection failures. Use this skill when the user wants to wire an MCP server into a client, troubleshoot "server…
  • 90ai-tools-setup
    Set up, connect, validate, and repair Claude Desktop and MCP servers using Desktop Commander — inspecting and fixing mcp.json / claude_desktop_config.json, getting MCP servers to connect, and diagnosing local AI tooling. Use when a user wants to install, configure, connect,…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.