TORQUEDocs

Configuration

Configure authentication, private keys, and environment variables

Configuration is resolved in priority order: CLI args > environment variables > defaults.

Options

CLI ArgEnvironment VariableDefaultDescription
--apiTokenTORQUE_API_TOKENAuth token (takes priority over wallet auth)
--privateKeyWALLET_PRIVATE_KEYSolana private key for wallet-based JWT auth
--apiUrlTORQUE_API_URLhttps://server.torque.soTorque API base URL
--platformUrlTORQUE_PLATFORM_URLhttps://platform.torque.soTorque platform URL
--ingesterUrlTORQUE_INGESTER_URLhttps://ingest.torque.soEvent ingestion endpoint

Most users only need --apiToken or --privateKey. The URL options are for advanced use cases like self-hosted or staging environments.

Authentication

The server supports two authentication methods. You can also skip config and authenticate at runtime.

The simplest method. Get a token from platform.torque.so/connect-mcp and provide it in your MCP config.

TORQUE_API_TOKEN=your-token

When an auth token is configured, it is used automatically — no additional steps needed.

Wallet-Based Auth

If you have a Solana keypair, the server signs a login message and obtains a JWT from the Torque API automatically.

WALLET_PRIVATE_KEY=your-base58-private-key

When a private key is configured, call auth({ action: "login" }) with no authToken — the server signs the login message and obtains a JWT automatically.

If you provide both an auth token and a private key, the auth token takes priority. If these belong to different accounts, actions created via the CLI won't appear in your web dashboard under the wallet account.

Auth Tool

All authentication actions are exposed through a single auth tool. Choose the operation via the action argument.

ActionArgsWhat it does
loginauthToken (optional)Sign in using an explicit authToken or, if omitted, the configured wallet WALLET_PRIVATE_KEY. Call auth({ action: "logout" }) first when switching accounts.
statusReport authentication state and validate the stored token. Also surfaces the active project and any open ask_torque conversation. Returns non-isError content on every branch — read the text.
logoutClear the stored auth token from both the in-memory session and the local cache. Does not clear the active project or chat conversation — use reset_context for those.

Calling convention:

auth({ action: "status" })
auth({ action: "login", authToken: "..." })
auth({ action: "logout" })

Session Reset

The reset_context tool clears session state without signing the user out.

ClearedPreserved
Active projectAuth token
AI context cache
Chat conversation (from ask_torque)

Use cases:

  • The user wants a clean slate without re-authenticating
  • Switching focus to a different project (prefer set_active_project if you already know which one — chat state auto-clears on project change)
  • The ask_torque conversation has drifted off-topic

reset_context takes no arguments. It is idempotent — safe to call repeatedly.

Token Persistence

Authentication tokens are persisted within the package's local cache directory:

  • Tokens survive server restarts within the same installation.
  • If the MCP client restarts, the server reloads the persisted token automatically.
  • Tokens generated via platform.torque.so/connect-mcp are valid for 60 days. Wallet-signed JWTs (obtained automatically when a private key is configured) are valid for 30 days.
  • A config-supplied --apiToken / TORQUE_API_TOKEN takes priority and overwrites any stale disk-persisted token on startup — so rotating the token in config is enough; no manual cache clear required.
  • Calling auth({ action: "logout" }) clears the persisted token.

CLI Flags

FlagDescription
--help, -hShow usage information and exit
--version, -vShow the package version and exit
npx @torque-labs/mcp@latest --help
npx @torque-labs/mcp@latest --version
Configuration - Torque Docs