QMTCAUTION
QMT-MCP 模块化量化交易助手
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
一个基于FastMCP和XTQuant的模块化量化交易系统,提供智能策略生成、实时交易执行和回测分析功能。
🌟 项目特色
- 🔗 MCP协议集成: 基于Model Context Protocol,与AI助手无缝连接
- 📈 智能策略生成: 自动生成和优化量化交易策略
- ⚡ 实时交易执行: 支持XTQuant/QMT实盘和模拟交易
- 🧠 模块化架构: 清晰的代码结构,易于扩展和维护
- 📊 回测分析: 完整的策略回测和绩效评估
- 🛡️ 风险控制: 内置多层风险控制机制
🎬 演示视频
📺 点击封面图或链接即可在 Bilibili 观看完整演示 https://www.bilibili.com/video/BV1SFGjz6EKN/?vd_source=26053b834f0ddd4f57b22169d74b6f78
[](https://www.bilibili.com/video/BV1SFGjz6EKN/?vd_source=26053b834f0ddd4f57b22169d74b6f78)
🏗️ 系统架构
国金QMT-MCP/ ├── main.py # FastMCP服务器主入口 ├── config.json # 系统配置文件 ├── requirements.txt # 项目依赖 ├── src/ │ ├── config.py # 配置管理模块(支持环境变量) │ ├── tools/ # MCP工具实现 │ │ ├── trading_tool.py # 交易执行工具 │ │ └── qmt_tool.py # QMT策略工具 │ ├── strategies/ # 策略模块 │ │ ├── ma_strategy.py # 双均线策略 │ │ └── strategy_generator.py # 策略生成器 │ └── utils/ # 工具模块 │ ├── xtquant_client.py # XTQuant客户端 │ └── data_handler.py # 数据处理器 └── logs/ # 日志文件目录
🚀 快速开始
环境要求
- Python 3.8+
- XTQuant/QMT客户端 (国金/迅投量化交易客户端)
- Windows系统 (XTQuant仅支持Windows)
安装步骤
- 克隆项目
git clone cd Nondescript-MCP
- 安装依赖
pip install -r requirements.txt
- 配置环境
创建 .env 文件并配置以下参数:
# ===================================================== # 国金QMT-MCP 环境配置文件 # 请根据你的实际环境修改下面的配置参数 # ===================================================== # 服务器配置 QUANTMCP_HOST=127.0.0.1 # MCP服务器监听地址,通常保持127.0.0.1 QUANTMCP_PORT=8000 # MCP服务器端口号,可根据需要修改 QUANTMCP_TRANSPORT=sse
eb7afcaa2fafOBSERVED · 2026-10-06Exposed tools (4)
1 read · 3 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
cancel_order | write | 撤单工具 |
generate_ma_strategy | read | 生成并保存双均线策略示例 |
place_order | write | 简化下单工具 |
save_qmt_strategy | write | 保存自定义策略代码到 QMT 本地策略目录 |
Trust audit
CAUTIONgrade B · trust 82/100 Install with care. The audit found things worth knowing before you trust its output.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | WARN |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (9)
mcp_sse_server.cpython-313.pyc
test2.cpython-313-pytest-8.4.1.pyc
__init__.cpython-313.pyc
config.cpython-313.pyc
__init__.cpython-313.pyc
服务启动后将在 `http://127.0.0.1:8000` 提供MCP服务。
"url": "http://127.0.0.1:8000/sse",
fastmcp, pandas, numpy, xtquant, scipy, scikit-learn, pytest, black
Gates applied: no_behavioural_pass, no_license.
eb7afcaa2faffull audit observations/trust-audit/mcp-server/guangxiangdebizi__qmt-1.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-06 | eb7afcaa2faf | CAUTION | B | 82 | first audit |
Questions
What is the QMT MCP server?
QMT-MCP 模块化量化交易助手
What tools does QMT expose?
4 in total: 1 read-only, 3 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is QMT safe to connect to an agent?
With care. The audit graded it B (82/100) and found 9 things worth knowing before you trust this server, listed below with the exact line each was found on.
What credentials does QMT need?
No credential environment variables were found in its source, so it appears to need none.
How current is this page?
The grade is for one exact copy of the source (eb7afcaa2faf), read on 2026-10-06. The repository is watched and re-audited when it changes.