Skip to main content

MCP Server for QMT

Project description

QMT-MCP-Server

赋予大模型执行股票交易的能力!

QMT-MCP-Server 是一个基于 MCP (Model Control Protocol) 的服务器应用,用于对接迅投 QMT 交易系统,提供股票交易相关的功能接口。

本项目仅供交流学习使用,请谨慎用于实盘环境

已实现功能

  • 账户资产查询
  • 持仓信息查询
  • 下单
  • 撤单

系统要求

  • Python >= 3.10
  • 开通QMT交易权限,且本地已启动miniqmt

安装说明

使用前请先安装python包管理工具 uv

安装方法请参考 https://docs.astral.sh/uv/getting-started/installation/#github-releases

  1. 克隆项目到本地
git clone https://github.com/nnquant/qmt-mcp-server
  1. 安装依赖:
uv sync
  1. 运行项目
uv run main.py

配置说明

首次运行时,系统会提示输入必要的配置信息:

  • MiniQMT 所在路径
  • 资金账户

配置信息将自动保存在 xttrader.yaml 文件中。

MCP使用技巧

  1. 选择合适的MCP客户端,配置好MCP服务器,例如在Cursor中,配置如下:
{
  "mcpServers": {
    "qmt-mcp-server": {
      "url": "http://localhost:8001/sse"
    }
  }
}
  1. 指令案例
  • 请帮我查询我的账户持仓
  • 以10元的价格购买100股600000.SH股票
  • 以11元的价格购买100股平安银行股票
    • (由于不同大模型的差异,部分情况下可能无法正确转换股票名称到股票代码,使用股票名称下单请谨慎)
  • 以XX的价格为我购买20%可用仓位的XXXX股票
  • 配合其他MCP服务完成选股交易的一条龙

注意事项

  • 使用前请确保 MiniQMT 系统正常运行
  • 交易前请仔细核对账户信息
  • 所有股票代码需要包含交易所后缀(.SH 或 .SZ)
  • 本程序仅用于交流和学习,请谨慎用于实盘,本人不承担任何使用者使用本程序所造成的损失

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mseep_qmt_mcp_server-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mseep_qmt_mcp_server-0.1.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file mseep_qmt_mcp_server-0.1.0.tar.gz.

File metadata

  • Download URL: mseep_qmt_mcp_server-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for mseep_qmt_mcp_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6aca19841ff5ccbdb43fa1368b11f364c083baaa8be3da25ed4823d13cea7bbf
MD5 1e3140a26d2902c5d31a2a13abfa3a81
BLAKE2b-256 d43a248c199b2fa51d6da3692c944371af6e0f6d92c278301fc50309f6208e4b

See more details on using hashes here.

File details

Details for the file mseep_qmt_mcp_server-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mseep_qmt_mcp_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0f814f2c61c1038d24f9db5490dc302850af252425b1b934cf0ab1c44693958
MD5 dd506f68e828909232ddb503653e3450
BLAKE2b-256 0e099e01f6452d88f963193d109d84abba2d84f06c637dc3c7268db0f8d3453d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page