streamable-httpMITupdated 3mo ago
Agent-commerce infra for paid MCP tools and x402 AI/API products on Base.
What can you do with Pyrimid Protocol?
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 ā Vendor
No 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.
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/sdk
For 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 |
|---|---|---|
/api/v1/paid/signals |
$0.25 | BTC derivatives signal snapshot |
/api/v1/paid/agentzone-search?q=agent-commerce |
$0.05 | Trusted agent search |
/api/v1/paid/mya-agent-enrichment?agent=demo |
$0.10 | Agent listing enrichment |
/api/v1/paid/mya-category-scout?category=developer-tools |
$0.05 | Category scouting for buyer agents |
/api/v1/paid/vendor-lead-discovery?segment=mcp |
$0.25 | Vendor lead discovery |
/api/v1/paid/mcp-server-audit?url=https://example.com/mcp |
$0.10 | MCP monetization audit |
/api/v1/paid/x402-integration-plan?service=agent-api |
$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 | 0x34e22fc2...389 |
Affiliate & vendor registration, ERC-8004 identity linking |
| Catalog | 0xC935d6B7...908 |
Product listings with pricing & commission rates |
| Router | 0xc949AEa3...68B |
Commission splitting engine with maxPrice slippage protection |
| Treasury | 0x74A512F4...12C |
Protocol operations fund |
API Reference
The Pyrimid API is free to read, rate-limited (60 req/min), and returns JSON.
| Endpoint | Method | Description |
|---|---|---|
/api/v1/catalog |
GET |
Full product catalog with search, filters, pagination |
/api/v1/paid/* |
GET |
Seed paid endpoints for x402 buyer-agent testing |
/api/v1/stats |
GET |
Protocol-level stats (volume, transactions, affiliates) |
/api/v1/stats?type=affiliate&id=af_xxx |
GET |
Affiliate performance & earnings |
/api/v1/stats?type=vendor&id=vn_xxx |
GET |
Vendor analytics |
/api/mcp |
POST |
MCP JSON-RPC 2.0 endpoint (Streamable HTTP) |
/api/mcp |
GET |
Server info & tool definitions |
MCP Tools
| Tool | Description |
|---|---|
pyrimid_browse |
Search catalog by query, price, category, verified status |
pyrimid_buy |
Purchase a product via x402 with affiliate attribution |
pyrimid_preview |
Preview the commission split before buying |
pyrimid_categories |
List all product categories with counts |
pyrimid_register_affiliate |
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 documentation
Development
# 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 mode
Deploy
# Website + API
npx vercel --prod
# SDK to npm
cd sdk && npm publish --access public
# Subgraph to The Graph
cd subgraph && npx graph deploy pyrimid --studio
Security
- Payment verification: Real onchain verification via viem ā checks
PaymentRoutedevents + USDC transfers with 5-minute expiry - Rate limiting: Edge middleware, 60 req/min per IP on catalog/stats, 120/min on MCP
- BigInt safety:
calculateSplit()handles bothNumberandBigIntinputs from web3 libraries - Contract 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 | pyrimid.ai |
| Documentation | pyrimid.ai/docs |
| SDK | npmjs.com/package/@pyrimid/sdk |
| Subgraph | thegraph.com/studio/subgraph/pyrimid |
| Registry | BaseScan |
| Router | BaseScan |
Install
Add Pyrimid Protocol to your client. Pick the one you use.
claude mcp add --transport http pyrimid-protocol https://pyrimid.ai/api/mcpcodex mcp add pyrimid-protocol --url https://pyrimid.ai/api/mcp{
"mcpServers": {
"pyrimid-protocol": {
"url": "https://pyrimid.ai/api/mcp"
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
{
"servers": {
"pyrimid-protocol": {
"type": "http",
"url": "https://pyrimid.ai/api/mcp"
}
}
}Add to `.vscode/mcp.json` in your workspace.
{
"mcpServers": {
"pyrimid-protocol": {
"url": "https://pyrimid.ai/api/mcp"
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"pyrimid-protocol": {
"serverUrl": "https://pyrimid.ai/api/mcp"
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
Score
39 / 100
Incomplete
- Documentation25/25
- Maintenance13/25
- Trust16/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 111 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 6 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint ā no local install
Version history
| Versions | Published |
|---|---|
| 1.0.0Latest | May 12, 2026 |