Skip to main content

Documentation 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.

AI Trading MCP is configured entirely through environment variables. There are no required config files beyond .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.
CC_TELEGRAM_API_ID and CC_TELEGRAM_API_HASH both have insecure fallback values hard-coded in the source (31861455 / ca60446c67ce250ee4e789c730163449). These are shared dev credentials — any session authorized with them is reachable by anyone who has the same pair. Always set your own before deploying. Running production traffic through the fallbacks risks account compromise and Telegram API throttling across all users of those credentials.

Telegram Credentials

CC_TELEGRAM_API_ID
number
required
Telegram API ID from my.telegram.orgAPI Development ToolsApp 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.
CC_TELEGRAM_API_HASH
string
required
Telegram API hash from my.telegram.orgAPI Development ToolsApp 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.
CC_TELEGRAM_CHANNEL
string
default:"-1002833393903"
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

CC_SYMBOL_LIST
string
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
string
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
string
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

CC_MCP_HOST
string
default:"127.0.0.1"
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.
CC_MCP_PORT
number
default:"60051"
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.
CC_REDIS_HOST
string
default:"127.0.0.1"
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.
CC_MONGO_CONNECTION_STRING
string
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:
CC_REDIS_HOST=127.0.0.1
CC_MONGO_CONNECTION_STRING=mongodb://localhost:27017/backtest-kit?wtimeoutMS=15000
A complete .env for a paper-trading setup with custom Telegram credentials and a narrowed symbol list looks like this:
# Telegram — get these from https://my.telegram.org
CC_TELEGRAM_API_ID=12345678
CC_TELEGRAM_API_HASH=your_api_hash_here

# Channel to scrape (override the demo channel for production)
CC_TELEGRAM_CHANNEL=-1001234567890

# Narrow the whitelist to reduce API load
CC_SYMBOL_LIST=BTCUSDT,ETHUSDT,SOLUSDT

# MCP bridge (defaults are fine for local use)
CC_MCP_HOST=127.0.0.1
CC_MCP_PORT=60051

# Persistence infrastructure (only if using @backtest-kit/mongo)
CC_REDIS_HOST=127.0.0.1
CC_MONGO_CONNECTION_STRING=mongodb://localhost:27017/backtest-kit?wtimeoutMS=15000
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.

Build docs developers (and LLMs) love