- Gate endpoints behind x402 USDC paywalls
- Publish a machine-readable manifest at
/.well-known/agent.json - Expose a trust score at
/reputation - Register on the decentralized Solana registry for autonomous discovery
Prerequisites
- Node.js ≥ 18
- pnpm (
npm install -g pnpm) - A Solana Devnet wallet with a small amount of SOL (for the one-time on-chain registration)
Option A: Use the Reference Server
Clone the repo and run as-is — then add your own routes.1
Clone & Install
2
Configure Environment
.env:.env
3
Build & Start
4
Add Your Own Routes
Create new files in
packages/mcp-server/src/api/routes/services/. Each route needs:- A route handler with your business logic
- The
x402Paywall(amount, USDC_MINT)middleware to enforce payment - An entry in the service manifest
/.well-known/agent.json is what buyer agents read to decide what to buy. Keep it accurate.Option B: Use the SDK in Your Own App
If you already have an Express.js server, install the SDK and add paywalls to your existing routes:Register On-Chain
Register your merchant on the decentralized Solana registry so buyer agents can discover you: Using the CLI:How Buyers Find and Pay You
Once you’re registered, the buyer flow is fully autonomous:
No human touches steps 1–5.