Agent Onboarding
Get your AI agent making L402 micropayments in minutes.
Install Lightning Enable MCP
Lightning Enable provides an open-source MCP (Model Context Protocol) server that connects your AI agent to your own Lightning wallet — Strike, an NWC wallet (CoinOS, CLINK, Alby Hub), or LND — with L402 payment capabilities. Lightning Enable does not hold funds; your wallet provider does.
# Python / pip pip install lightning-enable-mcp # .NET alternative dotnet tool install -g LightningEnable.Mcp # Or configure in your MCP client (Claude Desktop, etc.) { "mcpServers": { "lightning-enable": { "command": "uvx", "args": ["lightning-enable-mcp"], "env": { "STRIKE_API_KEY": "your-strike-api-key" } } } }
Fund Your Wallet
Add satoshis to the Lightning wallet your agent connects through the MCP server. You can fund via Lightning invoice or on-chain Bitcoin — your wallet provider facilitates custody; Lightning Enable does not hold funds.
# Check your wallet balance Use the get_balance MCP tool # Create a funding invoice Use the create_invoice MCP tool with amount_sats=1000
1,000 sats is enough for hundreds of API calls at 2-5 sats each.
Discover APIs
Use the discover_api tool to find available APIs and their pricing.
# Discover all Agent Commerce Store APIs Use the discover_api MCP tool with url="https://agent-commerce.store/.well-known/l402-manifest.json" # Response includes all endpoints with pricing, descriptions, and example requests
Make Your First API Call
Use the access_l402_resource tool to call any API endpoint. The L402 payment happens automatically.
# Call the Weather Intel API via L402 proxy Use the access_l402_resource MCP tool with: url="https://api.lightningenable.com/l402/proxy/{weather-proxy-id}/forecast?latitude=40.71&longitude=-74.00" # The tool automatically: # 1. Receives 402 Payment Required + Lightning invoice # 2. Pays the invoice (3 sats) # 3. Retries with L402 token # 4. Returns the weather forecast JSON
How L402 Works
L402 is an HTTP-native payment protocol that extends the 402 Payment Required status code:
- Agent sends a request to the L402 proxy endpoint
- Proxy returns
402with aWWW-Authenticateheader containing a Lightning invoice - Agent pays the Lightning invoice (instant, ~2-5 sats)
- Agent retries the request with an
Authorization: L402header - Proxy validates the payment and forwards the request to the API backend
- API returns the response through the proxy to the agent
Resources
- Lightning Enable — L402 payment infrastructure
- Lightning Enable Docs — Full documentation
- L402 Manifest — Machine-readable API catalog
- llms.txt — LLM-readable site description
- OpenAPI / Swagger — Interactive API explorer