Two weeks ago I shipped five MCP servers — a Lightning wallet, a NOSTR client, a marketplace publisher, a hub admin, and a paywall sidecar. People kept asking what they were for. This is the answer.
nostr-merchant is a local-first Python agent built to run a business on NOSTR. Not a chatbot with a wallet bolted on — an agent that holds the whole merchant toolkit and the guardrails to use it safely: it reads its Lightning balance and lists incoming sats, publishes notes and listings, runs a Shopstr storefront, sends and reads encrypted DMs, and pays for the paid tools it needs to finish a job — all under sats budget caps it cannot exceed.
What it can do#
Give it a job. It has 37 tools across the five servers and picks what it needs:
- check the wallet, list incoming sats, decode invoices (nwc-mcp)
- publish notes, listings, and profile updates; resolve profiles and NIP-05; send and read encrypted DMs (nostr-ops-mcp)
- create and update stalls and products on a Shopstr storefront (marketplace-mcp)
- pay paywalled MCP tools over NWC and redeem the result (paywall-mcp)
Then it reports back with a ## Receipts section naming every paid tool it called. No black box.
Sovereign by default, capable on demand#
Point NOSTR_MERCHANT_MODEL at a local Ollama model and nothing phones home, nothing needs a phone number — your wallet, your keys, your inference, your box. Need more capability for a hard task? The same env var switches to anthropic:… or openai:…. Only the inference location changes; the wallet and nsec stay local, which is exactly where the trust boundary belongs.
(Honest note: a 37-tool agent loop on a small local model wants a GPU. On modest hardware, run a hosted model for the reasoning and keep the wallet + keys local.)
Budget caps it can't argue with#
An agent with a pay_invoice tool is a liability without limits. Three caps sit on top of nwc-mcp's own wallet caps:
- per-task — one job can spend at most N sats
- per-day — a rolling 24h ceiling across all jobs
- per-tool price — refuse any single paid tool over a threshold, whatever the remaining budget
Every tool call routes through agent-layer middleware: allowlist → read-only refusal of priced tools → forward → on payment_required, enforce price-cap + budget-cap → on payment, record the spend → audit at every step. A tool that asks more than your cap gets refused, not paid. AGENT_READ_ONLY=true kills all spend in one flag.
Auditable#
Every tool call, LLM call, and budget block is one NDJSON line — same shape as the servers' logs. nostr-merchant audit prints it. You verify what your merchant did from the log, not from the model's summary.
Where v0.2 stands#
This release ships the complete toolkit, the safety stack, and a working self-paying loop as proof the agent-pays-for-tools path holds end to end. Directing it at your own merchant workflows — publish this product, answer that buyer, post the launch — is what it's built for. Unattended, scheduled storefront-tending is the road ahead; this is the foundation it runs on.
Try it#
pipx install nostr-merchant # or: uvx --from nostr-merchant nostr-merchant --help
nostr-merchant doctor # ping every MCP server
nostr-merchant ask "What's my Lightning wallet balance?"
CLI: ask · doctor · budget · audit · config-print · version. Built on pydantic-ai (no LangChain). 71 tests, ruff + mypy --strict clean. MIT.
Where to get it#
Free on PyPI. The Shopstr listing (100k sats) bundles the full setup walkthrough — wiring all five servers + your NWC sub-wallet + model backend — plus a direct support DM with me. The five MCP servers it drives are 50k each on the same storefront, or npx -y on npm.
Built for people who want their commerce sovereign, capped, and audited. Zap if you ship something with it.
— LLMOps.Pro · npub1hdg932jvwc3jdvkqywgqv0ue4nn60exrf92asy8mtazt3hjg7d2s2yw0nw · sovereigncitizens@getalby.com


