Sera Sera for Agents / Docs / Architecture
Architecture

How the layers compose.

Sera for Agents is a stack of independent layers. Pick the highest one that solves your problem; everything below it is implementation detail.

The stack, top-down

┌─────────────────────────────────────────────────────────┐
│  Your app / agent / dashboard / widget / cron job       │
└─────────────────┬───────────────────────────┬───────────┘
                  │                           │
       ┌──────────▼──────────┐    ┌───────────▼──────────┐
       │  MCP host           │    │  HTTP (x402)          │
       │  Claude / Cursor /  │    │  Plain fetch / curl   │
       │  ChatGPT / Hermes   │    │                       │
       │  / OpenClaw / your  │    │                       │
       │  own.               │    │                       │
       └──────────┬──────────┘    └───────────┬──────────┘
                  │                           │
       ┌──────────▼──────────┐    ┌───────────▼──────────┐
       │  sera-mcp           │    │  x402-service         │
       │  32 tools, stdio    │    │  Express, /x402/swap  │
       │  JSON-RPC.          │    │  402 → pay → 200      │
       │  Policy + caps +    │    │  Wraps sera-mcp.      │
       │  signer + dry-run.  │    │                       │
       └──────────┬──────────┘    └───────────┬──────────┘
                  │                           │
                  └─────────────┬─────────────┘
                                │
                  ┌─────────────▼─────────────┐
                  │  Sera REST API             │
                  │  api.sera.cx/api/v1        │
                  │  /tokens · /markets · /fx  │
                  │  /quote · /execute · /...  │
                  └─────────────┬─────────────┘
                                │
                  ┌─────────────▼─────────────┐
                  │  Sera Protocol             │
                  │  CLOB on Ethereum mainnet  │
                  │  Maker / taker / settle    │
                  └────────────────────────────┘

Layers explained

1. Sera Protocol (on-chain)

An on-chain central limit order book for stablecoin FX, deployed on Ethereum mainnet. Makers post quotes, takers cross them, settlement is atomic. Not a DEX. Not an AMM. Think Visa, not Uniswap.

2. Sera REST API (api.sera.cx/api/v1)

The canonical interface to Sera Protocol state. Token registry, market catalog, FX rates, quote generation, execute. Every higher layer routes through this.

3. sera-mcp (the MCP)

32 tools exposed over the Model Context Protocol — stdio JSON-RPC. Wraps the REST API with policy gates, daily volume caps, dry-run kill switch, EIP-712 quote→sign→execute flow, server-derived USD notional, uuid-route_params binding. Self-contained: no SDK, no signer, no key handling.

Why an MCP? Because every modern agent host (Claude, Cursor, ChatGPT, OpenClaw, Hermes, NanoClaw) speaks MCP natively. Three lines of config and your agent has 32 FX tools.

4. x402-service (HTTP wrapper)

A thin Express server that wraps sera-mcp behind the x402 payment protocol. The calling agent pays USDC over plain HTTP, the service performs the FX swap on Sera, the recipient gets the target currency. No MCP host required, no SDK to import.

5. Templates & bundled agent

Pre-wired starter projects (terminal chat, web chat, webhook responder) and a complete bundled Sera Agent — useful when you want one-command-to-run rather than configure-from-scratch.

Two execution paths

Every interaction with Sera goes through one of two paths, depending on whether the caller speaks MCP or HTTP:

Path 1 — MCP (the default)

Path 2 — x402 (skip MCP)

Trust boundaries

What the MCP can do

What the MCP cannot do

x402 trust model

The x402-service runs a vault wallet that holds USDC inflows and executes the FX swap. That's a centralized custodian for the duration of the swap. Use the MCP path if you want the user's own wallet to sign every leg.

Where to put your code

Repository layout

sera-mcp/            — the MCP server itself (32 tools, CLI)
sera-agents/
├── integrations/     — per-host install snippets (11 hosts)
├── templates/        — chat-cli · web-chat · webhook starters
├── sera-agent/       — the bundled interactive agent
├── x402-service/     — x402 HTTP wrapper around sera-mcp
├── x402/             — EIP-3009 payment helpers
├── examples/         — minimal one-file references
└── docs/             — this site

Next up: Concepts (CLOB, MCP, x402, EIP-712) · Pick a tutorial · Full API reference.