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.

AI Trading MCP is a Model Context Protocol (MCP) trading rig that gives Claude — or any MCP-compatible AI client — the ability to trade a live crypto portfolio through exactly three tools: get_status, open_position, and close_position. The LLM is the signal source; the engine owns all risk math, TP/SL computation, and order execution. A GramJS scraper pipes a live Telegram channel — text posts and chart screenshots — directly into the get_status feed, making the AI aware of real-world signals without exposing any exchange credentials or control surfaces to the model.

Quick Start

Build the workspace, authorize Telegram, and launch your first paper trade in minutes.

MCP Tools Reference

Explore get_status, open_position, and close_position — the complete AI vocabulary.

Architecture Overview

Understand the two-process model, HTTP bridge, and how the engine guards the agent.

Live Trading Guide

Configure Binance API keys and switch from simulated fills to real spot orders.

Telegram Feed

How GramJS scrapes posts and chart images into MCP message blocks.

Configuration Reference

All environment variables, defaults, and tuning knobs in one place.

How It Works

The rig separates concerns cleanly between two processes:
1

Authorize Telegram

Run npm start -- --session to scan a QR code and save a GramJS session string. The scraper uses a regular user account — any channel you can read, it can read.
2

Start the trading process

Launch with --paper or --live plus --entry pointing to your strategy file. The engine starts one Live.background() loop per symbol in the whitelist and opens an HTTP bridge on port 60051.
3

Attach Claude

Run npm run start:claude to open Claude Code with mcp.servers.json wired in. The stdio MCP server (npx @backtest-kit/mcp) forwards every tool call over HTTP to the trading process.
4

Trade or automate

Talk to your portfolio directly, or use /loop to run a prompt on a timer — turning the rig into an unattended news-trader that checks the Telegram feed and acts only on genuine signals.

Key Design Principles

Engine Owns Risk

Take-profit, stop-loss, and entry cost are computed engine-side and cannot be overridden by the model or by anything in the feed.

Feed Is Untrusted

Instructions embedded in Telegram posts are data, not commands. The architecture — not the prompt — enforces this boundary.

Full Audit Trail

Every byte the model saw is dumped to disk as markdown before leaving the process. Every position carries a note with its basis.

Crash-Safe Persistence

Open positions, OCO brackets, and command history survive process restarts. Resume exactly where you left off.

Build docs developers (and LLMs) love