
Mcp L402 Gate
Adds Lightning payment gating plus Depth-of-Identity scoring to MCP tools. Wraps your endpoints with L402 macaroon flows backed by LNBits invoices, then checks the caller's Nostr pubkey against the PowForge oracle to enforce a minimum composite reputation score. Ships as Express middleware or a direct tool wrapper. Solve for the sybil problem that bare L402 leaves open: paying 10 sats from a fresh wallet is trivial, but carrying a DoI score above 10 or 40 requires observable irreversible work across social, economic, and access dimensions. Config takes your LNBits URL, invoice key, sat amount, and score threshold. Returns 402 challenges on first call, verifies preimage plus score on retry, and only then runs your tool body.
- tools
- 3
- transport
- STDIO
- env vars
- 2
- last updated
- May 10, 2026
Tools
3 toolsPublic tool metadata for what this MCP can expose to an agent.
l402_gate_challengeRequest a fresh PoW challenge from the PowForge L402 gate. Returns {nonce, difficulty}. Find a `solution` such that SHA-256(nonce+solution) starts with `difficulty` leading hex zeros, then call l402_gate_verify with {nonce, solution}. Free tier — no payment required.
Request a fresh PoW challenge from the PowForge L402 gate. Returns {nonce, difficulty}. Find a `solution` such that SHA-256(nonce+solution) starts with `difficulty` leading hex zeros, then call l402_gate_verify with {nonce, solution}. Free tier — no payment required.
No parameter schema in public metadata yet.
l402_gate_verifyVerify a gate access attempt. Three shapes: (a) {nonce, solution} verifies a PoW solve and returns a 5-min token; (b) {request_invoice: true} mints a fresh L402 bolt11 invoice for the Lightning-skip tier; (c) {payment_hash} polls for L402 payment and returns the token once pai...4 params
Verify a gate access attempt. Three shapes: (a) {nonce, solution} verifies a PoW solve and returns a 5-min token; (b) {request_invoice: true} mints a fresh L402 bolt11 invoice for the Lightning-skip tier; (c) {payment_hash} polls for L402 payment and returns the token once pai...
noncestringpayment_hashstringrequest_invoicebooleansolutionstringl402_gate_scoreLook up the Depth-of-Identity (DoI) score for a Nostr pubkey via the public PowForge oracle. Returns {composite, rank, depth, score_version}. Use the composite scalar against your own minScore policy. Pairs with l402_gate_verify for compose-able L402 + identity gating.1 params
Look up the Depth-of-Identity (DoI) score for a Nostr pubkey via the public PowForge oracle. Returns {composite, rank, depth, score_version}. Use the composite scalar against your own minScore policy. Pairs with l402_gate_verify for compose-able L402 + identity gating.
pubkeystringSponsors
Configuration
POW_GATE_URLdefault: https://gate.powforge.devPowForge L402 gate base URL. Defaults to public production endpoint when running via npx; override for self-hosted or local dev.
ORACLE_URLdefault: https://identity.powforge.devPowForge Depth-of-Identity oracle base URL. Used by l402_gate_score for pubkey lookups. Defaults to public production endpoint.
Readme
@powforge/mcp-l402-gate
Identity-scored Lightning paywall for MCP server operators.
L402 alone proves the caller paid 10 sats. It does not prove the caller has a reputation, has been around for more than 10 minutes, or that pricing one tool call shifts their economics at all. A fresh wallet pays the same 10 sats as a real user.
This package adds a Depth-of-Identity check on top of the L402 invoice. Drop it in front of an MCP tool and a caller has to (a) settle a Lightning invoice and (b) carry a DoI score above your threshold before the tool body runs. Cheap sybils still pay the toll, but the toll plus the per-pubkey reputation requirement is harder to grind than either piece on its own.
See it in action
Details
- Repository
- github.com/zekebuilds-lab/mcp-l402-gate
- Website
- powforge.dev/mcp
- Package
@powforge/mcp-l402-gate- Transport
- STDIO
- Registry
- MCP registry, active