XTQuantAI acts as a bridge between professional quantitative trading and the world of artificial intelligence. It allows AI assistants to directly interact with the XTQuant platform, transforming a standard chat interface into a powerful financial analysis hub. By using this tool, anyone can ask an AI to fetch stock prices, verify market trading days, or summarize stock details without ever leaving their coding or chat environment. Moving beyond simple lookups, this MCP server provides deep access to both historical and real-time market data. It handles complex queries for full market snapshots and specific stock sectors, but its standout feature is the ability to generate visual data. The tool enables the AI to create interactive chart panels and custom layouts, allowing users to apply technical indicators like Moving Averages through simple natural language commands. For developers, XTQuantAI leverages the Model Context Protocol to turn the XTQuant (QMT) ecosystem—traditionally a Windows-bound desktop environment—into a programmable resource for Large Language Models. By configuring a simple connection in editors like Cursor, developers give their AI the "hands" to manipulate trading data and the "eyes" to see technical trends. This integration streamlines the workflow for building automated trading bots or AI-driven investment researchers, as the LLM can now autonomously fetch, process, and visualize financial data via standardized Python-based tools.
Category: Data & Analytics
Tags: charts, market data, quantitative-analysis, stocks, trading
bash pip install uv 2. Clone the Repository: bash git clone https://github.com/dfkai/xtquantai.git Note: You can also download the ZIP archive and extract it to a local folder. Ensure you know the absolute path to this folder. ---.cursor in your project root, and within it, create a mcp.json file: json { "mcpServers": { "xtquantai": { "command": "cmd /c uvx", "args": [ "C:\\path\\to\\xtquantai" ] } } } Note: Use double backslashes (\\) in the JSON file to escape the path.xtquantai 3. Command: cmd /c uvx path:\to\xtquantai 4. Ensure the status is set to Enabled. Note: Use single backslashes when entering the path directly into the UI. ---get_trading_dates(market): Retrieves trading dates for a specified market (e.g., "SH"). * get_stock_list(sector): Retrieves the list of stocks in a specific sector (e.g., "沪深A股"). * get_instrument_detail(): Retrieves detailed information for a specific stock.get_history_market_data(): Retrieves historical market data. * get_latest_market_data(): Retrieves the most recent market data. * get_full_market_data(): Retrieves comprehensive market data.create_chart_panel(codes, period, indicator_name, param_names, param_values): Creates a chart panel with support for technical indicators. * create_custom_layout(): Creates a custom chart layout by specifying indicators and parameters. ---bash npx @modelcontextprotocol/inspector uv run xtquantaiget_stock_list to get the symbols and get_latest_market_data to filter and rank them for the user.create_chart_panel and create_custom_layout tools, the AI can instantly generate visual chart panels within the XTQuantQMT environment based on a simple chat command. Example: A user tells the AI: "Show me the daily charts for 000001.SZ and 600519.SH with a 20-period Moving Average overlay." The AI executes create_chart_panel with the specific codes, periods, and indicator parameters, instantly updating the user's trading terminal UI.
get_history_market_data, processes the numbers, and provides the exact value to help the developer set their strategy thresholds.get_instrument_detail to pull comprehensive metadata for any ticker symbol instantly, providing a…Part of MCP Servers