MCP Server
The Stablecoin Harness MCP server lets an LLM agent drive a merchant account end-to-end. It talks to the same HTTP API the dashboard uses, with the same auth surface (email-OTP → SIWE → JWT). Any MCP-compatible client (Claude Code, Claude Desktop, Cursor, your own agent) can connect over stdio and run merchant operations on your behalf.
Why MCP
Section titled “Why MCP”- One-time human step. The merchant authenticates once with email + OTP through the agent; after that the agent operates without re-entering OTP for the lifetime of each credential.
- Local-first. The server runs on your machine over stdio. Credentials are stored encrypted at rest and never relayed through StablecoinX infrastructure.
- Same surface as the dashboard. Anything a merchant can do in the dashboard, the MCP can do — there is no separate API.
Install
Section titled “Install”npx @stablecoinx/mcp setupSource: github.com/e2xlabs/stablecoinx-mcp · npm: @stablecoinx/mcp.
Configuration
Section titled “Configuration”With npx @stablecoinx/mcp setup there is nothing to configure — the API endpoint, login chain, and a freshly generated state passphrase are registered for you.
For a manual install, the only input is the state passphrase:
| Env var | Required | Purpose |
|---|---|---|
SCX_STATE_PASSPHRASE | yes (manual) | Derives the aes-256-gcm key for the encrypted local state file. setup generates one for you; set it yourself when installing manually, and reuse the same value across runs to keep the state. |
SCX_STATE_DIR | no | Override the default state-dir location. |
There is no API key, endpoint, or other connection setting to configure — the API key is issued during onboarding and stored encrypted locally; everything else is baked into the package.
Credential model
Section titled “Credential model”| Credential | How obtained | Lifetime |
|---|---|---|
| JWT | email-OTP → SIWE → POST /v1/auth/verify | 24 h, then re-OTP |
API key sk_* | api_key_create during onboarding | until revoked |
| Session key | session_key_create (local EOA added to the smart account) | configurable (default 30 days) |
After 24 h the JWT expires and dashboard-style tools return RE_AUTH_REQUIRED — the agent prompts for OTP again. The API key and session key survive; only the JWT refreshes. Removing a session key (removeSessionKey on the smart account) requires an admin re-OTP — that’s the panic button.
Tools are flat, named by resource. The current set:
| Group | Tools |
|---|---|
| Auth | auth_send_otp, auth_verify_otp, auth_status, auth_logout |
| API keys | api_key_create, api_keys_list, api_keys_revoke |
| Session keys | session_key_create |
| Merchant | merchant_get, merchant_update |
| Sessions | sessions_create_dashboard, sessions_get, sessions_list |
| Paymaster | paymaster_clients_list/create/update/revoke, paymaster_allowlist_list/add/remove, paymaster_usage_get |
| Webhooks | webhooks_create, webhooks_list, webhooks_delete, webhooks_deliveries, webhooks_rotate_secret |
On-chain treasury operations (yield deposits, Ethena cooldown, etc.) are a planned later phase and are not in the current tool set.
Privacy posture
Section titled “Privacy posture”- The server runs on your machine; tool calls don’t round-trip through a third party.
- Credentials live in an
aes-256-gcm-encrypted state file unlocked bySCX_STATE_PASSPHRASE. - The MCP is a first-class client of the same auth surface as the browser — there is no separate agent audience or scope on the API side. Constraining the agent is a client-side concern (per-tool confirmation prompts).
Related
Section titled “Related”- MCP API reference — per-tool inputs and outputs.
- For agents → llms.txt — how to consume these docs as an LLM.