Here is a small idea with a long shadow: what if a single tool in an AI agent’s toolbox had a price tag — and the agent paid for it, in sats, every time it called it? Not a subscription. Not an API key tied to your identity. Just a tool that answers a 402 Payment Required, takes a Lightning payment, and runs. That is what you get when you put two open standards back to back: MCP, the way agents call tools, and L402, the way Lightning charges for HTTP. This is where own-your-code meets own-your-money, and it is more buildable than it sounds.
The idea: an MCP tool with a price
TL;DR. Stand up an MCP server that exposes one or more tools. Put an L402 paywall in front of the tool-call endpoint. Now any AI agent that wants to call your tool has to settle a Lightning invoice first — no account, no signup, no platform sitting in the middle skimming a cut. The agent pays sats per invocation, the response comes back, and the money lands in a node you control. It is pay-per-tool-call, built entirely from open standards.
Most monetization stories for AI tooling end in the usual place: sign up, get an API key, attach a credit card, hope the bill is sane at the end of the month. Every one of those steps is an account someone else controls and an identity attached to your usage. The MCP-plus-L402 shape removes all of it. The “account” is the payment itself. The “key” is proof that the invoice was paid. There is nothing to revoke because there was nothing to grant.
Two ownership claims, fused into one endpoint:
- Own your code — the tool is yours, the MCP server is yours, the logic runs on a box you operate. No marketplace gatekeeper decides whether your tool is allowed to exist.
- Own your money — payment settles in Bitcoin over the Lightning Network, into a node you run. No card processor, no payout schedule, no chargeback desk.
MCP, in one paragraph
The Model Context Protocol (MCP) is an open standard published by Anthropic in late 2024 that gives AI agents a clean, structured way to call real tools instead of guessing at brittle web pages. An MCP server advertises a list of tools — named functions an agent can invoke, each with a typed input schema — and resources the agent can read. The agent (the MCP client) discovers what is available, decides what to call, and gets back machine-readable answers. People describe it as USB-C for AI: one protocol so any compatible agent can plug into any compatible system. Anthropic open-sourced the spec, which is exactly why a small operator can implement a server and have Claude Code, Codex, or a local Ollama-backed agent speak to it without permission from anyone. We are building on that shoulder, not inventing a new wheel.
Why L402 fits tool-calling
L402 is an open protocol from Lightning Labs that combines the HTTP 402 Payment Required status code with a Lightning invoice and an authentication token (a macaroon). The flow is short: a client requests a paid resource, the server answers 402 with an invoice and a macaroon, the client pays the invoice over Lightning, and then re-sends the request carrying the macaroon plus the payment preimage as proof. Valid proof, the request runs; no proof, another 402. The server-side reference implementation is Aperture, also from Lightning Labs. There is no account anywhere in that loop.
Now look at what an MCP tool call actually is: a discrete, self-contained request with structured inputs and a structured response. One call in, one answer out. That granularity is exactly what pay-per-call billing wants. You are not metering a fuzzy “session” or a monthly seat — you are pricing a single, well-defined invocation. The fit is almost suspiciously clean:
- Atomic billing. A tool call is a natural unit of work, so it is a natural unit of price. One invocation, one micropayment.
- No signup. Agents are not people. They do not have inboxes to confirm, passwords to remember, or KYC documents to upload. L402 lets a non-human caller pay and proceed without any of that.
- Machine-native. Both ends are software. An agent that can speak MCP can be wired to pay a Lightning invoice and retry — no human in the loop clicking “subscribe.”
- Permissionless reach. Any agent that can pay can call. You are not maintaining an allow-list of approved customers; the invoice is the access control.
The reference shape: MCP server → L402 gate → your LN node
Strip it to three layers, all of them yours:
- Your MCP server. The tool lives here — the actual logic an agent wants to run. It advertises its tools and schemas over MCP like any other server, sitting on hardware you operate at home, in an office, or in a Hashcenter.
- Your L402 gate. In front of the paid tool’s endpoint sits an L402 layer — Aperture or an equivalent — that answers unpaid calls with
402plus an invoice, and lets paid calls through once the macaroon and preimage check out. This is the toll booth. - Your Lightning node. The invoices are issued by, and the sats settle into, a node you run. The money never touches a custodian’s ledger. When the call clears, the payment is already in a channel you control.
The request path reads like a conversation: the agent asks to call the tool; the gate says “that costs X sats, here is the invoice”; the agent’s wallet pays; the agent re-asks with proof; the tool runs; the answer goes back. Nothing in that exchange knows the caller’s name. The gate does not check who you are — only that the invoice was paid. That is the same trust model Bitcoin taught us: verify, do not ask permission.
This runs on your server, not on a miner
Worth saying plainly, because the internet muddles it constantly: the MCP server and its tools run on general-purpose hardware you own — a VPS, a workstation, a home server, a node box. They do not run on a Bitcoin mining ASIC. A SHA-256 ASIC, the chip inside an S19, S21, or any Antminer-class miner, is a fixed-function hashing engine: it computes double SHA-256 billions of times a second and literally nothing else. It has no general-purpose cores to host a web server, an MCP implementation, or any tool logic. The miner and the box that serves your tool are two different machines, often owned by the same operator, never the same silicon. The only thing your miner contributes to this story is that it probably sits next to the Lightning node doing the settling.
What you can sell this way
The pattern shines when the tool does something with real marginal cost or real value, and when the caller is a machine that would rather pay a few sats than negotiate a contract. Some honest examples:
- A data lookup other agents need. A tool that returns a niche dataset, a fresh scrape, or a computed result you maintain — priced per query.
- A compute-heavy transform. Anything that costs you CPU, GPU, or bandwidth to run — rendering, conversion, a model you serve locally — billed per invocation so the caller pays for what they consume.
- Access to hardware you operate. A controlled action against a device or service you run, gated so only paid calls execute.
- A specialized skill. A tool wrapping domain logic you have built and would rather rent per call than license per seat.
The common thread: the buyer is frequently another agent, not a human filling out a form. That is the regime where pay-per-call beats subscriptions outright — software paying software, in the smallest unit that makes sense, with no relationship to maintain on either side.
Honest limits: early, niche, and you run the node
We would rather under-promise than sell you a fantasy. This is real and it works, but it is early and it is niche. The honest boundaries:
- It is experimental. MCP is young (late 2024) and L402 tooling is still maturing. Wiring them together is a build-it-yourself project, not a plug-in you install. Expect to read source and debug.
- You run infrastructure. A self-custodial Lightning node is yours to operate — channels, liquidity, backups, uptime. If the node is down, the tool cannot collect. Sovereignty has an operations bill, and you pay it in attention.
- The audience is small today. The population of agents that can autonomously pay a Lightning invoice mid-task is growing but not large. You are building for where this is heading, not a mass market that exists this minute.
- No revenue promises. We are describing a mechanism, not a money printer. Whether anyone pays for your tool depends entirely on whether the tool is worth paying for. The rail does not create demand.
- It does not run on your ASIC. Said once already, repeated on purpose: a SHA-256 miner cannot host this. The server is general-purpose silicon you own.
None of that is a reason to dismiss it. It is the reason to build it now, while the standards are open and the field is empty enough that a careful operator can learn the shape before everyone else arrives. If you want the wider context for why this pattern matters, our Bitcoin × AI hub maps the whole terrain, and the sovereign compute loop piece defines the canonical pattern this tool-level idea is one slice of. For the miner-side cousin — exposing a Bitaxe to an agent over MCP — see the DCENT_axe firmware, whose own MCP server is a planned, closed-beta design target, not a download today. And if you would rather drive miners from a plain command line than from inside an agent, the DCENT Toolbox is the open-source CLI companion.
Frequently asked questions
What does “an MCP tool that pays per call” actually mean?
It means a tool exposed over the Model Context Protocol whose endpoint is gated behind an L402 paywall. Before an AI agent can invoke the tool, it must settle a Lightning invoice; once it presents valid proof of payment, the tool runs and returns its result. The agent pays sats for each individual call — no subscription, no account, no API key tied to an identity.
Who made MCP and L402?
MCP — the Model Context Protocol — is an open standard published by Anthropic in late 2024 for letting AI agents call structured tools. L402 is an open protocol from Lightning Labs that uses the HTTP 402 Payment Required status code together with a Lightning invoice and a macaroon token to enable pay-per-call access with no signup. Aperture is Lightning Labs’ server-side reference implementation of L402. We credit both projects plainly: this idea is two of their open standards bolted together, nothing more clever than that.
Do callers need an account or KYC to pay for the tool?
No, and that is the whole point. L402 carries proof of payment inside the request — a macaroon plus the Lightning payment preimage — so there is nothing to sign up for and no identity to verify. If a call arrives with valid payment proof it is served; if not, it gets a 402. No email, no password, no KYC, on either side.
Can I run the MCP server on my Bitcoin miner?
No. A Bitcoin mining ASIC is a fixed-function SHA-256 chip with no general-purpose cores — it cannot host a web server, an MCP implementation, or tool logic. The MCP server runs on ordinary hardware you own, such as a VPS, workstation, or home server. The same operator can run both a miner and the server, but they are two different machines, never the same silicon. We unpack the hardware difference in Can you run AI on a Bitcoin miner?
Is this production-ready?
Treat it as experimental. MCP is young and L402 tooling is still maturing, so wiring the two together is a build-it-yourself project, not an off-the-shelf product. You also run the Lightning node that collects the sats, which is real infrastructure to operate. Build it because the standards are open and the territory is early, not because there is a turnkey path — there is not yet.
How is this different from selling pay-per-inference?
Pay-per-inference gates a whole model API behind L402; this gates a single MCP tool behind L402. The mechanism is the same — Lightning invoice, macaroon, no account — but the unit is finer. An inference endpoint sells “ask the model anything”; an MCP tool sells one specific, well-defined function call. Both are slices of the same sovereign compute loop: own the code, own the money, charge in sats with no middleman.

