XTQuantAI

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

Visit XTQuantAI

How to install and configure XTQuantAI

1. Installation Prerequisites: * Operating System: Windows (required for the QMT ecosystem). * Python: Version 3.11 or higher. * Software: 迅投 QMT or Research Terminal. * Package Manager: uv (recommended). Steps: 1. Install uv: 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. ---

2. Configuration You can integrate XTQuantAI with Cursor using one of the following methods.

Method 1: Configuration File Create a folder named .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.

Method 2: Cursor UI Settings 1. Navigate to Settings -> MCP -> Add New MCP Server. 2. Name: 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. ---

3. Available Tools

Basic Data Queries * 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.

Market Data * 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.

Charts and Visualization * 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. ---

4. Example Prompts Querying Market Info: * "Get the trading dates for the Shanghai (SH) market." * "Show me all stocks currently listed in the '沪深A股' sector." Visualizing Data: * "Create a daily chart for 000001.SZ and 600519.SH including a Moving Average (MA) indicator with a period of 5." Technical Usage: * If you need to debug the server, you can use the MCP Inspector (requires Node.js): bash npx @modelcontextprotocol/inspector uv run xtquantai

What you can do with XTQuantAI

Use Case 1: AI-Driven Market Screening and Sector Analysis Problem: Quantitative traders often need to identify specific trading opportunities across an entire sector (e.g., "A-shares") based on real-time performance, but manually scanning hundreds of stocks in a terminal is time-consuming. Solution: This MCP allows an AI assistant to fetch a full list of stocks in a sector and then retrieve their latest market data to perform natural language filtering and analysis. Example: A user asks: "Find all stocks in the '沪深A股' (CSI A-share) sector that have a current price lower than their opening price today and list the top 5 by volume." The AI uses get_stock_list to get the symbols and get_latest_market_data to filter and rank them for the user.

Use Case 2: Instant Technical Chart Generation via Natural Language Problem: Setting up specific technical indicators (like Moving Averages or custom layouts) in a trading terminal usually requires multiple clicks, menu navigation, and manual parameter entry. Solution: Using the create_chart_panel and create_custom_layout tools, the AI can instantly generate visual chart panels within the XTQuant

QMT 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.

Use Case 3: Data-Augmented Strategy Development in Cursor Problem: Developers writing quantitative trading strategies in editors like Cursor often lack immediate access to the historical data needed to verify logic or calculate realistic parameters while coding. Solution: Since XTQuantAI integrates directly with Cursor via MCP, the AI can pull real historical market data into the conversation to help write, debug, or refine trading algorithms. Example: While writing a mean-reversion script, the developer asks: "Based on the last 30 days of historical data for 600036.SH, what is the current standard deviation of the closing price?" The AI calls get_history_market_data, processes the numbers, and provides the exact value to help the developer set their strategy thresholds.

Use Case 4: Rapid "Stock Deep-Dive" and Instrument Intelligence Problem: Before placing a trade, a trader needs to know specific details about an instrument (e.g., lot size, price tick size, or listing date) that might be buried in different sub-menus of a trading platform. Solution: The AI can use get_instrument_detail to pull comprehensive metadata for any ticker symbol instantly, providing a…

Key facts

  • Data & Analytics, Design, Media & Creative, Finance, Crypto & Payments
  • charts, market data, quantitative-analysis, stocks, trading

Part of MCP Servers

Related MCP servers

  • MCP KQL Server — Execute KQL queries using Azure authentication. Requires Azure CLI login.
  • MCP Jupyter Complete — A server for Jupyter notebook manipulation with position-based operations and VS Code integration.
  • MCP MD2PDF Server — Convert Markdown documents to PDF with support for Mermaid diagrams.
  • MCP Media Processing Server — A server for media processing, offering powerful video and image manipulation using FFmpeg and ImageMagick.
  • MCP Music Analysis — Analyze audio from local files, YouTube, or direct links using librosa.
  • MCP OCR Server — An MCP server for Optical Character Recognition (OCR) using the Tesseract engine.
  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories