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 the authenticate tool without arguments — the server signs the login message and authenticates 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 Tools

ToolDescription
authenticateAuthenticate with a token or wallet. Call with authToken for token auth, or call without arguments to use wallet auth.
check_auth_statusCheck if you are authenticated and verify the token is still valid. Call this at the start of a session.
logoutClear the stored authentication token from the session and local cache.

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 expire after 24 hours and need to be refreshed.
  • Running 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 --help
npx @torque-labs/mcp --version