Back to browse
GitHub Repository

An MCP server that equips AI agents with a Lightning Network wallet to autonomously navigate and pay for HTTP 402 gated APIs using the L402 protocol.

2 starsTypeScript

MCP plugin that lets Claude autonomously pay for APIs via Lightning

by jaafarskafi·Apr 7, 2026·1 point·0 comments

AI Analysis

●●●BangerZero to OneBold BetBig Brain

Agents finally have bank accounts: 402 interception + Lightning payments just works.

Strengths
  • Solves genuine agent orchestration bottleneck where paid API walls break workflows
  • L402 Macaroon parsing and BOLT11 invoice handling fully automated end-to-end
  • Local Dummy Agent with mock 402 challenges enables testing without spending sats
Weaknesses
  • Requires Alby API integration, limiting wallet provider options for now
  • L402 standard still emerging with limited real-world API adoption
Category
Target Audience

Developers building autonomous AI agent workflows

Post Description

Hey HN,

As we move toward multi-agent orchestration, the biggest bottleneck I've seen is that agents don't have bank accounts. When an agent hits a paid API wall or needs to outsource a task to another agent, the workflow breaks.

I built BoltClaw to solve this by bridging the Model Context Protocol (MCP) with the Lightning Network.

How it works:

Claude uses the MCP tool to fetch data from an endpoint.

If the endpoint returns an HTTP 402 Payment Required, the tool intercepts the response and parses the L402 Macaroon and BOLT11 invoice.

The plugin automatically pays the micro-transaction (e.g., 50 sats) via the Alby API.

It re-requests the data using the cryptographic preimage and returns the payload to Claude's context window.

I built it in Python using FastMCP and httpx. The repo includes a local Dummy Agent (built with FastAPI) that returns mock L402 challenges so you can test the 402-interception loop locally without spending real satoshis.

Repo: https://github.com/jeffskafi/OpenBolt

Would love feedback on the architecture, specifically from anyone else experimenting with L402s or M2M payments.

Similar Projects

Developer Tools●●Solid

X402 Agent Starter Kit: AI agents that pay for their own APIs

They revive HTTP 402 so agents can automatically buy API calls — the repo ships PayingClient/WalletManager primitives, an @x402-kit/core package, five agent templates (web-scraper, image-gen, search, translation, code-review), a live demo and 93 tests. Smart infrastructure play with a clear demoable surface; the hard part will be UX and economics (wallet funding, gas/settlement, and convincing API operators to adopt x402 instead of existing billing).

Bold BetBig BrainShip It
peiyaooo
354mo ago

CC Wiretap – intercepting and visualizing Claude Code traffic real-time

Instead of wrestling with raw mitmproxy output, this tool gives a purpose-built UI that shows system prompts, tool definitions, token accounting, streaming responses and tool calls — all in real time. The one-liner shell setup, keyboard shortcuts, and token breakdown make debugging Claude Code conversations startlingly quicker, though it’s inherently a local MITM (trust the generated CA) and is narrow by design to Anthropic’s workflow.

Niche GemSolve My Problem
wierdbytes
204mo ago