AI Trading MCP is configured entirely through environment variables. There are no required config files beyondDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/backtest-kit/ai-trading-mcp/llms.txt
Use this file to discover all available pages before exploring further.
.env — drop your values in and the process picks them up at startup. The table below covers every variable the system reads, its default, and what breaks if you leave it unset.
Telegram Credentials
Telegram API ID from my.telegram.org → API Development Tools → App api_id. Used by GramJS to initiate and restore user sessions.The source contains a dev fallback (
31861455). Set your own value before deploying — see the warning above.Telegram API hash from my.telegram.org → API Development Tools → App api_hash. Paired with
CC_TELEGRAM_API_ID to authenticate the GramJS client.The source contains a dev fallback (ca60446c67ce250ee4e789c730163449). Set your own value before deploying — see the warning above.Numeric ID of the Telegram channel to scrape into the
get_status feed. The default (-1002833393903) points to the bundled demo channel — a real signals channel included specifically because it displays classic scam markers (100× cross, referral codes, withdrawal screenshots as social proof). Override this with your own channel ID for production use.Trading Symbols
Comma-separated list of Binance spot symbols the engine is allowed to trade. At startup, one
Live.background() loop is spawned for every symbol in this list. Symbols outside the list are rejected engine-side — the agent cannot trade them regardless of what the feed says. The default is 13 pairs.See Symbol List for full details on parsing, enforcement, and performance implications.Binance API Keys
Binance API key. Required for live mode only. Paper mode uses ccxt for real market data but simulates all fills in the engine — no keys needed.Generate keys in your Binance account under API Management. Enable spot trading permissions; futures and margin permissions are not required and should be left off.
Binance API secret. Required for live mode only, paired with
BINANCE_API_KEY. Store it in a secrets manager or an .env file that is excluded from version control — never commit it.MCP HTTP Bridge
Hostname or IP address the HTTP bridge binds to. The trading process serves
get_status, open_position, and close_position over this interface; the stdio MCP server (npx @backtest-kit/mcp) forwards calls here.This variable is consumed by the serve() call inside @backtest-kit/mcp — it is not defined in the repo’s own config/setup.config.ts or any params.ts source file. The default (127.0.0.1) keeps the bridge off the network. Change this only if you are running the trading process and the MCP server on separate hosts, and ensure the port is firewalled accordingly.TCP port for the HTTP bridge. Must match the port configured in
mcp.servers.json for the stdio MCP server to reach the trading process.Like CC_MCP_HOST, this variable is consumed by @backtest-kit/mcp’s serve() — it does not appear in the repo’s own config source files.Persistence Backends
These variables are only needed when using the Redis- or MongoDB-backed persistence adapters from@backtest-kit/mongo. The defaults match the values in .env.example. In-memory and local-file persistence (the defaults in config/setup.config.ts) require neither.
Hostname for the Redis instance used by the
@backtest-kit/mongo persistence backend. Only required if you have wired persistence to use Redis rather than local files.MongoDB connection string for the
@backtest-kit/mongo persistence backend. Only required if you have wired persistence to use MongoDB rather than local files..env.example
The repository ships a minimal.env.example covering only the optional infrastructure variables. All other variables are read directly from the process environment:
.env for a paper-trading setup with custom Telegram credentials and a narrowed symbol list looks like this:
BINANCE_API_KEY and BINANCE_API_SECRET are not in .env.example because they are only required for live trading. Add them to your .env only when you intend to run the --live flag — they are not read in paper mode.