Lightning Enable MCP
The Lightning Enable MCP server gives AI agents a Lightning Network wallet, enabling Bitcoin payments, L402 API access, and agent-to-agent commerce on Nostr.
💸 Payments
Pay Lightning invoices (BOLT11) and get proof of payment
Create invoices to receive payments and check invoice status
Confirm pending payments requiring explicit approval
Send on-chain Bitcoin (Strike/LND wallets)
🔐 L402 API Access
Access L402 resources with automatic 402 payment handling
Manually pay L402/MPP challenges and receive authorization tokens
Discover L402-enabled APIs by keyword, category, or URL (with optional budget awareness) and fetch detailed manifests
👛 Wallet & Currency
Check Lightning wallet balance and all currency balances (USD, BTC, etc.)
Get real-time Bitcoin price (Strike wallet)
Exchange currency between USD, BTC, EUR (Strike wallet)
📊 Budget & Spending
Set per-request and per-session spending limits
View budget status and recent payment history
🏪 Sell Services (L402 Producer) (requires Agentic Commerce subscription)
Create L402 payment challenges to charge other agents/users for resources
Verify L402 tokens to confirm payment before granting access
🤝 Agent-to-Agent Commerce (Nostr/ASA)
Discover agent services by category, hashtag, or keyword
Publish your agent's capabilities to the Nostr network (requires subscription)
Request services from other agents with a budget (requires subscription)
Settle agent services via L402 Lightning payments
Leave reviews/ratings for agents after service completion (requires subscription)
Check an agent's reputation score from on-protocol attestations
Enables integration with Alby Hub via Nostr Wallet Connect (NWC), allowing agents to make Lightning Network payments and manage wallet balances through a connection string.
Allows agents to interact with the Bitcoin network by sending on-chain transactions, paying BOLT11 invoices via the Lightning Network, and retrieving real-time BTC price data.
Part of Lightning Enable — infrastructure for agent commerce over Lightning.
Lightning Enable MCP Server
An open-source MCP (Model Context Protocol) server that enables AI agents to make Lightning Network payments and participate in agent-to-agent commerce. Wallet, invoice, L402, budget, and API-discovery tools work out of the box with just a wallet. Producer tools (sell access via L402) and Agent Service Agreement (ASA) tools (agent-to-agent discovery, request, settlement, and attestation over Nostr) unlock with an Agentic Commerce subscription. See the full tool list.
Available in .NET and Python.
What It Does
Give your AI agent a Lightning wallet and it can:
Pay invoices — Send Bitcoin via Lightning to any BOLT11 invoice
Access L402 APIs — Automatically pay L402 challenges for seamless API access
Discover APIs — Search the L402 API registry to find paid APIs by keyword or category, or fetch a specific API's manifest for full endpoint details and pricing
Track spending — Budget limits, payment history, and balance checks
Create invoices — Generate invoices to receive payments
Get BTC price — Real-time Bitcoin price from Strike
Exchange currency — Convert between USD/BTC/EUR and more (Strike wallet)
Send on-chain — Send Bitcoin on-chain (Strike/LND)
Self-bootstrap a Lightning Enable account —
create_lightning_enable_accountpays a ~100-sat activation fee over L402 and returns a merchant API key: the free→paid signup form that is the protocol, unlocking the producer + ASA tools with no browser or checkout page.Sell services (L402 Producer) — Create L402 payment challenges and verify payments, enabling agents to be full commerce participants that both buy and sell
Agent commerce (ASA) — Discover, request, settle, and review agent-to-agent services on Nostr
Related MCP server: Lightning Tools MCP Server
Quick Start
1. Install
# .NET
dotnet tool install -g LightningEnable.Mcp
# Python
pip install lightning-enable-mcp
# Python (no install)
uvx lightning-enable-mcp
# Docker
docker pull refinedelement/lightning-enable-mcp:latest2. Configure one L402-capable wallet
L402 — the whole point of this server — needs a wallet that returns the payment preimage. Set exactly one of these (as an env var, e.g. in the Claude Desktop config below):
Strike (easiest to start) —
STRIKE_API_KEY, from https://dashboard.strike.meNWC (self-custody, Nostr) —
NWC_CONNECTION_STRING, from CoinOS / CLINK / Alby HubLND (your own node — always returns a preimage) —
LND_REST_HOST+LND_MACAROON_HEX
⚠️ OpenNode (
OPENNODE_API_KEY) works for invoicing / direct payments only — it never returns a preimage, so it cannot pay L402 challenges. Don't make it your only wallet if you want L402 (the core use case).
If several are set, priority is: LND > NWC > Strike > OpenNode. See Supported Wallets for the full compatibility matrix.
3. Prove the whole loop works — test_l402_payment
Ask your agent:
Run test_l402_paymentThis pays a public 1-sat L402 endpoint end to end, proving your wallet is connected, returns a preimage, and can complete a real L402 payment. It's the one-line answer to "is my wallet actually working?" — and it costs about 1 satoshi.
4. Then have some fun — buy a t-shirt
Once the loop works, try the Lightning Enable Store, a live L402-powered web store. Ask Claude:
Buy me a Lightning Enable t-shirt from store.lightningenable.com(This one needs a funded wallet and a shipping address, which is why test_l402_payment — one sat, no shipping — is the faster first proof.)
Claude Desktop Config
Add to your claude_desktop_config.json:
.NET:
{
"mcpServers": {
"lightning-enable": {
"command": "dotnet",
"args": ["tool", "run", "lightning-enable-mcp"],
"env": {
"STRIKE_API_KEY": "your-strike-api-key"
}
}
}
}Python:
{
"mcpServers": {
"lightning-enable": {
"command": "uvx",
"args": ["lightning-enable-mcp"],
"env": {
"STRIKE_API_KEY": "your-strike-api-key"
}
}
}
}Config file locations:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/claude/claude_desktop_config.json
Supported Wallets
Wallet | Setup | L402 Support |
Strike | API key | Yes |
LND | REST + macaroon | Yes (guaranteed) |
NWC (CoinOS) | Connection string | Yes |
NWC (CLINK) | Connection string | Yes |
NWC (Alby Hub) | Connection string | Yes |
OpenNode | API key | No (no preimage) |
Tools
Canonical inventory: 26 tools — 17 free (out of the box, just a wallet) + 9 that require LIGHTNING_ENABLE_API_KEY (an Agentic Commerce subscription; 2 L402 Producer + 7 Agent Service Agreement). This table is the single source of truth every advertised count derives from — it is pinned to the code by the tool-inventory guard tests in both ports (drift fails CI).
ASA availability note. The L402/producer tools,
discover_agent_services,settle_agent_service, andunpublish_agent_capabilitywork against the hosted API today. The agent-to-agent coordination tools —publish_agent_capability,request_agent_service,publish_agent_attestation,get_agent_reputation— use the agent capability backend, which is not yet enabled on the hosted Lightning Enable API (calls there currently return an error) and are in preview. Marketplace listings are published today via the Lightning Enable dashboard / L402 proxy pipeline.
Deprecated aliases (accepted but unadvertised, forward to the new tool, removed in v2.0.0): confirm_payment → verify_confirmation_code; check_wallet_balance, get_all_balances → get_balance.
Tool | Access | What it does |
| Free | Pay a BOLT11 Lightning invoice directly, get the preimage |
| Free | Pay an L402 challenge (invoice + macaroon), get the token |
| Free | Fetch a URL, auto-paying any L402 challenge |
| Free | Self-test the wallet against a public 1-sat L402 endpoint |
| Free | Search the L402 API registry / fetch an API manifest |
| Free | Create a BOLT11 invoice to receive payment |
| Free | Check whether a created invoice was paid |
| Free | Wallet balance: sats, all currencies (Strike), and wallet info |
| Free | Convert between USD and BTC (Strike) |
| Free | Send an on-chain Bitcoin payment (Strike, LND) |
| Free | Current Bitcoin price in USD |
| Free | List payments made this session (in-memory) |
| Free | Read the durable, append-only receipt log |
| Free | View budget config and session spend (read-only) |
| Free | Tighten runtime spending caps (tighten-only) |
| Free | Verify an out-of-band payment confirmation code (verification only — never pays) |
| Free | Self-bootstrap signup: pay ~100 sats, get a merchant API key |
| Agentic Commerce | L402 Producer: create a challenge to charge for a resource |
| Agentic Commerce | L402 Producer: verify an L402 token (macaroon + preimage) |
| Agentic Commerce | ASA: search for agent capabilities on Nostr |
| Agentic Commerce | ASA: publish your agent's services (kind 38400) |
| Agentic Commerce | ASA: take a listing down — retire the proxy + NIP-09 removal |
| Agentic Commerce | ASA: request a service from another agent (kind 38401) |
| Agentic Commerce | ASA: pay for an agent service via L402 settlement |
| Agentic Commerce | ASA: leave a review/rating for an agent (kind 38403) |
| Agentic Commerce | ASA: check an agent's reputation from attestations |
create_lightning_enable_account is free and self-provisions the API key the 8 gated tools need — an agent with a wallet pays a ~100-sat activation fee and unlocks them on the spot.
Documentation
.NET README — Full .NET documentation
Python README — Full Python documentation
Full Docs — Complete guide to every tool
AI Spending Security — Budget controls and safety
Repository Structure
lightning-enable-mcp/
├── dotnet/
│ ├── src/LightningEnable.Mcp/ # .NET MCP server
│ ├── tests/LightningEnable.Mcp.Tests/ # .NET tests
│ └── LightningEnable.Mcp.sln # Solution file
├── python/
│ └── lightning-enable-mcp/ # Python MCP server
├── .github/workflows/publish-mcp.yml # CI/CD
├── LICENSE # MIT
└── README.md # This fileAgent Service Agreement (ASA) Tools
These tools enable agent-to-agent commerce on Nostr:
All seven ASA tools require LIGHTNING_ENABLE_API_KEY (an Agentic Commerce subscription); settle_agent_service additionally spends your wallet balance, subject to budget limits. For the authoritative access level of every tool, see the canonical Tools table above — it is the single source of truth pinned to the code by the drift guard.
Tool | Description |
| Search for agent capabilities by category, hashtag, or keyword |
| Publish your agent's services to the Nostr network (kind 38400) |
| Take a published listing down: retire the L402 proxy and emit a NIP-09 removal |
| Request a service from another agent (kind 38401) |
| Pay for an agent service via L402 Lightning settlement |
| Leave a review/rating for an agent after service completion (kind 38403) |
| Check an agent's reputation score from on-protocol attestations |
How Agent Commerce Works
Discover —
discover_agent_services(category="translation")finds agents offering translationRequest —
request_agent_service(capability_id, budget_sats=100)sends a service requestSettle —
settle_agent_service(l402_endpoint)pays via Lightning and receives the resultReview —
publish_agent_attestation(pubkey, agreement_id, rating=5)builds on-protocol reputation
For dynamic pricing, providers use create_l402_challenge to generate invoices at the agreed price. Requesters pay and providers verify with verify_l402_payment.
Related Projects
le-agent-sdk (Python) —
pip install le-agent-sdkle-agent-sdk (TypeScript) —
npm install le-agent-sdkle-agent-sdk (.NET) —
dotnet add package LightningEnable.AgentSdk
Privacy
Lightning Enable does not hold funds — the connected wallet or payment provider (Strike, OpenNode, LND, or an NWC wallet) does. The MCP server runs locally and talks to the wallet/provider you configure and, for L402 discovery, the L402 API registry. Wallet credentials you supply stay on your machine (or, for the hosted API, are encrypted at rest). See the full Privacy Policy for what data is collected, third parties involved, retention, and contact (privacy@lightningenable.com).
License
MIT — see LICENSE.
Links
Lightning Enable — Payment enablement middleware
Documentation — Full docs
Store — Live L402 demo
NuGet — .NET package
PyPI — Python package
Docker Hub — Docker image
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityFmaintenanceEnables AI models to interact with the Lightning Network by providing an MCP-compliant API to pay invoices.Last updated346MIT
- AlicenseBqualityFmaintenanceEnables interaction with lightning addresses and common lightning tools via your LLM, providing Lightning Network functionality through natural language.Last updated3351MIT
- Alicense-qualityCmaintenanceMCP server for AgentPay — the payment gateway for autonomous AI agents. Fund a wallet once, give your agent the key, and it discovers, provisions, and pays for tool APIs on its own. One key, every tool.Last updated1121MIT
- Alicense-qualityBmaintenanceL402 + x402 client MCP. AI agents discover, pay for, and consume any payment-gated API autonomously. Supports Lightning (NWC), Cashu ecash, stablecoins, and human-in-the-loop payments.Last updated72MIT
Related MCP Connectors
Agent Commerce Protocol MCP — bridges Stripe ACP + Google AP2 + Coinbase x402 for agent payments
HiveCapital MCP Server — autonomous investment layer for AI agents
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/refined-element/lightning-enable-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server