Configuration
Configure authentication, private keys, and environment variables
Configuration is resolved in priority order: CLI args > environment variables > defaults.
Options
| CLI Arg | Environment Variable | Default | Description |
|---|---|---|---|
--apiToken | TORQUE_API_TOKEN | — | Auth token (takes priority over wallet auth) |
--privateKey | WALLET_PRIVATE_KEY | — | Solana private key for wallet-based JWT auth |
--apiUrl | TORQUE_API_URL | https://server.torque.so | Torque API base URL |
--platformUrl | TORQUE_PLATFORM_URL | https://platform.torque.so | Torque platform URL |
--ingesterUrl | TORQUE_INGESTER_URL | https://ingest.torque.so | Event 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.
Auth Token (Recommended)
The simplest method. Get a token from platform.torque.so/connect-mcp and provide it in your MCP config.
TORQUE_API_TOKEN=your-tokenWhen 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-keyWhen 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.
| Action | Args | What it does |
|---|---|---|
login | authToken (optional) | Sign in using an explicit authToken or, if omitted, the configured wallet WALLET_PRIVATE_KEY. Call auth({ action: "logout" }) first when switching accounts. |
status | — | Report 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. |
logout | — | Clear 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.
| Cleared | Preserved |
|---|---|
| Active project | Auth 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_projectif you already know which one — chat state auto-clears on project change) - The
ask_torqueconversation 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_TOKENtakes 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
| Flag | Description |
|---|---|
--help, -h | Show usage information and exit |
--version, -v | Show the package version and exit |
npx @torque-labs/mcp@latest --help
npx @torque-labs/mcp@latest --version