TradingAgents mode
TradingAgents-MCPmode 是一个创新的多智能体交易分析系统,集成了 Model Context Protocol (MCP) 工具,实现了智能化的股票分析和交易决策流程。系统通过多个专业化智能体的协作,提供全面的市场分析、投资建议和风险管理。
claude mcp add --transport stdio guangxiangdebizi-tradingagents-mcpmode python -m TradingAgentsMCPmode.mcp_server \ --env MODEL_NAME="gpt-4" \ --env OPENAI_API_KEY="your_openai_api_key" \ --env OPENAI_BASE_URL="https://api.openai.com/v1" \ --env MAX_DEBATE_ROUNDS="1"
How to use
TradingAgents-MCPmode is an MCP-based multi-agent trading analysis system. It orchestrates a team of 15 specialized intelligent agents to analyze stocks and markets, debate investment and risk theses, and generate actionable trading guidance. The MCP framework enables you to run the server, control which agents participate, and tune the debate depth to balance speed and thoroughness. You can interact with the system via the Streamlit web frontend for real-time analysis or use the command-line interface for scripted queries. The design emphasizes parallel analyst workstreams, debater-driven reasoning, and risk-aware final decisions, all while allowing you to selectively enable or disable agents to suit your workflow.
To use the tools, start the MCP server and configure the agent teams and debate rounds through the frontend. The 6 core analyst roles run in parallel to produce diverse reports: CompanyOverview, Market, Sentiment, News, Fundamentals, Shareholder, and Product analyses. The Bull and Bear researchers perform a structured debate over the synthesized reports, followed by a Research Manager and Trader who translate the outputs into an investment plan and potential trading actions. A Risk Management team (Aggressive, Safe, Neutral analysts) then contributes risk perspectives and a final risk decision. The system supports live natural-language queries without specifying a market, and it can pull in real-time data from external sources via MCP integrations.
How to install
Prerequisites:\n- Python 3.8+ (recommended)\n- Git\n- Internet access to install dependencies and fetch models\n\n1) Clone the repository:\nbash\ngit clone https://github.com/guangxiangdebizi/TradingAgents-MCPmode.git\ncd TradingAgents-MCPmode\n\n\n2) Create and activate a virtual environment (optional but recommended):\nbash\npython -m venv venv\nsource venv/bin/activate # Linux/macOS\nvenv\Scripts\activate # Windows\n\n\n3) Install dependencies:\nbash\npip install -r requirements.txt\n\n\n4) Prepare configuration:\n- Copy the example environment and customize API keys and workflow parameters:\nbash\ncp env.example .env\n# Edit .env to configure your API keys and workflow parameters\n\n- Edit mcp_config.json to tune MCP server behavior (agent enablement, debate rounds, etc.).\nbash\n# Example editing step (use your preferred editor)\nnano mcp_config.json\n\n\n5) Run the MCP server:\nbash\npython -m TradingAgentsMCPmode.mcp_server # or your actual entrypoint if different\n\n\n6) Launch the web frontend (optional):\n```bash\nstreamlit run web_app.py\n``\nThen open http://localhost:8501 in your browser.
Additional notes
Tips and common issues:\n- Ensure your OPENAI_API_KEY is valid and has access to the model you specify (gpt-4 or equivalent).\n- If agent participation becomes stale or misbehaves, adjust MAX_DEBATE_ROUNDS and re-run to reset the debate flow.\n- Use the frontend to selectively enable/disable agents and to modify debate rounds on the fly; changes take effect during the next run.\n- For large markets or multiple tickers, verify that MCP data sources are configured to refresh in real time to keep recommendations current.\n- If you encounter environmental variable issues, ensure they are exported or defined in the .env file loaded by your application.\n- The system supports multi-market analysis (US, CN, HK); specify market preferences in the user query or via MCP configuration if needed.
Related MCP Servers
PPTAgent
An Agentic Framework for Reflective PowerPoint Generation
open-ptc-agent
An open source implementation of code execution with MCP (Programatic Tool Calling)
mcp_massive
An MCP server for Massive.com Financial Market Data
metatrader
Model Context Protocol (MCP) to enable AI LLMs to trade using MetaTrader platform
ultimate_mcp_server
Comprehensive MCP server exposing dozens of capabilities to AI agents: multi-provider LLM delegation, browser automation, document processing, vector ops, and cognitive memory systems
semantic-scholar-fastmcp
A FastMCP server implementation for the Semantic Scholar API, providing comprehensive access to academic paper data, author information, and citation networks.