Skip to content

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.

  • 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.
Terminal window
npx @stablecoinx/mcp setup

Source: github.com/e2xlabs/stablecoinx-mcp · npm: @stablecoinx/mcp.

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 varRequiredPurpose
SCX_STATE_PASSPHRASEyes (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_DIRnoOverride 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.

CredentialHow obtainedLifetime
JWTemail-OTP → SIWE → POST /v1/auth/verify24 h, then re-OTP
API key sk_*api_key_create during onboardinguntil revoked
Session keysession_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:

GroupTools
Authauth_send_otp, auth_verify_otp, auth_status, auth_logout
API keysapi_key_create, api_keys_list, api_keys_revoke
Session keyssession_key_create
Merchantmerchant_get, merchant_update
Sessionssessions_create_dashboard, sessions_get, sessions_list
Paymasterpaymaster_clients_list/create/update/revoke, paymaster_allowlist_list/add/remove, paymaster_usage_get
Webhookswebhooks_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.

  • 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 by SCX_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).