Skip to content
Beta
Docs+

Auth & security

Two auth modes, read-only mode, revocation and write protection.

Updated 2026-10-21

usmart-mcp supports OAuth2 authorization code with PKCE (recommended), or the legacy channel-password sign-in kept for 1.0.x compatibility. Your password is only entered on uSMART's page and never enters the model context.

The two modes

OAuth2 + PKCEChannel password
Credentialsclient_id plus a local session filePhone, password, channel id and signing key
Refreshrefresh_token rotates automaticallyIn-process cache; re-login on expiry
Use whenRecommended; public app is enoughLegacy 1.0.x and channel setups
Signing key neededNoYes

The flow

  1. Call oauth_login — it returns the URL and opens the browser
  2. Sign in on uSMART and approve
  3. Call oauth_login_status to collect the code and exchange the token
  4. The session is written to ~/.usmart/oauth_session.json and refreshed automatically

Read-only mode

With USMART_READONLY=1, place_order and modify_order are not registered at the protocol layer at all — not blocked by a client allowlist, simply absent.

Four protections on writes

  • Explicit confirmation: every write must pass confirmed=true
  • Board-lot validation: quantities are checked before the order leaves the machine
  • Local limits: per-order amount, daily amount and daily order count, enforced before any network call
  • Audit and no-retry: writes land in a local JSONL trail; timeouts or auth failures go to a human, never a second attempt

Revoking access

Call oauth_logout, or delete ~/.usmart/oauth_session.json — that is a local sign-out. The remote refresh_token lives for 30 days and cannot be revoked locally.

Any AI can misread your intent. Verify symbol, side, quantity and price before ordering; accepted is not filled.

Stuck?

Send us a screenshot and your client version and we will take a look.

Contact support