QMT

v1.0.0Finance & Fintechstable

A modular quantitative trading assistant that integrates with XTQuant/QMT trading platform, enabling AI-assisted trading strategy generation, real-time trade execution, and performance backtesting.

futuresmcpmcp-serveroptionspython
Share:
184
Stars
0
Downloads
0
Weekly
0/5

What is QMT?

QMT is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to modular quantitative trading assistant that integrates with xtquant/qmt trading platform, enabling ai-assisted trading strategy generation, real-time trade execution, and performance backtesting.

A modular quantitative trading assistant that integrates with XTQuant/QMT trading platform, enabling AI-assisted trading strategy generation, real-time trade execution, and performance backtesting.

This server falls under the Finance & Fintech category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A modular quantitative trading assistant that integrates wit

Use Cases

Generate quantitative trading strategies with AI.
Execute trades and monitor real-time performance.
Backtest trading strategies using historical data.
LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 20, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx qmt-mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use QMT

QMT-MCP is a modular quantitative trading assistant built on FastMCP and the XTQuant/QMT trading platform, exposing AI-assisted strategy generation, real-time trade execution, and historical backtesting through the Model Context Protocol. It lets AI models place orders, cancel orders, generate moving-average strategies, run backtests with full risk metrics, and save custom strategy scripts to the QMT platform — all from a natural-language interface. Quant traders and developers who use the GuoJin QMT or XTQuant client on Windows use it to accelerate strategy research and automate routine trading operations.

Prerequisites

  • Python 3.8 or higher
  • Windows OS (XTQuant only supports Windows)
  • XTQuant/QMT trading client (GuoJin or XTQuant) installed, logged in, and connected
  • FastMCP Python package and other dependencies listed in requirements.txt
  • An MCP-compatible client such as Claude Desktop
1

Clone the repository

Clone the QMT-MCP repository to your Windows machine.

git clone https://github.com/guangxiangdebizi/QMT-MCP.git
cd QMT-MCP
2

Install Python dependencies

Install all required packages including FastMCP and the XTQuant client library.

pip install -r requirements.txt
3

Create and configure the .env file

Copy the example below into a .env file in the project root and fill in your QMT installation path, session ID, and account ID. Risk control limits are also set here.

QUANTMCP_HOST=127.0.0.1
QUANTMCP_PORT=8000
QUANTMCP_TRANSPORT=sse
QMT_PATH=D:\QMT\userdata_mini
QMT_SESSION_ID=12345
QMT_ACCOUNT_ID=your_account_id
QMT_STRATEGY_DIR=D:\QMT\mpython
MAX_ORDER_VALUE=100000.0
MAX_POSITION_VALUE=500000.0
MIN_ORDER_QUANTITY=100
DEFAULT_SYMBOL=000001.SZ
DEFAULT_START_DATE=20240101
DEFAULT_END_DATE=20241201
DEFAULT_SHORT_PERIOD=5
DEFAULT_LONG_PERIOD=20
LOG_LEVEL=INFO
LOG_FILE=logs/quantmcp.log
4

Start the XTQuant/QMT client

Open the GuoJin QMT or XTQuant trading client on your Windows machine, log in with your credentials, and confirm it shows a connected status before starting the MCP server.

5

Start the QMT-MCP server

Launch the FastMCP server. It will listen on the host and port configured in your .env file and expose all trading tools over SSE transport.

python main.py
6

Configure your MCP client

Add the server to your MCP client configuration. Because the server uses SSE transport, point the client at the HTTP endpoint rather than launching a subprocess.

QMT Examples

Client configuration

Connect Claude Desktop to the running QMT-MCP SSE server at its local endpoint.

{
  "mcpServers": {
    "qmt-mcp": {
      "command": "python",
      "args": ["main.py"],
      "cwd": "C:\\path\\to\\QMT-MCP",
      "env": {
        "QUANTMCP_HOST": "127.0.0.1",
        "QUANTMCP_PORT": "8000"
      }
    }
  }
}

Prompts to try

Example prompts for trading strategy generation, execution, and backtesting through Claude.

- "Generate a dual moving-average strategy for 000001.SZ with a 5-day short period and 20-day long period"
- "Place a buy order for 100 shares of 000001.SZ at 10.50 yuan"
- "Cancel order number 12345"
- "Run a backtest for the MA strategy on 000001.SZ from 20240101 to 20241201 and show the Sharpe ratio and max drawdown"
- "Save a custom strategy script called momentum_strategy to the QMT strategy directory"

Troubleshooting QMT

Connection refused when the MCP client tries to reach the server

Confirm python main.py is running and listening on port 8000. Check the logs/ directory for startup errors. Ensure QUANTMCP_HOST and QUANTMCP_PORT in .env match what your client is configured to reach.

XTQuant client raises an authentication or connection error

Ensure the QMT/XTQuant desktop client is already running and logged in before starting python main.py. Verify QMT_PATH, QMT_SESSION_ID, and QMT_ACCOUNT_ID in .env exactly match the values shown in the QMT client settings.

Order is rejected with a risk control violation

The server enforces MAX_ORDER_VALUE and MAX_POSITION_VALUE limits. Adjust these values in your .env file to match your risk tolerance, then restart the server. MIN_ORDER_QUANTITY must be a multiple of 100 per Chinese market rules.

Frequently Asked Questions about QMT

What is QMT?

QMT is a Model Context Protocol (MCP) server that modular quantitative trading assistant that integrates with xtquant/qmt trading platform, enabling ai-assisted trading strategy generation, real-time trade execution, and performance backtesting. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install QMT?

Follow the installation instructions on the QMT GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with QMT?

QMT works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is QMT free to use?

Yes, QMT is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Finance & Fintech MCP Servers

Explore all finance & fintech servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "qmt-mcp": { "command": "npx", "args": ["-y", "qmt-mcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use QMT?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides