loop-mcp
About
L402-native MCP payment proxy: 5 paid Bitcoin/Lightning tools for AI agents, 10-25 sats/call.
Details
- Transport
- SSE
- License
- MIT
Explore
- 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
The hosted server is live now — for an immediate paid tool call, point any MCP / L402 client at https://mcp.loopxxi.com/mcp (see How to call above), no install required.
To embed the dual-rail transport in your own MCP server, install from npm:
``bash
npm install @loop-xxi/loop-mcp
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 ([email protected]) 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. |
|
btc_price
Get the current Bitcoin price in USD and major fiat currencies. Source: mempool.space. Real-time.
btc_send_decision
Returns a composited send-or-wait recommendation for a Bitcoin transaction. Fetches live mempool and fee data, then outputs a machine-actionable verdict (SEND_NOW, WAIT, or URGENT_ONLY) with fee rates in sat/vB, mempool pressure level, and estimated savings if you wait. Ideal for agents that need a single decision call instead of parsing multiple raw mempool endpoints.
lightning_address_resolve
Resolve a Lightning Address ([email protected]) to a payable BOLT11 invoice for a given amount. Handles the full LNURL-pay protocol internally. Returns the invoice plus min/max sendable amounts for validation.
tx_decode_explain
Fetch a Bitcoin transaction by txid and return a structured, agent-ready summary: type (P2WPKH/P2TR/P2SH/etc.), input/output counts, fees, fee rate in sat/vB, confirmation status, RBF flag, SegWit/Taproot flags, and a one-line agent_summary string ready for LLM context injection. Saves 500-2000 tokens vs parsing raw TX JSON.
optimal_send_window
Bitcoin transaction timing intelligence. Returns a congestion forecast for the next 1-4h, a recommended UTC send window when fees are projected at/below your target, a fee trajectory (rising/stable/falling) with a calibrated confidence score, next-block minimum fee, confirmation targets for 3/6/144 blocks, and an RBF-viability flag. A synthesis layer above raw fee data — the decision an autonomous payment agent needs before broadcasting. Source: mempool.space.
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import {
makePaymentAwareServerTransport,
PhoenixdProvider,
LoopLedger,
} from "@loop-xxi/loop-mcp";
const server = new McpServer({ name: "my-server", version: "1.0.0" });
server.tool("get-quote", "Premium market data", { / schema / }, async () => ({
content: [{ type: "text", text: "..." }],
}));
const transport = makePaymentAwareServerTransport(
"0xYourReceivingAddress", // x402 / USDC payouts
{ "get-quote": "$0.01" }, // per-tool USD price
{
network: "base",
ledger: new LoopLedger(),
// The addition — enable the Lightning / L402 rail:
lightning: {
provider: new PhoenixdProvider(process.env.PHOENIXD_URL!, process.env.PHOENIXD_PASSWORD!),
l402Secret: process.env.L402_SECRET!,
btcUsdPrice: 65000, // live spot, injected
},
}
);
await server.connect(transport);
If you omit lightning, you get the original single-rail (x402-only) behaviour.
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"
}
}
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 ([email protected]) 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.



