sera-mcp logo

sera-mcp

Organization
sera-cx

Multi-currency settlement MCP for AI agents. 32 tools over Sera Protocol's stablecoin FX rails. Open source.

Publishersera-cx
Repositorysera-mcp
LanguageTypeScript
Forks
35
Stars
22
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    sera-mcp exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    22 stars and 35 forks from the linked repository.

sera-mcp

The core MCP server for Sera Protocol. Turns any agent into a multi-currency agent by exposing Sera Protocol — stablecoin FX settlement — as one standard tool layer. 56 tools, 5 resources, 4 slash-prompt templates. Works with Claude Code, Claude Desktop, Cursor, OpenAI Agents SDK, OpenClaw, Hermes, NanoClaw, and any other MCP-compatible host.

Who this is for: agent builders and ops engineers who need their agent to discover currencies, quote, route, and execute stablecoin FX swaps through one standard tool interface.

Companion repo: sera-cx/sera-agents — templates, examples, x402 services, and host integrations built on top of this MCP. Site: agents.sera.cx.

For deeper reading, see ARCHITECTURE.md, SECURITY-MODEL.md, and CHANGELOG.md.

This package also ships a sera CLI for cron jobs, CI scripts, and ops debugging — see CLI section below.

What you get

56 tools across 11 categories (source of truth: src/tools/registry.ts). Under the default SERA_SIGNER_MODE=external, sera.convert_and_send is hidden (local-signer only), so tools/list returns 55.

CategoryTools
Discoverylist_currencies, get_markets, doctor, search_coins, get_coin_metadata, get_coin_history
Pricing & analyticsget_fx_rate, compare_to_external_fx, multi_source_mid, spread_radar
Liquidity probingscan_markets, find_deals, maker_quote_ladder, probe_depth, round_trip_cost, infer_book, market_health, fx_quote_diff, compare_corridors
Quote & planningget_quote, prepare_swap, quote_recipient_amount, find_cheapest_settlement_path, limit_watcher, batch_quote
Treasuryget_balances, treasury_value, exposure_report, rebalance_plan, pay_invoice, settlement_status
Historyfx_history, fx_volatility, corridor_pnl
Executionexecute_swap, convert_and_send (local-signer only)
Account (tx builders)build_approve, build_deposit, build_transfer, send_tx, send_transfer
Withdraw (dual-sig)withdraw_request, withdraw_build, withdraw_send
Debuggingverify_signature, permit_metadata
Makerplace_order, cancel_order, cancel_all_orders, place_vl_batch, cancel_vl_batch, get_order, list_orders, get_fills, get_fills_for_order

5 resources (sera://currencies, sera://markets, sera://config, sera://help/tools, sera://help/quickstart) — hosts can browse without burning tool-call budget.

4 slash-prompt templates for common workflows: sera.deal_scan, sera.treasury_brief, sera.invoice_optimizer, sera.fx_integrity_check.

Install

bash
git clone <this-repo>
cd sera-mcp
npm install
npm run build

Requires Node 18.17+. Default install needs zero env vars — sensible defaults are baked in.

Wire it in

Claude Code (one line)

bash
claude mcp add sera --scope user \
  --env SERA_NETWORK=mainnet \
  --env POLICY_PRESET=standard \
  -- node /absolute/path/to/sera-mcp/dist/index.js

Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json:

json
{
  "mcpServers": {
    "sera": {
      "command": "node",
      "args": ["/absolute/path/to/sera-mcp/dist/index.js"],
      "env": {
        "SERA_NETWORK": "mainnet",
        "POLICY_PRESET": "standard"
      }
    }
  }
}

Cursor

Settings → MCP → add a stdio server pointing at node /absolute/path/to/sera-mcp/dist/index.js with the same env.

Any MCP client over stdio

bash
SERA_NETWORK=mainnet POLICY_PRESET=standard node dist/index.js

Speaks MCP over stdio. The server prints structured JSON status to stderr; stdout is reserved for the protocol.

Streamable HTTP (remote / web-served)

bash
# Default: localhost only, DNS-rebinding protection auto-enabled, stateful sessions
node dist/index.js --transport http --port 3848

# Bind public with allowedHosts header validation
node dist/index.js --transport http --host 0.0.0.0 --port 3848 \
  --allowed-hosts mcp.mydomain.com,localhost

# Serverless / stateless mode
node dist/index.js --transport http --stateless

Endpoints:

  • POST /mcp — JSON-RPC requests
  • GET /mcp — SSE stream for notifications (stateful mode)
  • DELETE /mcp — session terminate
  • GET /health — liveness probe

⚠️ NO BUILT-IN AUTH ON STREAMABLE HTTP

Anyone who can reach the bound port can call every registered Sera tool. The transport ships with DNS-rebinding protection for localhost binds and a public-bind startup guard that refuses to start when binding to a non-loopback host without --allowed-hosts or an explicit SERA_HTTP_ALLOW_UNAUTHENTICATED_PUBLIC=true acknowledgment. Do not set the ack env in production.

Safe options:

  • Localhost (default): --host 127.0.0.1 — DNS rebinding protection auto-enabled.
  • Behind an auth-handling reverse proxy: --host 0.0.0.0 --allowed-hosts mcp.mydomain.com. The proxy is the trust boundary; it must handle auth (OAuth, JWT, mTLS, Cloudflare Access — your call).
  • Future: OAuth 2.1 + RFC 8707 Resource Indicators per MCP spec v2025-06-18. Tracked in roadmap.

See SECURITY-MODEL.md for the full deployment matrix.

Verify install

In a new agent session, ask:

Call sera.doctor()

Returns a one-shot self-check: API health, network sanity, signer mode, policy summary, persistence state. If everything is green you're wired correctly.

Configure

Most installs need nothing. Override via env:

Network

VariableDefaultEffect
SERA_NETWORKmainnetmainnet → https://api.sera.cx/api/v1. sepolia → https://api-testnet.sera.cx/api/v1. URLs are hardcoded; you cannot redirect them via env.

Signer

ModeWhat happens
external (default)Server never signs. get_quote returns route_params; your wallet signs externally; execute_swap accepts the signature. Safe for distribution.
localServer holds SIGNER_PRIVATE_KEY and signs in-process. Enables convert_and_send. Only use on a trusted server with a wallet you've intentionally funded.
readonlyAll execution tools refuse. Discovery + analytics only.

Policy presets

Pre-baked bundles. Pick one with POLICY_PRESET=:

PresetSymbolsPer-tx capDaily capSlippage
starterUSDC, USDT$1,000$5,00025 bps
standard (recommended)USDC, USDT, XSGD, JPYC, MYRT, TGBP, EURC$5,000$50,00010 bps
sg-retailUSDC, USDT, XSGD$2,000$10,00015 bps
open(none)(none)(none)0

Override individual fields by setting the matching env (POLICY_MAX_NOTIONAL_USD, POLICY_DAILY_VOLUME_CAP_USD, POLICY_ALLOWED_SYMBOLS, etc.). Each override beats the preset.

Other

VariableEffect
POLICY_DRY_RUN=trueAll execute_swap calls refuse, regardless of signer mode. Paper-trading mode.
SERA_ENABLE_EXECUTION_TOOLS=falseHide the execution tool category (execute_swap, convert_and_send) from the MCP host entirely. Default true. Set false for public / multi-tenant deployments. Other tools (discovery, pricing, liquidity, quote planning, treasury, history) keep working.
SERA_HISTORY_DB=/path/to/file.dbEnables fx_history, fx_volatility, corridor_pnl. SQLite log of every fx_rate + quote call this MCP serves.
LOG_LEVELtrace | debug | info (default) | warn | error. Structured JSON to stderr.
SERA_API_KEY + SERA_API_SECRETRequired for get_balances, treasury_value, exposure_report, rebalance_plan, pay_invoice, settlement_status.

See .env.example for the full list with comments.

Security model

Built for distribution. Every layer assumes the install instructions might be hostile.

  • Hardcoded base URLs: SERA_BASE_URL is ignored by default. Overrides require a separately-named env (SERA_BASE_URL_ALLOW_CUSTOM=true) and emit a loud boot warning. A malicious install snippet can't redirect API traffic by setting one env var.
  • No redirects: undici maxRedirections: 0. Even a sera.cx subdomain can't 301 us elsewhere.
  • Quote registry: every get_quote registers {uuid → frozen route_params}. execute_swap refuses unknown uuids in local-signer mode (won't sign arbitrary intents) and refuses route_params mismatches in any mode.
  • Server-derived notional: daily volume cap is computed from route_params.maxInputAmount × token's USD value. Caller cannot lie about it.
  • Prompt arg sanitization: every prompt template arg is type-validated (address regex, fiat regex, numeric regex, symbol-list regex) before substitution into LLM context. Newline/SQL/instruction injections are rejected.
  • Policy gates: symbol whitelist, recipient whitelist, per-tx notional cap, rolling 24h volume cap, dry-run kill-switch.
  • Signer modes: server defaults to external and holds no key.
  • Caching: read-only endpoints have TTL caches with in-flight de-dupe. Quotes never cached.
  • Logging: structured JSON to stderr; never to stdout (which is reserved for MCP transport).

Run sera.doctor in any agent session for a live posture check.

Execution flow (external signer)

  1. Agent calls sera.get_quote with from, to, amount, owner_address (or simulate: true to probe with the burn address).
  2. MCP validates the request against policy and calls Sera POST /swap/quote.
  3. MCP returns uuid + route_params (the exact EIP-712 Intent struct) + caches the binding.
  4. Wallet signs route_params under the Sera EIP-712 domain:
    js
    const domain = { name: 'Sera', version: '1', chainId, verifyingContract: seraAddress };
    const types = { Intent: [
      { name: 'taker', type: 'address' },
      { name: 'inputToken', type: 'address' },
      { name: 'outputToken', type: 'address' },
      { name: 'maxInputAmount', type: 'uint256' },
      { name: 'minOutputAmount', type: 'uint256' },
      { name: 'recipient', type: 'address' },
      { name: 'initialDepositAmount', type: 'uint256' },
      { name: 'uuid', type: 'uint256' },
      { name: 'deadline', type: 'uint48' },
    ]};
    const sig = await signer.signTypedData(domain, types, route_params);
  5. Agent calls sera.execute_swap with { uuid, signature }.

Quotes are single-use. On QUOTE_STALE / 410, re-quote — do not retry the same uuid.

Architecture

┌────────┐    sera.get_quote        ┌───────────────┐     POST /swap/quote     ┌──────┐
│ Agent  │ ───────────────────────▶ │  sera-mcp     │ ───────────────────────▶ │ Sera │
│        │                          │ (cache+policy │                          │  API │
│        │ ◀── route_params + uuid  │  +registry)   │ ◀──── uuid + route       │      │
└────────┘                          └───────────────┘                          └──────┘
     │  sign route_params (EIP-712)
     ▼
 wallet / external signer
     │  signature
     ▼
sera.execute_swap (uuid + sig) ──▶ sera-mcp ──▶ POST /swap ──▶ Sera ──▶ on-chain settlement
                                       │
                                       └─ enforces uuid binding, daily cap, dry-run

Source layout:

src/
├── index.ts                    MCP server entrypoint, tool/resource/prompt registration
├── config.ts                   env loading, hardcoded URL allowlist, AppContext
├── resources.ts                MCP resources (sera://...)
├── prompts.ts                  slash-prompt templates with arg sanitization
├── sera/
│   ├── client.ts               REST client + TTL cache wrapper
│   ├── tokens.ts               token resolver, decimals math
│   └── types.ts
├── signer/signer.ts            EIP-712 signer (external | local | readonly)
├── policy/policy.ts            whitelist, caps, presets, dry-run, daily volume gate
├── tools/                      56 tool handlers (registry + modules)
└── util/
    ├── cache.ts                TTL cache + in-flight de-dupe
    ├── limit.ts                bounded-concurrency runner
    ├── external_fx.ts          Frankfurter / open.er-api / exchangerate.host clients
    ├── persistence.ts          optional SQLite log
    ├── logger.ts               structured stderr JSON
    ├── quote_registry.ts       uuid → route_params binding
    └── sanitize.ts             prompt arg validators

Status

Honest read of what's hardened vs what's still moving:

SurfaceStatusNotes
stdio MCP transportStableUsed in production by Claude Code / Claude Desktop / Cursor / OpenAI Agents SDK
Read tools (discovery, pricing, liquidity, history, treasury reads)StableCached, rate-limit-tolerant, no side effects
Policy gates (whitelist, caps, dry-run, daily volume)StableServer-derived notional; quote-registry binding
Quote tools (get_quote, prepare_swap, quote_recipient_amount)StableEIP-712 Intent surface stable
External signer execution (execute_swap with caller signature)StableServer holds no key
Local signer execution (execute_swap server-signs, convert_and_send)Operator-managedRequires SERA_SIGNER_MODE=local + intentionally funded wallet on a trusted host
API-key treasury tools (get_balances, treasury_value, pay_invoice, settlement_status)Operator-managedRequire SERA_API_KEY / SERA_API_SECRET
Tool annotations (readOnly / destructive / idempotent / openWorldHint)Stable (v0.5.0)Every tool carries annotations the host runtime can use for confirmation UX.
Tool grouping + execution opt-in (SERA_ENABLE_EXECUTION_TOOLS)Stable (v0.5.0)Default true; set false to hide execute_swap + convert_and_send entirely.
convert_and_send only registered when SERA_SIGNER_MODE=localStable (v0.5.0)Tool no longer surfaces when it can't work.
Streamable HTTP transportStable (v0.8.0)Additive to stdio; --transport http opts in. Localhost-default with DNS-rebinding protection. No OAuth (bind to localhost or front with auth proxy).
Per-tool outputSchema + structuredContentPartial (v0.7.0)Live on doctor, list_currencies, get_fx_rate, market_health. Remaining tools incremental.
Read/exec endpoint split (/mcp/read, /mcp/exec)PlannedWhen OAuth lands.
OAuth 2.1 + RFC 8707 Resource Indicators for remote HTTPPlannedRequired before any public/multi-tenant deployment.

Roadmap

  • Streamable HTTP transport — additive to stdio; for ChatGPT connectors and hosted/remote agents. SSE is not on the roadmap (deprecated upstream).
  • Tool grouping + SERA_ENABLE_EXECUTION_TOOLS flag — hides execution tools by default; opt-in for trusted hosts.
  • Subscriptions — push deal alerts instead of polling. MCP spec supports it; needs server-side subscriber state.
  • Multi-hop SOR explorer — for pairs with no direct corridor, plan via intermediate fiats.
  • Address risk screening — sanctions / OFAC hooks (needs an external provider).
  • Approval/allowance manager — sera.approval_status for ERC-20 approvals to the Sera vault.
  • Per-tool rate limits — defend against polling-loop DoS on the upstream quote engine.

CLI

This package ships a sera CLI alongside the MCP server. Same code, same Sera plumbing — just a different entry point for shell scripts and ops use.

bash
# After build, either run directly:
node dist/cli.js doctor

# Or install globally for the `sera` command:
npm install -g .          # from this directory
# Or:
npm link                  # development convenience

sera doctor
sera fx USD SGD
sera quote USDC XSGD 100 --simulate
sera deals --min-bps 25 --json | jq
sera ladder USDT JPYC 30000
sera spread-radar USD,SGD,MYR,EUR,GBP,JPY

Run sera --help for the full command reference.

Built for:

  • Cron jobs / CI — automated FX dumps, daily deal summaries, alerting
  • Ops debugging — Sera engineering checking quote behavior without an agent
  • Power users — terminal-first people who don't want an LLM in the loop

The CLI uses the same handlers as the MCP server so anything an agent can do via sera.* tools, the CLI exposes as a command. See src/cli.ts.

Add --json to any command to get raw JSON for piping into jq / scripts.

License

MIT

Installation

TypingMind
{
  "mcpServers": {
    "sera-mcp": {
      "command": "npx",
      "args": [
        "sera-mcp"
      ],
      "env": {
        "SERA_NETWORK": "<SERA_NETWORK>",
        "POLICY_PRESET": "<POLICY_PRESET>"
      }
    }
  }
}

Use sera-mcp MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once sera-mcp is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add sera-mcp as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the sera-mcp MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "sera-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "sera-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the sera-mcp MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the sera-mcp MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use sera-mcp to help me with this task?
sera-mcp
Sure. I read it.
Here is what I found using sera-mcp.

Frequently asked questions

What is the sera-mcp MCP server used for?

sera-mcp is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use sera-mcp MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use sera-mcp with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use sera-mcp MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With sera-mcp connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect sera-mcp MCP to TypingMind?

sera-mcp runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does sera-mcp MCP provide in TypingMind?

sera-mcp exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use sera-mcp MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If sera-mcp requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇