System flow
AI Agent / Builder Runtime
|
| MCP JSON-RPC
v
Celo PayGrid MCP HTTP
|
| ERC-8004 signed backend request
v
Celo PayGrid Backend API
|
| viem contract writes / reads
v
PaygridLink + PaygridRouter on Celo Mainnet
|
| PaymentReceived event
v
Indexer
|
| normalized payment state
v
Supabase
|
| payment lookup / verification
v
MCP verify_payment + Frontend checkout status
Components
MCP HTTP service
The MCP service exposes JSON-RPC tools, serves public metadata, protects write tools with an API key and signs protected backend requests with the configured agent key.
Backend API
The backend creates payment requests, reads state, prepares transaction payloads, validates ERC-8004 signed requests, applies rate limits and writes normalized state to Supabase.
Contracts
PaygridLink stores request state. PaygridRouter coordinates settlement and emits payment events on Celo Mainnet.
Indexer
The indexer watches PaymentReceived events from the router and updates confirmed payment records.
Supabase
Supabase stores agents, payment links, payments, onramp sessions, users and migration state.
Trust boundaries
| Boundary | Control |
|---|---|
| Browser to backend | CORS, validation, rate limits |
| MCP remote write tools | API key |
| MCP to backend protected routes | ERC-8004 signed HTTP headers |
| Backend to contracts | backend wallet / viem |
| Contract settlement | Celo Mainnet |
| Payment status | indexer + Supabase + onchain events |
ERC-8004 signed request format
paygrid:erc8004:<agentId>:<address>:<METHOD>:<path>:<timestamp>:<nonce>
Deployment shape
| Surface | Runtime |
|---|---|
https://celopaygrid.xyz | landing / frontend hosting |
https://api.celopaygrid.xyz | VPS + Nginx + Docker backend |
https://mcp.celopaygrid.xyz | VPS + Nginx + Docker MCP HTTP |
| indexer | private Docker service |
| database | Supabase |
| contracts | Celo Mainnet |