Educational Weather Stats MCP Service β Tollbooth DPYC monetization sample
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Educational Weather Stats MCP Service β the reference implementation for building Tollbooth DPYC monetized API services with Bitcoin Lightning micropayments.
This service wraps the free Open-Meteo weather API
and gates paid tool calls through the Tollbooth
credit system using the @runtime.paid_tool() decorator. Domain tools contain
only business logic; debit, rollback, balance warnings, and constraint evaluation
are handled automatically by the OperatorRuntime. Standard DPYC tools
(balance, purchase, Secure Courier, Oracle, pricing, constraints) are delegated
to the wheel via register_standard_tools().
Version: 0.4.2
bootstrap-dpyc-operator skillThis repo doubles as a Claude Code plugin. The bootstrap-dpyc-operator skill turns your
existing REST API, stdio MCP, or HTTP MCP into a monetized DPYC Operator MCP: it clones this
template live, wraps your domain logic, and generates a deploy-ready project. You keep writing
business logic β the SDK handles payments, identity, vault, audit, and pricing.
Install it in Claude Code:
Then ask Claude to "make my API a paid DPYC operator" β the skill activates automatically by
its description. It never touches your original code (it emits a sibling <slug>-mcp/ project)
and reads this repo's live wheel pin on every run, so it can't go stale.
See skills/bootstrap-dpyc-operator/ for the skill and its
reference guides (canonical pattern, source adapters, sessions & vaults, onboarding checklist).
DPYC stands for Don't Pester Your Customer. It's a philosophy and protocol for API monetization that eliminates mid-session payment popups, subscription nag screens, and KYC friction.
Pre-funded balances β Users buy credits via Bitcoin Lightning before using tools. Each tool call silently debits from their balance. No interruptions, no "please upgrade" modals.
Nostr keypair identity β Users are identified by a Nostr public key
(npub), not an email or password. One keypair per role, managed by the
user. No account creation forms.
UUID-keyed tool identity β Every tool is a ToolIdentity object with
a deterministic UUID v5 derived from a capability name. Pricing hints come
from the category field:
| Category | Pricing hint | Use case |
|---|---|---|
free | 0 sats | Balance checks, status |
read | 1 sat | Simple lookups |
write | 5 sats | Multi-step operations |
heavy | 10 sats | Expensive queries |
Actual prices are set dynamically by the operator's pricing model in Neon.
Rollback on failure β If the downstream API fails after a debit, credits are automatically rolled back via a compensating tranche. The user never pays for a failed call.
Social Contract β The DPYC ecosystem is a voluntary community bound by transparent, auditable economic rules, with a Certification Chain that cascades trust from the root:
tool_idEach domain tool is registered as a ToolIdentity with a frozen tool_id
(an opaque UUID), a capability name, a category (pricing hint), and an intent
description. Mint the UUID once at the tool's birth β run
capability_uuid("get_current_weather") at a REPL (or uuid.uuid4()), then
paste the result as a literal constant and never change it again. Freezing the
literal is what lets you rename a capability later without orphaning its pricing
rows in Neon. Do not call capability_uuid(...) at runtime; the identity
must live in exactly one place:
@runtime.paid_tool() decoratorEvery paid tool is a single decorator away from full DPYC monetization.
The decorator takes the tool's frozen tool_id constant and handles debit,
balance checks, constraint evaluation, rollback on failure, and low-balance
warnings automatically. Your tool function contains only domain logic:
That is the complete paid tool. No manual debit calls, no try/except rollback blocks, no balance-warning plumbing. The decorator:
ToolIdentity registry by UUIDnpub from the function arguments for billingdpop_token for operator proof verificationregister_standard_tools(mcp, "weather", runtime, β¦) β Registers all
standard DPYC tools (balance, purchase, payment, pricing, Secure Courier,
Oracle, constraints) from the tollbooth-dpyc wheel, mounts oracle
delegations under <slug>_oracle_*, and returns the slug-prefixed
@tool decorator. Capture the return so you can use the same decorator
for your own paid tools β every wire-exposed name on this operator then
shares one slug prefix.
validate_btcpay_creds β Credential validator that checks BTCPay
credentials at receive time, not at first use. Invalid credentials are
rejected immediately during the Secure Courier exchange.
CredentialTemplate β Declares the operator's required secrets
(BTCPay host, API key, store ID) so the Secure Courier flow can prompt
for the right fields and validate them on delivery.
npub and dpop_token parametersEvery paid tool must accept npub and dpop_token keyword arguments. The
npub tells the runtime which patron to bill; dpop_token carries the
operator proof for verification:
The defaults of "" keep both parameters optional in STDIO/dev mode.
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/tollbooth-sample)<a href="https://allmcps.com/mcp/tollbooth-sample"><img src="https://allmcps.com/api/badge/tollbooth-sample?style=directory" alt="Tollbooth Sample on AllMCPs" /></a>