AI agent (any host).
The classic — an MCP-powered agent with the full 32-tool Sera surface. Three paths depending on how custom you want to go: bundled Sera Agent (one command), Claude Code/Cursor/ChatGPT (just register the MCP), or your own host using OpenAI Agents SDK.
An interactive agent that can answer questions like "how much USDC to deliver exactly 5,000 MYR?", scan for FX deals, generate quotes, and (with policy gates) execute swaps. Pick the path that matches your existing workflow.
Path A — Bundled Sera Agent (fastest)
Best if you just want a working agent now and don't care which host it runs in. Comes pre-wired with MCP + LLM.
git clone https://github.com/Josh-sera/sera-agents
cd sera-agents/sera-agent && npm install
export OPENAI_API_KEY=sk-...
npm start
# Try:
> What stablecoins do you support for SGD?
> How much USDC to deliver exactly 5,000 MYR?
> Run sera.doctor
Path B — Claude Code (or Cursor, ChatGPT, etc.)
Best if you already use a modern MCP host. Three lines of config, the host loads the MCP at startup, the agent gets all 32 tools natively.
1Get sera-mcp on your machine
git clone https://github.com/Josh-sera/sera-mcp
cd sera-mcp && npm install && npm run build
2Register with the host
For Claude Code:
claude mcp add sera --scope user \
--env SERA_NETWORK=mainnet \
--env POLICY_PRESET=standard \
-- node $(pwd)/dist/index.js
For Cursor: Settings → MCP → Add a server with the same command. For ChatGPT: Settings → Connectors → MCP. See integrations/ for per-host snippets.
3Verify
In any agent session, type:
Call sera.doctor
You should get back overall_ok: true with green checks for sera_health, network_sanity, tokens_registry, signer_mode, policy.
Path C — Your own host (OpenAI Agents SDK)
Best if you're building a custom agent product and need programmatic control over the loop.
import { Agent, MCPServerStdio } from '@openai/agents';
const sera = new MCPServerStdio({
command: 'node',
args: ['/abs/path/to/sera-mcp/dist/index.js'],
env: { SERA_NETWORK: 'mainnet', POLICY_PRESET: 'standard' }
});
const agent = new Agent({
name: 'fx-helper',
instructions: 'You help with multi-currency FX settlement. Use sera.doctor first if anything looks off. Always show cost in basis points and absolute dollars.',
mcpServers: [sera]
});
const response = await agent.run('Find me FX deals over 25 bps right now.');
console.log(response);
Add policy gates (any path)
For any agent that will execute swaps, set the policy preset and caps via env vars. sera-mcp reads these and refuses to exceed them — even if the LLM tries.
SERA_NETWORK=mainnet
POLICY_PRESET=standard # or 'strict' or 'dry-run-only'
SERA_DAILY_VOLUME_CAP_USD=10000 # server-derived, not LLM-claimed
SERA_DRY_RUN=false # true = every execute returns dry-run trace
SERA_HISTORY_DB=$HOME/.sera/history.db
Useful slash commands
The MCP exposes 4 pre-templated prompts that hosts surface as commands:
/deal_scan— find FX deals across all pairs above an edge threshold/treasury_brief— multi-currency exposure report + drift/invoice_optimizer— cheapest source for a given target payout/fx_integrity_check— triangular-arb scan across a fiat basket
Common gotchas
- The agent claims it executed when it didn't. Hosts vary in how they show tool-call results. Always trust
sera.doctor+sera.settlement_statusover the LLM's narrative. - Quote expiration. Quotes are short-lived (~30s). If the agent dawdles between get_quote and execute_swap, fetch a fresh quote.
- Default to
simulate:truewhen exploring. Pass it onget_quoteto probe without a wallet — saves friction during development. - Long contexts confuse tool-routing. If the agent stops calling
sera.*tools mid-conversation, it might have lost the system prompt. Re-anchor with a fresh "use the sera tools to..."
Done with the tutorials. Next: browse the full API reference, copy a recipe, or read about how the layers compose.