Lightning-paywall sidecar: wraps any stdio MCP server, requires paid invoices before tool calls.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Paywall ANY stdio MCP server with Lightning, without modifying it. paywall-mcp is a generic sidecar: configure it with an upstream MCP server command and a per-tool price map, and it transparently:
tools/list from the upstream to the LLM client, with prices appended to each tool's description.tools/call: free tools pass through; priced tools require a paid Lightning invoice (via Nostr Wallet Connect / NIP-47) before the call is forwarded.No code changes to the upstream server. Works with Anthropic's reference MCP servers, your own, or any third-party MCP server that speaks stdio.
v0.1 β proxy + payment gate complete. Spawns a stdio upstream as a child process; per-tool pricing via env; in-memory invoice cache + replay protection; audit log; read-only mode. Persistent cache + HTTP/SSE upstream transport deferred to v0.2.
Modern paid-API patterns (Lightning paywall, L402, micropayments) exist for HTTP but the MCP ecosystem has no standard for paid tool calls. Building it into each individual server is repetitive and error-prone. paywall-mcp is the missing sidecar: write your tools as a normal MCP server, then wrap it with paywall-mcp to charge sats per call.
For any priced tool:
priced_tool({...args}) without payment_hash. paywall-mcp issues a bolt11 invoice through your NWC wallet and returns:
nwc-mcp β the same LLM can call nwc_pay_invoice to settle.priced_tool({...args, payment_hash: "abc123..."}). paywall-mcp verifies settlement via NWC lookup_invoice, strips payment_hash from the args, forwards the original call to the upstream, returns the upstream's result.Replay protection: the same payment_hash cannot be redeemed twice. Buyers pay a fresh invoice for each call.
free_lookup: 0, premium_analysis: 100, rare_alpha_signal: 5000. Buyers see prices in tool descriptions.PAYWALL_PRICE_MAP in env, restart, you're at the new price.make_invoice + lookup_invoice are the only permissions paywall-mcp needs. A receive-only NWC connection is perfectly fine and recommended β paywall-mcp never spends.The server auto-loads .env from its own directory (next to dist/) β deliberately NOT from cwd, to avoid env collisions when running multiple MCP servers in the same Claude Code session.
| Var | Purpose |
|---|---|
PAYWALL_UPSTREAM_COMMAND | Executable to spawn as the upstream MCP server (e.g., node). |
PAYWALL_UPSTREAM_ARGS | JSON array of args passed to the upstream command (e.g., ["/path/to/upstream/dist/index.js"]). |
| Var | Purpose |
|---|---|
NWC_CONNECTION_STRING | NIP-47 NWC URI for the seller's RECEIVE wallet. make_invoice + lookup_invoice permissions sufficient. paywall-mcp never spends. |
| Var | Default | Purpose |
|---|---|---|
PAYWALL_DEFAULT_PRICE_SATS | 0 | Default price for any tool not in the price map. 0 = free passthrough. |
PAYWALL_PRICE_MAP | {} | JSON object mapping tool names to sat prices. Per-tool 0 = free; missing = use default. Example: {"premium_compliment":21,"rare_alpha_signal":5000}. |
| Var | Default | Purpose |
|---|---|---|
PAYWALL_UPSTREAM_CWD | (parent cwd) | Working directory for the upstream child process. |
PAYWALL_UPSTREAM_ENV | (inherits) | JSON object of env-var overrides for the upstream. |
PAYWALL_READ_ONLY | false | Disables all paid tool calls (tools/list still works). Useful for maintenance. |
PAYWALL_INVOICE_TTL_SECONDS | 600 | Invoice TTL. Past this, payment_hash is forgotten from cache and the buyer must re-issue. |
PAYWALL_PRICE_LABEL_TEMPLATE | "(π° {price} sats)" | Label appended to each priced tool's description in tools/list. {price} is substituted with the sat amount. |
PAYWALL_LOG_PATH | ./paywall-mcp.log | Server log. |
PAYWALL_AUDIT_PATH | ./paywall-mcp-audit.log | NDJSON audit log (one line per call). |
paywall-mcp-test serverThe companion paywall-mcp-test package exposes a single tool β premium_compliment. It already implements its own paywall pattern internally, but it's also a convenient stand-in for "any upstream MCP server" to demonstrate paywall-mcp itself.
.env:
Wire paywall-mcp (not the upstream directly) into your MCP client:
Now from your agent:
Audit log entries (NDJSON, one per request):
outcome: "ok" β invoice issued, free passthrough, or paid passthrough completedoutcome: "blocked" β read-only refusal, invalid hash, replay, mismatch, not-settledoutcome: "error" β upstream call failed, NWC lookup_invoice failed, etc.Tail the audit log for ground truth β independent of whatever the LLM tells you.
Same .env-via-binary-dir pattern as the rest of the substrate β leave env empty in the client config; secrets stay in paywall-mcp/.env.
nwc-mcp β Lightning wallet for the buyer. Lets the agent pay the invoices paywall-mcp issues. The matching half of the agent-pays-a-paid-tool loop.nostr-ops-mcp β NOSTR identity, publishing, encrypted DMs.marketplace-mcp β Run a NIP-15 / Shopstr storefront from an agent.albyhub-admin-mcp β Alby Hub node-admin via HTTP API.MIT β see LICENSE.
Built by LLMOps.Pro.
npub1hdg932jvwc3jdvkqywgqv0ue4nn60exrf92asy8mtazt3hjg7d2s2yw0nw β follow, DM, zap.sovereigncitizens@getalby.com β for support zaps and "this was useful" tips.Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/paywall-mcp)<a href="https://allmcps.com/mcp/paywall-mcp"><img src="https://allmcps.com/api/badge/paywall-mcp?style=directory" alt="Paywall MCP on AllMCPs" /></a>