loop-mcp
About
L402-native MCP payment proxy: 5 paid Bitcoin/Lightning tools for AI agents, 10-25 sats/call.
Details
- Author
- Loop-XXI
- Downloads
- 129
- Categories
- Finance, Other
Jump to
- Dual-rail payments — Lightning (L402) and USDC (x402) in one transport.
- Per-tool pricing — each tool call costs sats or USD (10–25 sats per tool on live deployment).
- Stateless L402 verification — preimage verified without database.
- Rail-tagged canonical ledger — both rails settle into one LoopLedger with a rail tag.
- Free try endpoint — POST https://mcp.loopxxi.com/try/btc_price returns live Bitcoin price for free.
- Fiat credits via Stripe — buy credit packs ($10/$25/$50) and pay with Bearer token, no Lightning wallet required.
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
loop-mcpCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Use the hosted deployment at https://mcp.loopxxi.com/mcp (no install required) — point any MCP/L402 client at it. Alternatively, embed the dual-rail transport into your own MCP server by installing @loop-xxi/loop-mcp from npm and calling makePaymentAwareServerTransport with per-tool USD prices and optional Lightning provider configuration. The agent flow is: challenge (HTTP 402 with invoice) → pay invoice → retry with Authorization: L402 <token>:<preimage>. Fiat credits via Stripe use a single Authorization: Bearer loop_<credit_key> call.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"loop-mcp": {
"loop-mcp": {
"type": "streamable-http",
"url": "https://mcp.loopxxi.com/mcp"
}
}
}
}
McpServers
{
"loop-mcp": {
"type": "streamable-http",
"url": "https://mcp.loopxxi.com/mcp"
}
}
Loop MCP — dual-rail payments for the Model Context Protocol
Charge AI agents per tool call over either rail — Bitcoin/Lightning or USDC — and settle both into one canonical ledger.
@loop-xxi/loop-mcp is a payment-aware transport for MCP. Drop it in front of an MCP server and every paid tool returns HTTP 402 Payment Required; a paying client retries and the call goes through. Built and maintained by Loop XXI LLC.
It is API-compatible with the popular x402-only MCP transport, with one material addition:
Live deployment (v2.2.0)
A live, hosted deployment is running with 5 paid tools on two payment rails: Lightning (L402) and fiat-funded credits via Stripe. No API keys, no signup — payment is the credential. A branded landing page and a free try endpoint are at https://mcp.loopxxi.com/.
Endpoint: https://mcp.loopxxi.com/mcp · Health: https://mcp.loopxxi.com/health · Landing: https://mcp.loopxxi.com/
| Tool | Sats | What it returns |
|---|---|---|
| btc_price | 10 | Current Bitcoin price in USD + major fiat currencies (mempool.space). |
| btc_send_decision | 15 | A SEND_NOW / WAIT / URGENT_ONLY verdict with fee rates (sat/vB), mempool pressure, and estimated savings — one decision call instead of parsing multiple mempool endpoints. |
| lightning_address_resolve | 10 | Resolve a Lightning Address (user@domain.com) to a payable BOLT11 for a given amount — the full LNURL-pay flow in one call. |
| tx_decode_explain | 25 | Decode a Bitcoin tx by txid into a structured agent summary: type, fee, fee rate, confirmation status, RBF/SegWit/Taproot flags, and a one-line agent_summary ready for LLM context. Saves 500–2,000 tokens vs raw JSON. |
| optimal_send_window | 25 | Bitcoin transaction timing intelligence: recommended send window, fee trajectory, congestion forecast, confirmation targets, and RBF viability from live mempool data. |
Two payment rails
Agents pay per tools/call via either rail:
- Lightning (L402) — Authorization: L402 <token>:<preimage>. 10–25 sats/call across 5 tools. The default; no account needed.
- Fiat credits (Stripe) — Authorization: Bearer loop_<credit_key>. Buy a credit key at api.loopxxi.com/ai-credits ($10/$25/$50 packs → sats at the live BTC price). loop-mcp forwards the key to Loop Gateway's POST /v1/credits/debit, which atomically debits the prepaid sats ledger. Same 1:1 sats pricing as L402.
A request with no auth returns HTTP 402 with a Lightning invoice (L402) and, in the body, a pointer to the fiat refill URL. Insufficient fiat balance returns 402 with refill_url: https://api.loopxxi.com/ai-credits.
Free try (no wallet required)
POST https://mcp.loopxxi.com/try/btc_price returns the live Bitcoin price for free — a read-only lead-gen endpoint so you can see a tool's output before wiring up payment.
Agent payment preflight
Any buyer agent should fetch the machine-readable payment manifest before paying:
- https://mcp.loopxxi.com/.well-known/agent-payments.json
- https://mcp.loopxxi.com/agent-payments.json
A dependency-free preflight script is provided in example/agent-payment-preflight.mjs. It checks the manifest, prints the provider / rails / tool table, and exits OK_TO_PAY or DO_NOT_PAY if the manifest max_price_sats exceeds a configurable sats budget.
```bash
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



