A ContextVM MCP server demonstrating paid tool capabilities using CEP-8 payments.
This server exposes an add tool over the Nostr network via ContextVM, with each invocation costing 1 satoshi. It demonstrates how to build monetized MCP servers using the @contextvm/sdk.
- Nostr Transport: Exposes tools over the decentralized Nostr network
- Paid Capabilities: CEP-8 payment integration via Lightning Network (NWC)
- Simple Tool: Basic
addoperation for testing payments
- Bun runtime
- A Nostr private key for the server (optional)
- NWC (Nostr Wallet Connect) connection string for receiving payments
bun installSet the following environment variables:
| Variable | Description |
|---|---|
SERVER_PRIVATE_KEY |
Nostr private key (hex format)(optional) |
NWC_SERVER_CONNECTION |
NWC connection string (bolt11/UD-URI) |
RELAYS |
Comma-separated list of relay URLs (optional) |
Example:
export SERVER_PRIVATE_KEY="your-hex-private-key"
export NWC_SERVER_CONNECTION="nostr+walletconnect://..."bun run index.tsAdds two numbers together.
Cost: 1 satoshi per call
Parameters:
a(number): First numberb(number): Second number
MIT