marketplace-mcp
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**A NOSTR storefront for your LLM agent — speaks both dialects.** MCP server that lets an agent create + update marketplace events on your behalf, in two dialects out of the box:
- **NIP-15** (kind:30017 stalls + kind:30018 products) for NIP-15-native clients (Plebeian Market, etc.).
- **Shopstr-modern** (kind:30019 shop profile + kind:30402 NIP-99 classified listings) — what shopstr.store actually renders. Includes an automatic cache-POST so events appear on the storefront, not just on relays.
Seven tools, defense-in-depth safety, MIT licensed.
> **v0.2 — dual-dialect publisher.** v0.1.x shipped NIP-15-only and the listings never appeared on shopstr.store because Shopstr is a Postgres-backed CMS that only renders events from its own DB (populated via POST /api/db/cache-event) and its cacheable-event allowlist excludes NIP-15 kinds. v0.2 adds the Shopstr-modern tools and the cache-POST hook so the storefront actually populates. NIP-15 tools left in place for non-Shopstr targets.
---
Why this server exists
Shopstr (the canonical Bitcoin-Lightning marketplace UI on NOSTR) is **not a relay-reading Nostr client** — it's a Next.js app with a Postgres cache. Its marketplace page renders products from its own DB, populated when clients POST signed events to /api/db/cache-event. The cacheable-event allowlist (in shopstr-eng/shopstr → utils/db/cache-event-policy.ts) excludes NIP-15 stall/product kinds; modern Shopstr uses **kind:30019** (shop profile with merchants: [ ]) and **kind:30402** (NIP-99 Classified Listings, all data in tags). Without a ["t","shopstr"] tag the listing won't surface; without at least one ["image", ] tag the card silently never renders.
marketplace-mcp v0.2 builds the right events, POSTs them to Shopstr's cache after the relay publish, and keeps the legacy NIP-15 tools intact for anyone targeting other clients.
---
What you can build with this
- **A self-driving Shopstr storefront** — agent generates shop profile + product listings from a config file, republishes whenever metadata changes, drops fresh t-tag categories per product for discoverability. Same call publishes to relays AND mirrors to Shopstr's cache.
- **A sales-channel multiplexer** — the same product events propagate to every NIP-15- or NIP-99-aware client (Shopstr, Plebeian Market, etc.) by virtue of being on shared relays. Pick your dialect per-tool; publish to both if your audience spans clients.
- **A listing-as-code workflow** — version-control your product JSON in git; CI calls shopstr_create_or_update_product to deploy. Republish with the same id = idempotent update (parameterized-replaceable events).
- **Cross-server identity** — pair with nostr-ops-mcp and nwc-mcp to wire identity + commerce. Same signer, same npub, three specialized tool surfaces.
---
The seven tools
Shopstr-modern (new in v0.2) — required for shopstr.store visibility
| Tool | Kind | Purpose |
|---|---|---|
| shopstr_create_or_update_shop | 30019 | Publish the seller's shop profile (name, about, picture, banner). The d tag is the seller's pubkey hex — one shop per pubkey. After relay publish, POSTs to Shopstr's cache so the storefront UI surfaces the shop. |
| shopstr_create_or_update_product | 30402 | Publish a NIP-99 Classified Listing. All product data in tags (title, summary, price, location, shipping, image × N, t × N, quantity, condition, status, valid_until). Auto-adds ["t","shopstr"] so the product surfaces in Shopstr's marketplace feed. Cache-POST included. |
NIP-15 legacy — for NIP-15-native clients (not Shopstr)
| Tool | Kind | Purpose |
|---|---|---|
| marketplace_create_or_update_stall | 30017 | NIP-15 stall (id, name, description, currency, shipping[]). The id is the d tag — same id = replace. Relay publish only; no Shopstr cache POST (would be 400'd anyway, kind not allowlisted). |