This guide walks you from a fresh clone to a live paper-trading session with Claude analyzing your portfolio and Telegram feed — all in under 10 minutes. Paper mode uses real Binance market data but simulates fills inside the engine, so no API keys are required.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.
Prerequisites
Before you begin, make sure you have the following:
- Node.js 18+ — the workspace build system and CLI runtime both require it.
- A Telegram account — the scraper uses a GramJS user session (not a bot token), so it can read any channel your account can see.
- Telegram API credentials — visit my.telegram.org, sign in, and create an application to obtain your
CC_TELEGRAM_API_IDandCC_TELEGRAM_API_HASH. Copy these into your.envfile (see.env.examplein the repo root). - Claude Code — used to attach the agent via
npm run start:claude. Install it from claude.ai/code if you don’t have it yet.
Install Dependencies and Build
Clone the repository, install npm dependencies, then build the two workspace packages —
@pro/agent (Telegram scraper + MCP schema) and @pro/main (CLI entrypoints). config/alias.config.ts maps both @pro/* aliases to their compiled output so the CLI runtime can load them at start-up.npm run build is an alias for npm run build:x, which runs dotenv -e .env -- sh ./scripts/linux/build.sh. npm run build:win runs dotenv -e .env -- .\\scripts\\win\\build.bat. Both produce packages/agent/build/index.cjs and packages/main/build/index.cjs.Authorize Telegram
The scraper uses a GramJS user session — not a bot token — so it inherits your account’s read permissions on any channel you follow.A QR code prints in your terminal. On your phone, open Telegram → Settings → Devices → Link Desktop Device and scan it. If your account has 2FA enabled, enter the password when prompted.Once authorized, the session string is written to
session.txt in the current working directory. At run time the trading process reads it from the strategy’s working folder — content/manual.strategy/session.txt in this repo.Start Paper Trading
Launch the trading process with the manual strategy in paper mode. The What this starts:
--ui flag also starts the web dashboard.Live.background()— spawned once per symbol in the 13-symbol whitelist (BTCUSDT,ETHUSDT,SOLUSDT, and 10 others), each polling real Binance price data via ccxt and running the engine loop.- Dashboard on
http://localhost:60050— portfolio state, open positions, and a dump viewer for everyget_statusthe model ever received. - MCP HTTP bridge on
127.0.0.1:60051— started by theserve()call inconfig/setup.config.ts; the stdio MCP server forwards all tool calls here.
Attach Claude
In a second terminal (keep the trading process running), start Claude Code with the repo’s MCP config:This runs:
mcp.servers.json registers npx -y @backtest-kit/mcp@latest as a stdio MCP server. Claude Code launches the package via npx (the -y flag auto-confirms any npx install prompt) and connects to it over stdio JSON-RPC. The package holds no trading state — it forwards every tool call over HTTP to the bridge on :60051.Your First Conversation
Once Claude Code opens, you can talk to your portfolio immediately. Here is a real abridged session to get you oriented:The agent calls
get_status to fetch the current portfolio snapshot and feed, then calls open_position("BTCUSDT", "short", "<note>") to queue the entry. The engine validates the request, computes TP/SL, and executes a simulated fill. You can verify the position in the dashboard at http://localhost:60050.Next Steps
With paper trading running, you can explore live mode by settingBINANCE_API_KEY and BINANCE_API_SECRET and replacing --paper with --live. Before going live, read the Architecture page to understand the two-process model, and the Spot Broker Adapter page to understand how the adapter handles the failure modes Binance actually produces in production.