Agent Onboarding

Get your AI agent making L402 micropayments in minutes.

Install Lightning Enable MCP

Lightning Enable provides an MCP (Model Context Protocol) server that gives your AI agent a Lightning wallet with L402 payment capabilities.

# Python / pip
pip install lightning-enable-mcp

# Or configure in your MCP client (Claude Desktop, etc.)
{
  "mcpServers": {
    "lightning-enable": {
      "command": "npx",
      "args": ["-y", "lightning-enable-mcp"]
    }
  }
}

Fund Your Wallet

Add satoshis to your Lightning Enable wallet. You can fund via Lightning invoice or on-chain Bitcoin.

# Check your wallet balance
Use the check_wallet_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:

  1. Agent sends a request to the L402 proxy endpoint
  2. Proxy returns 402 with a WWW-Authenticate header containing a Lightning invoice
  3. Agent pays the Lightning invoice (instant, ~2-5 sats)
  4. Agent retries the request with an Authorization: L402 header
  5. Proxy validates the payment and forwards the request to the API backend
  6. API returns the response through the proxy to the agent

Resources