QMT

QMT-MCP-Server
  • python

32

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs

You use the MCP server to expose Stock trading actions from the QMT trading system to large language models. It lets you query assets, check holdings, place orders, and cancel orders through a standardized MCP interface, enabling safe and programmable interaction with the QMT trading environment.

How to use

Connect an MCP client to the QMT MCP Server to start exchanging trading commands. You can perform common actions like querying your account and holdings, placing buy/sell orders, and canceling orders. Use clear, human-readable commands so the model can translate them into MCP requests. For example, you might ask the MCP Server to show your current assets, or to place an order to buy a certain stock at a given price.

If you plan to operate programmatically, configure the MCP client with the server endpoint so it can send requests to the MCP server. The server exposes an HTTP-based MCP endpoint at the following URL (as shown in the sample configuration): http://localhost:8001/sse

Here is the explicit MCP connection example you can configure in your MCP client to connect to the QMT MCP Server. Use this as the remote server URL configuration and keep the rest of the client behavior as standard MCP interactions.

{
  "mcpServers": {
    "qmt_mcp_server": {
      "url": "http://localhost:8001/sse"
    }
  }
}

How to install

You need Python 3.10 or newer and the uv tool to install and run the MCP server locally. Ensure MiniQMT is running locally to enable trading features.

Follow these concrete steps to set up the server on your machine.

# Prerequisites
- Python >= 3.10
- uv package manager installed (see uv installation steps below)

# Step 1: Install uv (if you don\'t have it yet)
# The uv tool can be installed following its official installation instructions.

# Step 2: Clone the project
git clone https://github.com/nnquant/qmt-mcp-server

# Step 3: Install dependencies
uv sync

# Step 4: Run the project
uv run main.py

Additional notes

Configuration is created automatically on first run. You will be prompted to provide: the MiniQMT path and the funds account. These details are saved to xttrader.yaml for subsequent runs.

The system supports several trading actions through MCP, including querying account assets, querying holdings, placing orders, and canceling orders.

Important usage notes: make sure MiniQMT is running before you attempt trading actions, double-check your account information before placing trades, and ensure every stock code includes its exchange suffix (for example, .SH or .SZ). This project is intended for learning and testing; exercise caution when using it in live trading environments.

MCP connection example config snippet for the client (HTTP-based): this is the only server URL you should configure unless you have a local MCP stdio setup.

{
  "mcpServers": {
    "qmt_mcp_server": {
      "url": "http://localhost:8001/sse"
    }
  }
}

Available tools

query_assets

Query account assets including cash balance and total asset value.

query_positions

Query current stock holdings and positions in the account.

place_order

Place a new stock order specifying stock symbol, price, and quantity.

cancel_order

Cancel an existing order by its order ID.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational