QMT
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.
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
Maintainer
Works with
Installation
Manual Installation
npx qmt-mcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
Clone the repository
Clone the QMT-MCP repository to your Windows machine.
git clone https://github.com/guangxiangdebizi/QMT-MCP.git
cd QMT-MCPInstall Python dependencies
Install all required packages including FastMCP and the XTQuant client library.
pip install -r requirements.txtCreate 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.logStart 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.
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.pyConfigure 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.
QMT Alternatives — Similar Finance & Fintech Servers
Looking for alternatives to QMT? Here are other popular finance & fintech servers you can use with Claude, Cursor, and VS Code.
ValueCell
★ 10.7kValueCell is a community-driven, multi-agent platform for financial applications.
Vibe Trading
★ 8.1k'Vibe-Trading: Your Personal Trading Agent'
Quantdinger
★ 6.2kAI quantitative trading platform for crypto, stocks, and forex with backtesting, live trading, market data, and multi-agent research.vibe-trading ,trading-agents,ai-trader,ai-trading
TradingView
★ 2.8kReal-time crypto & stock screening, advanced technical indicators, Bollinger Bands intelligence, candlestick patterns + native Claude Desktop integration. Multi-exchange (Binance, KuCoin, Bybit+). Open-source AI trading infrastructure.
Financial Datasets
★ 2.1kProvides access to comprehensive financial data including income statements, balance sheets, cash flow statements, stock prices, company news, SEC filings, and cryptocurrency information with built-in financial ratio analysis.
Stripe
★ 1.6kThe Stripe Model Context Protocol server allows you to integrate with Stripe APIs through function calling. This protocol supports various tools to interact with different Stripe services.
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.
Set Up QMT in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.