Pyrimid Protocol

Registre officiel Finance et paiements

Agent-commerce MCP server for x402/USDC payments and affiliate splits on Base.

Installation

Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).

Remote (streamable-http)
Claude Code
claude mcp add --transport http pyrimid-protocol 'https://pyrimid.ai/api/mcp'
Configuration JSON (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "pyrimid-protocol": {
            "type": "http",
            "url": "https://pyrimid.ai/api/mcp"
        }
    }
}

Documentation

Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.

Sommaire
  1. Pyrimid Protocol
  2. What is Pyrimid?
  3. Why Pyrimid?
  4. Quick Start
  5. Live buyer-agent test surfaces
  6. Three Integration Paths
  7. Smart Contracts (Base Mainnet)
  8. API Reference
  9. Architecture
  10. Development
  11. Security
  12. Roadmap
  13. Links

Pyrimid Protocol

Agent-commerce infra for paid MCP tools and x402 AI/API products on Base.

Website · Quickstart · MCP Server · SDK on npm · Contracts


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?

ProblemPyrimid's Solution
Agents can't monetize recommendationsEarn commissions by recommending products to users
Vendors can't reach agents at scaleList once, get discovered by every agent on the network
Commission payments are slow & opaqueInstant USDC settlement via smart contracts — fully auditable
No standard for agent commercex402 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.

EndpointPriceUse case
/api/v1/paid/signals$0.25BTC derivatives signal snapshot
/api/v1/paid/agentzone-search?q=agent-commerce$0.05Trusted agent search
/api/v1/paid/mya-agent-enrichment?agent=demo$0.10Agent listing enrichment
/api/v1/paid/mya-category-scout?category=developer-tools$0.05Category scouting for buyer agents
/api/v1/paid/vendor-lead-discovery?segment=mcp$0.25Vendor lead discovery
/api/v1/paid/mcp-server-audit?url=https://example.com/mcp$0.10MCP monetization audit
/api/v1/paid/x402-integration-plan?service=agent-api$0.10Vendor x402 integration plan

Three Integration Paths

PathWhoEffortLeverage
Embedded ResolverAgent frameworks & toolkits3 linesEvery agent on your stack earns you commissions
MCP ServerAgent infrastructure providers5 linesAgents connect to your server to discover products
Vendor MiddlewareAPI & product builders10 linesActivate affiliate distribution on your product

Smart Contracts (Base Mainnet)

All contracts are deployed and verified on Base. ERC-1967 upgradeable proxy pattern.

ContractAddressPurpose
Registry0x34e22fc2...389Affiliate & vendor registration, ERC-8004 identity linking
Catalog0xC935d6B7...908Product listings with pricing & commission rates
Router0xc949AEa3...68BCommission splitting engine with maxPrice slippage protection
Treasury0x74A512F4...12CProtocol operations fund

API Reference

The Pyrimid API is free to read, rate-limited (60 req/min), and returns JSON.

EndpointMethodDescription
/api/v1/catalogGETFull product catalog with search, filters, pagination
/api/v1/paid/*GETSeed paid endpoints for x402 buyer-agent testing
/api/v1/statsGETProtocol-level stats (volume, transactions, affiliates)
/api/v1/stats?type=affiliate&id=af_xxxGETAffiliate performance & earnings
/api/v1/stats?type=vendor&id=vn_xxxGETVendor analytics
/api/mcpPOSTMCP JSON-RPC 2.0 endpoint (Streamable HTTP)
/api/mcpGETServer info & tool definitions
MCP Tools
ToolDescription
pyrimid_browseSearch catalog by query, price, category, verified status
pyrimid_buyPurchase a product via x402 with affiliate attribution
pyrimid_previewPreview the commission split before buying
pyrimid_categoriesList all product categories with counts
pyrimid_register_affiliateInstructions 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 PaymentRouted events + 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 both Number and BigInt inputs from web3 libraries
  • Contract pattern: ERC-1967 upgradeable proxies with verified source on BaseScan

Roadmap

  • [x] Core contracts deployed on Base
  • [x] SDK v0.2.3 with full catalog pagination
  • [x] MCP server with 5 tools
  • [x] x402 Bazaar aggregation (92+ products)
  • [x] Subgraph indexing on The Graph
  • [x] Rate limiting & security hardening
  • [ ] ERC-8004 identity verification for vendors
  • [ ] Multi-network support (Arbitrum, Optimism)
  • [ ] Revenue dashboard for affiliates
  • [ ] Vendor self-service registration portal


Built on Base · Payments via x402 · Settlement in USDC

Questions fréquentes

Qu'est-ce que Pyrimid Protocol ?

Agent-commerce MCP server for x402/USDC payments and affiliate splits on Base.

Comment installer Pyrimid Protocol ?

Il fonctionne comme serveur distant. Dans Claude Code : claude mcp add --transport http pyrimid-protocol 'https://pyrimid.ai/api/mcp'. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.

Faut-il une clé API pour Pyrimid Protocol ?

Son entrée au registre n'indique aucune clé ni secret obligatoire. Certaines fonctions peuvent tout de même demander un compte auprès du service auquel il se connecte.

Pyrimid Protocol est-il open source ?

Oui. Son code est sur GitHub sous licence MIT.

Qui maintient Pyrimid Protocol ?

Il est publié par pyrimid-ai. AI.tn le référence sans le maintenir ni le recommander.

Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.