
Paywall Mcp
io.github.llmops-proPublished by GitHub account llmops-prov0.1.2Updated Oct 24, 2026
Lightning-paywall sidecar: wraps any stdio MCP server, requires paid invoices before tool calls.
Overview
A local sidecar that wraps any stdio MCP server and gates priced tools behind paid Lightning invoices before calls are forwarded.
- What you can do
- List upstream tools with per-tool sat prices appended to their descriptions, and pass free tools through unchanged to the wrapped server. Gate priced tool calls: the first call returns a bolt11 invoice and payment hash, and a second call with a settled hash is verified and forwarded. Verify settlement through a Nostr Wallet Connect wallet, with replay protection so each hash can be redeemed once. Log every request to an NDJSON audit log and optionally block all paid calls in read-only mode.
- When to use it
- Use it when you already have a stdio MCP server and want to charge sats per tool call without changing that server's code, for example to resell a third-party server or test per-tool pricing tiers.
- Requirements
- Node 20+ and an existing stdio MCP server to wrap, set via PAYWALL_UPSTREAM_COMMAND and PAYWALL_UPSTREAM_ARGS. A NIP-47 NWC connection string in NWC_CONNECTION_STRING for the seller's receive wallet whenever any tool has a non-zero price; make_invoice and lookup_invoice permissions suffice. Prices are set with PAYWALL_PRICE_MAP and PAYWALL_DEFAULT_PRICE_SATS.
Installation
In SourceWeft
- Open Paywall Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
paywall-mcp
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:
- Forwards
tools/listfrom the upstream to the LLM client, with prices appended to each tool's description. - Intercepts
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.
Why this exists
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.
How the dual-call pattern works
For any priced tool:
- First call — LLM calls
priced_tool({...args})withoutpayment_hash. paywall-mcp issues a bolt11 invoice through your NWC wallet and returns: - Payment — the LLM (or its operator) pays the invoice. Easiest path: use
nwc-mcp— the same LLM can callnwc_pay_invoiceto settle. - Second call — LLM calls
priced_tool({...args, payment_hash: "abc123..."}). paywall-mcp verifies settlement via NWClookup_invoice, stripspayment_hashfrom 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.
What you can build with it
- Charge sats for premium tools in an MCP server you already have, by adding one wrapper process.
- Per-tool pricing tiers —
free_lookup: 0,premium_analysis: 100,rare_alpha_signal: 5000. Buyers see prices in tool descriptions. - Bundle-and-resell third-party MCP servers — wrap someone else's open-source MCP server with your paywall and offer it as a managed paid service.
- A/B test pricing — adjust
PAYWALL_PRICE_MAPin env, restart, you're at the new price. - Time-limited promotional pricing — start at 21 sats, raise to 100 sats once usage proves the value.
Requirements
- Node 20+
- An existing stdio MCP server to wrap (paywall-mcp doesn't host tools itself; it gates an upstream's tools).
- A NIP-47 NWC connection string for the seller's receive wallet.
make_invoice+lookup_invoiceare the only permissions paywall-mcp needs. A receive-only NWC connection is perfectly fine and recommended — paywall-mcp never spends.
Install
Configure
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.
Required
Required when any tool has a non-zero price
Pricing
Optional
End-to-end example: paywall the bundled paywall-mcp-test server
The 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:
Safety model
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, NWClookup_invoicefailed, etc.
Tail the audit log for ground truth — independent of whatever the LLM tells you.
Wire into Claude Desktop / Claude Code / Cursor
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.
Testing
Companion servers
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.
License
MIT — see LICENSE.
Contact / Issues
Built by LLMOps.Pro.
- NOSTR:
npub1hdg932jvwc3jdvkqywgqv0ue4nn60exrf92asy8mtazt3hjg7d2s2yw0nw— follow, DM, zap. - Lightning Address:
[email protected]— for support zaps and "this was useful" tips. - Bug reports / feature requests: open a GitHub issue (link forthcoming).
- Security issues: please disclose privately via NOSTR DM before opening a public issue.
Source: README.md at commit bc54c1d
Tools
0Version history
1- v0.1.2LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts