TradingAgents-MCP is a sophisticated multi-agent trading analysis system built on the Model Context Protocol (MCP). By utilizing MCP tools to ingest live market data, the framework coordinates fifteen specialized agents that collaborate to analyze stocks, debate investment hypotheses, and generate data-driven trading decisions.
The system executes its analytical tasks in parallel, covering seven critical dimensions simultaneously: company overview, market dynamics, investor sentiment, recent news, fundamental data, shareholder structure, and product lines. This concurrent design significantly reduces the time required to process complex market information.
A built-in debate mechanism is used to refine the final output. Bull and bear researchers argue the merits of an investment case, while three risk analysts—representing aggressive, conservative, and neutral perspectives—debate potential downsides. Users can customize the number of debate rounds, allowing the system to deliver nuanced, layered recommendations.
The Streamlit-based frontend provides granular control over the workflow. Users can toggle specific agents on or off and adjust debate depth in real time. Because the system handles natural language queries, there is no need to manually specify markets or dates; it automatically pulls current data for US equities, Chinese A-shares, and Hong Kong listings.
Key Features:
┌─────────────────────────────────────────────────────────┐
│ TradingAgents-MCPmode │
├─────────────────────────────────────────────────────────┤
│ 📊 Analysts (Parallel Execution) │
│ ├── CompanyOverviewAnalyst │
│ ├── MarketAnalyst │
│ ├── SentimentAnalyst │
│ ├── NewsAnalyst │
│ ├── FundamentalsAnalyst │
│ ├── ShareholderAnalyst │
│ └── ProductAnalyst │
├─────────────────────────────────────────────────────────┤
│ 🔬 Researchers │
│ ├── BullResearcher │
│ └── BearResearcher │
├─────────────────────────────────────────────────────────┤
│ 👔 Managers │
│ ├── ResearchManager │
│ └── Trader │
├─────────────────────────────────────────────────────────┤
│ ⚠️ Risk Management │
│ ├── AggressiveRiskAnalyst │
│ ├── SafeRiskAnalyst │
│ ├── NeutralRiskAnalyst │
│ └── RiskManager │
└─────────────────────────────────────────────────────────┘
1. User Input
The user enters a natural language query, such as "Analyze Apple stock."
2. Company Overview
The CompanyOverviewAnalyst retrieves foundational details, including the company name, ticker, exchange, and sector, to produce an initial summary report.
3. Parallel Analyst Phase
Six analysts activate simultaneously. Each evaluates the user query and the initial summary to produce a specialized report. This parallel execution ensures you receive six distinct perspectives in the time it would take to generate one.
4. Researcher Debate and Management Decision
The BullResearcher constructs a positive investment case by reviewing all seven previous reports. It generates a series of arguments and a debate history. The BearResearcher then responds, analyzing the same data and the bull's arguments to provide counterpoints. This debate loop can be repeated for increased depth.
Following the debate, the ResearchManager synthesizes the findings into an investment plan, which the Trader then refines into a specific trading blueprint.
5. Risk Management Phase
The AggressiveRiskAnalyst initiates the review of all prior outputs, establishing a risk perspective and a debate log. The SafeRiskAnalyst follows by adding a conservative interpretation, and the NeutralRiskAnalyst completes the cycle. Finally, the RiskManager evaluates the entire debate log to issue the final trading decision.
Requirements: Python 3.8 or higher. Compatible with Windows, macOS, and Linux.
git clone https://github.com/guangxiangdebizi/TradingAgents-MCPmode.git
cd TradingAgents-MCPmode
pip install -r requirements.txt
cp env.example .env
Edit the .env file to include your API keys and set your preferred workflow parameters.
Edit mcp_config.json to point to your MCP server. This step is essential for connecting the system to live market data.
streamlit run web_app.py
Access the UI at http://localhost:8501. The interface is organized into several sections:
.env and MCP settings directly from the browser.Single-shot analysis:
python main.py -c "Analyze Apple stock"
Interactive mode:
python main.py
Follow the prompts to enter queries like "Analyze Tesla" or "Analyze 600036 China Merchants Bank."
CompanyOverviewAnalyst identifies Tesla Inc. (TSLA) on the NASDAQ within the EV sector.BullResearcher reviews the reports to build a bullish thesis for the stock.RiskManager evaluates the cumulative findings and debates to issue a final risk-adjusted decision..env File| Section | Key Variables |
|---|---|
| LLM Config | OPENAI_API_KEY, OPENAI_BASE_URL, MODEL_NAME |
| Workflow | MAX_DEBATE_ROUNDS, MAX_RISK_DEBATE_ROUNDS, DEBUG_MODE, VERBOSE_LOGGING |
| Agent MCP Permissions | Toggle MCP access per agent. Analysts typically require live data, while researchers and managers may not. |
| Concurrency | MAX_CONCURRENT_ANALYSIS sets the limit for parallel analyst tasks. |
For initial testing, start with a single debate round and increase the count for more exhaustive analysis.
mcp_config.json FileTwo formats are supported.
Standard Format (HTTP Streaming):
{
"servers": {
"finance-mcp": {
"transport": "streamable_http",
"url": "http://106.14.205.176:8080/mcp",
"headers": {
"X-Tushare-Token": "Your-Tushare-APIKEY-Here"
}
}
}
}
Legacy Format (SSE):
{
"servers": {
"finance-mcp": {
"transport": "sse",
"url": "http://106.14.205.176:3101/sse"
}
}
}
Ensure the Tushare token placeholder is replaced with a valid key. The MCP client must be restarted or hot-reloaded after making changes.
TradingAgents-MCP effectively places a professional trading desk within your terminal, combining parallel analysis, structured debate, and real-time data under an accessible web UI. It is open-source and ready for immediate deployment.
AI Trading Simulator: Paper Trade Crypto With Smart LLM Decisions
Dianman VPN: Free Trial, Unlimited Data & Zero Throttling
Octo: A Zero-Telemetry Coding Assistant with Smart Auto-Repair
VibeVoice: Long-Form Multi-Speaker TTS for Natural Dialogue Generation
Coze Studio: Build and Deploy AI Agents with Golang and React
ntopng Network Traffic Monitor: Identify Bandwidth Consumption and Network Bottlenecks
CodeIndexer: Semantic Code Search for IDEs (AI-Powered)
n8n-MCP: Give Claude Access to 525+ n8n Nodes in Minutes
Crawl4AI: Fast LLM-Ready Web Scraping Without the Bloat
InvenTree Inventory: Self-Hosted Stock Control with REST API
Slidev: Markdown-Based Presentations for Developers
News Agents: Scalable RSS Summarization with Amazon Q and tmux