pyrimid
What is Pyrimid?
Pyrimid is a protocol where vendors sell paid MCP tools / AI APIs, agents discover and buy them via x402, and commissions settle instantly in USDC via smart contracts on Base.
Agent discovers a product → purchases via x402 → smart contract splits payment:
1% → Protocol treasury
0–50% → Affiliate agent (set by vendor)
Remainder → VendorNo affiliate? Vendor gets 99%. Vendors only pay for distribution that drives real sales. One layer only — no MLM, no pyramids. Just clean, transparent commission splitting onchain.
Related MCP server: Moltjiji
Why Pyrimid?
Problem | Pyrimid's Solution |
Agents can't monetize recommendations | Earn commissions by recommending products to users |
Vendors can't reach agents at scale | List once, get discovered by every agent on the network |
Commission payments are slow & opaque | Instant USDC settlement via smart contracts — fully auditable |
No standard for agent commerce | x402 payments + MCP tools + onchain registry = open standard |
Quick Start
Install the SDK
npm install @pyrimid/sdkFor Agents — Find & Recommend Products
import { PyrimidResolver } from '@pyrimid/sdk';
const resolver = new PyrimidResolver({ affiliateId: 'af_your_id' });
// Search the catalog
const product = await resolver.findProduct("trading signals");
// Purchase with x402 payment (auto-splits commissions)
if (product) {
const receipt = await resolver.purchase(product, agentWallet);
console.log(`Earned: $${receipt.affiliate_earned / 1_000_000} USDC`);
}For Vendors — List Your Product
import { pyrimidMiddleware } from '@pyrimid/sdk';
// 10 lines to activate affiliate distribution
app.use(pyrimidMiddleware({
vendorId: 'vn_your_id',
products: {
'/api/signals/latest': {
productId: 'signals_latest',
price: 250_000, // $0.25 USDC
affiliateBps: 1000, // 10% to affiliates
},
},
}));For Frameworks — Embed as Default Layer
import { createPyrimidMcpServer } from '@pyrimid/sdk';
// Deploy an MCP server — agents connect, browse, buy
const server = createPyrimidMcpServer({
affiliateId: 'af_your_id',
serverName: 'my-recommender',
});Live buyer-agent test surfaces
Call these without payment to receive HTTP 402 with x402 accepts[] metadata. Retry with X-PAYMENT or X-PAYMENT-TX after payment.
Endpoint | Price | Use case |
| $0.25 | BTC derivatives signal snapshot |
| $0.05 | Trusted agent search |
| $0.10 | Agent listing enrichment |
| $0.05 | Category scouting for buyer agents |
| $0.25 | Vendor lead discovery |
| $0.10 | MCP monetization audit |
| $0.10 | Vendor x402 integration plan |
Three Integration Paths
Path | Who | Effort | Leverage |
Embedded Resolver | Agent frameworks & toolkits | 3 lines | Every agent on your stack earns you commissions |
MCP Server | Agent infrastructure providers | 5 lines | Agents connect to your server to discover products |
Vendor Middleware | API & product builders | 10 lines | Activate affiliate distribution on your product |
Smart Contracts (Base Mainnet)
All contracts are deployed and verified on Base. ERC-1967 upgradeable proxy pattern.
Contract | Address | Purpose |
Registry | Affiliate & vendor registration, ERC-8004 identity linking | |
Catalog | Product listings with pricing & commission rates | |
Router | Commission splitting engine with | |
Treasury | Protocol operations fund |
API Reference
The Pyrimid API is free to read, rate-limited (60 req/min), and returns JSON.
Endpoint | Method | Description |
|
| Full product catalog with search, filters, pagination |
|
| Seed paid endpoints for x402 buyer-agent testing |
|
| Protocol-level stats (volume, transactions, affiliates) |
|
| Affiliate performance & earnings |
|
| Vendor analytics |
|
| MCP JSON-RPC 2.0 endpoint (Streamable HTTP) |
|
| Server info & tool definitions |
MCP Tools
Tool | Description |
| Search catalog by query, price, category, verified status |
| Purchase a product via x402 with affiliate attribution |
| Preview the commission split before buying |
| List all product categories with counts |
| Instructions to register as an affiliate onchain |
Architecture
pyrimid/
├── app/ # Next.js 15 (Vercel, region: bom1)
│ ├── page.tsx # Landing page
│ ├── dashboard/ # Protocol dashboard
│ └── api/
│ ├── v1/catalog/ # Aggregated product catalog
│ ├── v1/paid/ # Seed x402 paid endpoints
│ ├── v1/stats/ # Protocol & affiliate analytics
│ └── mcp/ # MCP JSON-RPC endpoint
├── sdk/ # @pyrimid/sdk (published to npm)
│ └── src/
│ ├── resolver.ts # PyrimidResolver — search, purchase, stats
│ ├── mcp-server.ts # MCP server factory
│ ├── middleware.ts # Vendor payment middleware + calculateSplit()
│ └── types.ts # ABIs, addresses, interfaces
├── subgraph/ # The Graph indexer (Base)
│ ├── schema.graphql # PaymentRouted, Affiliate, Vendor entities
│ ├── subgraph.yaml # 4 data sources
│ └── src/mapping.ts # Event handlers
├── middleware.ts # Edge rate limiting (60/min API, 120/min MCP)
└── public/docs/ # Developer documentationDevelopment
# Clone & install
git clone https://github.com/pyrimid/protocol.git
cd protocol
npm install
# Run locally
cp .env.example .env
npm run dev
# SDK development
cd sdk
npm run build # TypeScript → dist/
npm run dev # Watch modeDeploy
# Website + API
npx vercel --prod
# SDK to npm
cd sdk && npm publish --access public
# Subgraph to The Graph
cd subgraph && npx graph deploy pyrimid --studioSecurity
Payment verification: Real onchain verification via viem — checks
PaymentRoutedevents + USDC transfers with 5-minute expiryRate limiting: Edge middleware, 60 req/min per IP on catalog/stats, 120/min on MCP
BigInt safety:
calculateSplit()handles bothNumberandBigIntinputs from web3 librariesContract pattern: ERC-1967 upgradeable proxies with verified source on BaseScan
Roadmap
Core contracts deployed on Base
SDK v0.2.3 with full catalog pagination
MCP server with 5 tools
x402 Bazaar aggregation (92+ products)
Subgraph indexing on The Graph
Rate limiting & security hardening
ERC-8004 identity verification for vendors
Multi-network support (Arbitrum, Optimism)
Revenue dashboard for affiliates
Vendor self-service registration portal
Links
Resource | URL |
Website | |
Documentation | |
SDK | |
Subgraph | |
Registry | |
Router |
This server cannot be deployed
Maintenance
Related MCP Connectors
Agentic commerce network: discover sellers and products, negotiate, and pay USDC on Base via x402.
Multi-seller shopping for AI agents. Settle via Stripe MPP or x402 USDC on Base. Hosted.
Multi-seller shopping for AI agents. Settle via Stripe MPP or x402 USDC on Base. Hosted.
AI agent-to-agent SLA agreements on Base with insurance, reputation, and x402 payments.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables AI agents to autonomously request services from other specialized agents and compensate them via x402 micropayments. Demonstrates a Machine-to-Machine economy using A2A protocol for agent communication, MCP for context management, and blockchain-based payments on Base network.43 npm2MIT
- AlicenseNot gradedqualityDmaintenanceAn agent-to-agent marketplace where AI agents discover, hire, and pay each other in USDC on Base. Agents list services, post jobs, submit proposals, and invoke each other's capabilities — all through API, MCP, or A2A protocol.MIT
- FlicenseAqualityNot gradedmaintenanceTrust infrastructure for AI agents on Base. DEX Spread Oracle (live Uniswap V3 prices), on-chain escrow, insurance pool, and collective knowledge base. 7 smart contracts. Pay-per-query via x402 micropayments in USDC.6-
- FlicenseAqualityCmaintenancePay-per-call tools for AI agents including trust checks, due diligence, market data, and human-verified approvals, settled in USDC on Base via the x402 protocol.16-