nostr-merchant
The AI that runs your NOSTR business. A local-first Python agent that holds the whole merchant toolkit — it checks its Lightning wallet, publishes notes and listings, runs a Shopstr storefront, answers encrypted DMs, triages its NOSTR inbox to draft and post replies, and pays for paywalled MCP tools over NWC — all under sats budget caps it can't exceed. Built on five MCP servers (nwc-mcp, nostr-ops-mcp, marketplace-mcp, albyhub-admin-mcp, paywall-mcp) — 37 tools the agent picks from.
Ollama-first, API-pluggable. Built on pydantic-ai — no LangChain. MIT.
v0.3 — engagement inbox. Seven CLI commands.
nostr-merchant inboxtriages replies/mentions on your recent posts and drafts responses in your voice (read-only, language-matched);inbox --postwalks each draft (approve / edit / skip), confirms, and publishes the approved ones as NIP-10 replies. The agent layer enforces a budget-and-audit safety pipeline on top of every MCP server's own safety stack; the self-paying-for-tools loop holds end to end given a working LLM backend (Ollama / Anthropic / OpenAI). (Renamed fromllmops-agentin v0.2.)
Install
pipx install nostr-merchant # recommended: isolated CLI
# or: uvx --from nostr-merchant nostr-merchant --help
# or: pip install nostr-merchant
The five MCP servers it drives are launched on demand via npx -y — no separate install. You need Python 3.11+, an NWC-compatible wallet (e.g. Alby Hub), and an LLM backend (see Usage).
Status
| Layer | State |
|---|---|
| Design doc | ✅ Done — ../03-python-reference-agent-design.md |
Package scaffold (uv init, pyproject.toml, ruff/mypy/pytest config) |
✅ Done |
config.py — env-driven Pydantic Settings |
✅ Done |
budget.py — persistent rolling-window tracker |
✅ Done |
audit.py — NDJSON writer |
✅ Done |
mcp_servers.py — MCPServerStdio launch + doctor probe |
✅ Done |
agent.py — Pydantic AI agent + process_tool_call middleware |
✅ Done |
workflows/research.py — self-paying research workflow |
✅ Done |
cli.py — typer entry-point with ask / doctor / budget / audit / config-print / version |
✅ Done |
| Live LLM smoke test (Anthropic Haiku) | ✅ Done — end-to-end ask returns a real nwc_get_balance receipt with all 37 substrate tools loaded |
Usage
# from this directory, with uv-installed venv
uv run nostr-merchant --help
uv run nostr-merchant version
uv run nostr-merchant budget # snapshot, no LLM needed
uv run nostr-merchant config-print # effective config, secrets masked
uv run nostr-merchant doctor # ping each configured MCP server
uv run nostr-merchant ask "What's my Lightning wallet balance?" # the main demo loop
uv run nostr-merchant audit --tail 20 # recent audit entries
Or run the whole sequence with the bundled script: ./smoke.sh (full run — the ask is read-only, so it can never move sats) or ./smoke.sh --no-ask (skip the LLM call entirely).
ask requires a working LLM backend, set via NOSTR_MERCHANT_MODEL:
anthropic:claude-haiku-4-5-20251001(or any Anthropic/OpenAI model) — fast, reliable tool-calling. SetANTHROPIC_API_KEY(orOPENAI_API_KEY) in~/.nostr-merchant/.env. Recommended for most setups.ollama:<model>— fully local, no KYC, no phone-home (the sovereignty default). Needs Ollama atlocalhost:11434. Reality check: a 37-tool agent loop wants real hardware — a small model on a CPU-only box is too slow to be practical. Run Ollama on a GPU, or use a hosted model and keep your wallet + keys local (the trust boundary that actually matters).
Provider creds in ~/.nostr-merchant/.env are loaded automatically — no need to export them.
Dev loop
uv sync # install deps + dev deps into .venv
uv run ruff check # lint
uv run mypy # type check
uv run pytest # tests
Build wheel for distribution:
uv build
License
MIT — see LICENSE.
Contact
Built by LLMOps.Pro.
- NOSTR:
npub1hdg932jvwc3jdvkqywgqv0ue4nn60exrf92asy8mtazt3hjg7d2s2yw0nw - Lightning Address:
sovereigncitizens@getalby.com - Shopstr: shopstr.store/marketplace/SOVEREIGN_CITIZENS
Metadata
Release files for nostr-merchant 0.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nostr_merchant-0.5.3.tar.gz | 35.9 kB | Without provenance | Details for nostr_merchant-0.5.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nostr_merchant-0.5.3-py3-none-any.whl | Python 3 | none | any | Details for nostr_merchant-0.5.3-py3-none-any.whl |
Total release size: 77.3 kB
Release files / nostr_merchant-0.5.3.tar.gz
| Download URL | nostr_merchant-0.5.3.tar.gz |
|---|---|
| Size | 35.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f493f5e86f4a0b95142bba866745a4492db770fce863fcea15cb10606e081fc1
|
|
BLAKE2b-256 checksum How to use checksums |
dc85e4abc6332ff7ee457cf66860f646f6b7ed9c771f0db42e91d1777dacdc5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.14
|
Release files / nostr_merchant-0.5.3-py3-none-any.whl
| Download URL | nostr_merchant-0.5.3-py3-none-any.whl |
|---|---|
| Size | 41.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a77aa10e3766d4f19da2c71d2dd4ad0cef12337ee303d096b8797b275756d690
|
|
BLAKE2b-256 checksum How to use checksums |
bef9096bd30c1b7070cf1e5a51bbb1cfbdbf2c70c33028ad2afc1f3c33b93728
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.14
|
Security for nostr-merchant 0.5.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.