Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/theonetrade/ai-trading-mcp/llms.txt

Use this file to discover all available pages before exploring further.

Every runtime option is set via environment variables — there is no config file to edit beyond .env. The trading process reads these values at startup; restart the process after any change. Variables without a Required marker are optional and fall back to the listed default.

Telegram

These credentials authorize the GramJS user session that scrapes the channel into get_status. They are not bot credentials — the scraper acts as a regular Telegram user account that has already scanned the QR code and written its session string to session.txt.
CC_TELEGRAM_API_ID
number
default:"31861455"
Telegram API ID from my.telegram.org. The value shown is a dev fallback included in the source code — it will work in development but you must replace it with your own ID before any production or shared deployment.
CC_TELEGRAM_API_HASH
string
default:"ca60446c67ce250ee4e789c730163449"
Telegram API hash paired with CC_TELEGRAM_API_ID. The default is the same dev fallback — replace it with the hash from your own my.telegram.org application entry.
CC_TELEGRAM_CHANNEL
string
default:"-1002833393903"
Numeric channel ID to scrape. The GramJS client fetches the last 15 posts from this channel and appends them — text and chart screenshots — to every get_status response. Change this to the ID of any channel the authorized user account can read.

Trading

CC_SYMBOL_LIST
string
Comma-separated list of Binance spot symbols that the engine will trade. One Live.background() candle loop is started per symbol at process startup. Any open_position call for a symbol that is not in this list is rejected by the engine — the agent cannot bypass it. Requires a process restart to take effect.

Binance (live mode only)

These credentials are only required when running with the --live flag. Paper mode uses a public Binance connection for market data and simulates all fills inside the engine — no API keys are needed.
BINANCE_API_KEY
string
required
Binance API key. Required for live mode only. The key must have Spot & Margin Trading permission enabled. IP allowlisting is strongly recommended.
BINANCE_API_SECRET
string
required
Binance API secret paired with BINANCE_API_KEY. Required for live mode only. Never commit this value to version control.

MCP Bridge

The stdio MCP server (npx @backtest-kit/mcp) is a separate process that forwards every tool call over HTTP to the trading process. These variables configure the address of that bridge, and must match on both sides.
CC_MCP_HOST
string
default:"127.0.0.1"
Hostname or IP address the HTTP bridge listens on inside the trading process, and the address the stdio MCP server dials to forward tool calls. Change this only if you are running the two processes on different hosts or inside a custom network namespace.
CC_MCP_PORT
number
default:"60051"
TCP port for the HTTP bridge. The dashboard UI runs on port 60050; the bridge runs on 60051 by default. Change this if there is a port conflict on your host.

Infrastructure (optional)

These variables enable optional Redis and MongoDB persistence backends provided by the @backtest-kit/mongo package. When they are not set the engine uses the default local-filesystem backends under dump/data/.
CC_REDIS_HOST
string
default:"127.0.0.1"
Redis host for the Redis-backed persistence backend. Only used when @backtest-kit/mongo is wired in. Leave unset to use the default filesystem backend.
CC_MONGO_CONNECTION_STRING
string
MongoDB connection string for the Mongo-backed persistence backend. Only used when @backtest-kit/mongo is wired in. Leave unset to use the default filesystem backend.

.env.example

The repository ships a minimal .env.example that covers the optional infrastructure variables. Copy it to .env and fill in values as needed:
CC_REDIS_HOST=127.0.0.1
CC_MONGO_CONNECTION_STRING=mongodb://localhost:27017/backtest-kit?wtimeoutMS=15000
The Binance and Telegram variables are not included in .env.example — set them directly in your shell or CI secrets manager before running the process:
export CC_TELEGRAM_API_ID=12345678
export CC_TELEGRAM_API_HASH=your_api_hash_here
export CC_TELEGRAM_CHANNEL=-1002833393903

# Live mode only:
export BINANCE_API_KEY=your_binance_api_key
export BINANCE_API_SECRET=your_binance_api_secret
Never ship the dev fallback CC_TELEGRAM_API_ID and CC_TELEGRAM_API_HASH values. The defaults (31861455 / ca60446c67ce250ee4e789c730163449) are hard-coded in the source as development conveniences — they are publicly visible in the repository. Register your own Telegram application at my.telegram.org, generate a unique API ID and hash, and set them in your environment before deploying anywhere beyond your local machine.
session.txt is not part of .env. It is written by the --session command (npm start -- --session) after you scan the QR code and complete Telegram authorization. The trading process reads it from the strategy’s working folder at runtime (content/manual.strategy/session.txt). Treat this file with the same care as a password — it grants full access to the Telegram account that authorized it.

Build docs developers (and LLMs) love