Content
# QMT MCP Server
## Project Introduction
- A MCP server based on QMT platform for stock market data download and query.
## Features
- Get stock details
- Download historical stock data
- Query stock market data
## Tool Functions
- `get_current_time_tool`: Get current time
- `get_instrument_detail_tool`: Get detailed information of a stock
- `download_history_data_tool`: Download historical market data of a specific stock
- `download_history_data2_tool`: Download historical market data of multiple stocks
- `get_market_data_ex_tool`: Get market data of multiple stocks
## Sample Display
- Question: How does China Mobile A-shares perform over the past three months, and conduct a comprehensive analysis from multiple perspectives.
To analyze the performance of China Mobile A-shares over the past three months in detail, I first need to obtain relevant data. The stock code of China Mobile A-shares is 600941.SH. I will obtain detailed information and historical market data for this stock.
View result from get_instrument_detail_tool
Now, I will download the historical data of China Mobile A-shares over the past three months. Considering today is April 16, 2025, I will obtain daily data from January 16, 2025, to the present:
View result from download_history_data_tool
Now, I will get the detailed market data of China Mobile A-shares:
View result from get_market_data_ex_tool
Let's get the current time to determine the latest trading day:
View result from get_current_time_tool
Now that I have obtained the detailed data of China Mobile A-shares (600941.SH) over the past three months, let me conduct a comprehensive analysis of its performance.
China Mobile A-shares Performance Analysis over the Past Three Months
1. Price Trend Analysis
Overall Trend:
Starting Price (January 16, 2025): Opening price 108.40 yuan, closing price 109.29 yuan
Latest Price (April 15, 2025): Opening price 110.43 yuan, closing price 111.75 yuan
Three-month Cumulative Increase: 2.25% (from 109.29 yuan to 111.75 yuan)
Stage Performance:
January: The stock price fluctuated slightly, maintaining in the range of 107-111 yuan
February: A significant increase was observed, reaching a stage high of 114.50 yuan on February 21
Late February to March: Experienced a wave of decline, dropping to 105.66 yuan on March 12, the stage low
Late March to April: Stabilized and rebounded, reaching 112.60 yuan on April 9, then slightly回调
2. Trading Volume Analysis
Trading Volume Changes:
Daily Average Trading Volume: About 16.2 million hands
High Trading Volume Dates:
February 10: 34.5 million hands (stock price rose from 108.14 yuan to 110.00 yuan)
February 21: 35.2 million hands (stock price rose from 110.37 yuan to 114.50 yuan)
March 21: 35.5 million hands (stock price rose from 105.00 yuan to 106.65 yuan)
April 7: 36.8 million hands (stock price dropped and then rebounded from 108.99 yuan to 108.45 yuan)
April 8: 32.3 million hands (stock price significantly rose to 111.60 yuan)
Relationship between Trading Volume and Price:
Significant increase in trading volume during significant price increases: Such as February 10, February 21, April 8, etc.
Relatively small trading volume during price adjustments: Such as mid-to-late March
3. Price Volatility Analysis
Volatility:
Highest Price: 114.50 yuan (February 21, 2025)
Lowest Price: 105.00 yuan (March 20, 2025)
Maximum Amplitude: 9.05% (difference between the highest and lowest points)
Daily Average Volatility: 1.58%
Volatility Rate:
Three-month Daily Average Volatility: 0.77%
February's volatility rate was higher than January and March, reflecting more active market sentiment
4. Technical Indicator Analysis
Trend Line:
Short-term Trend: Presenting an upward trend since April
Medium-term Trend: Formed a "V"-shaped reversal pattern, rebounding from the bottom in mid-March
Support and Resistance Levels:
Main Support Level: Around 105 yuan (multiple tests without effective breakdown)
Main Resistance Level: 112-115 yuan interval (February high area)
Trading Volume Indicators:
Price increases accompanied by trading volume amplification, indicating stronger bullish forces
Recent trading volume maintained at a high level, showing increased market attention to the stock
5. Comparison and Analysis with the Market
Although direct comparison data for the Shanghai Stock Exchange index cannot be obtained, based on price trend characteristics, it can be inferred:
China Mobile's performance was stronger than the market in January-February (the market performed well in February)
Synchronized adjustment with the market from early to mid-March
Followed the market's rebound since early April, showing a relatively positive performance
6. Important Time Node Analysis
Key Dates and Performance:
February 21: Single-day increase of 3.74%, with significant trading volume amplification
February 22-26: Consecutive 3 trading days of decline, cumulative decline of about 6%
March 20-21: Touched the stage low and then strongly rebounded, with a single-day increase of 1.57%
April 8-9: Consecutive 2 trading days of increase, cumulative increase of 3.83%
7. Investment Value Assessment
Observations:
The stock price oscillated upward, presenting a steady and rising trend
Trading activity was moderate, without significant abnormal fluctuations
Recent trading volume increase accompanied by price increases, indicating enhanced market confidence
Potential Factors:
As a leading enterprise in the communication industry, China Mobile has a strong market position
The development of 5G business and potential new technology applications may be driving factors for the recent stock price increase
Relatively steady price fluctuations reflect investors' long-term optimism about the stock
8. Comprehensive Conclusion
China Mobile A-shares' performance over the past three months showed a trend of initial suppression and then elevation: relatively stable in January, significant increase in February, followed by a wave of adjustment in March, and stabilization and rebound since April. The cumulative increase over three months was 2.25%, with moderate volatility and high trading activity. From a technical perspective, the stock has completed a complete adjustment-rebound cycle and is currently in an upward channel, with potential for further breakthroughs in the short term. As trading volume increases, market interest in the stock is growing, and its future performance is worth attention.
- Question: How does the recent three-month A-share performance of PetroChina, Sinopec, and CNOOC compare?
Let me query the recent three-month A-share performance data of PetroChina, Sinopec, and CNOOC for you. First, I need to obtain their stock codes and then download relevant historical data.
PetroChina's stock code in the A-share market is 601857.SH; Sinopec's stock code is 600028.SH; CNOOC's stock code in A-shares is 600938.SH.
Let me confirm these codes and obtain stock information:
View result from get_instrument_detail_tool
View result from get_instrument_detail_tool
View result from get_instrument_detail_tool
Now, let me get the current time to determine the time range for the past three months:
View result from get_current_time_tool
Based on the current time being April 21, 2025, I will obtain stock data from January 21, 2025, to the present (about 3 months):
View result from download_history_data2_tool
Now, I will obtain market data for these stocks:
View result from get_market_data_ex_tool
Based on the obtained data, I can now analyze the recent three-month performance of PetroChina, Sinopec, and CNOOC in the A-share market.
PetroChina (601857.SH) Recent Three-Month Performance Analysis
Starting Price (January 21, 2025): Opening price 8.53 yuan
Ending Price (April 21, 2025): Closing price 7.94 yuan
Three-month Change: (7.94 - 8.53) / 8.53 ≈ -6.92%
Highest Price During the Period: 8.56 yuan (January 21)
Lowest Price During the Period: 7.33 yuan (April 7)
Trend Analysis: Overall, it showed a stable and then declining trend, with a significant decline in early April, followed by a slight rebound
Sinopec (600028.SH) Recent Three-Month Performance Analysis
Starting Price (January 21, 2025): Opening price 6.18 yuan
Ending Price (April 21, 2025): Closing price 5.66 yuan
Three-month Change: (5.66 - 6.18) / 6.18 ≈ -8.41%
Highest Price During the Period: 6.19 yuan (January 21)
Lowest Price During the Period: 5.25 yuan (April 7)
Trend Analysis: Overall, it showed a downward trend, with a significant drop in early April, followed by a slight recovery
CNOOC (600938.SH) Recent Three-Month Performance Analysis
Starting Price (January 21, 2025): Opening price 28.23 yuan
Ending Price (April 21, 2025): Closing price 24.92 yuan
Three-month Change: (24.92 - 28.23) / 28.23 ≈ -11.73%
Highest Price During the Period: 28.28 yuan (January 21)
Lowest Price During the Period: 23.11 yuan (April 7)
Trend Analysis: Overall, it had the largest decline, with a sharp drop in early April, followed by a slight rebound
Comparison and Analysis of the Three Companies
Comparison of Decline: CNOOC had the largest decline, with a cumulative decline of about 11.73% over three months; Sinopec was second, with a decline of about 8.41%; PetroChina performed relatively better, with a decline of about 6.92%
Volatility: CNOOC had the largest volatility, with the stock price dropping from around 28 yuan to 24 yuan; PetroChina and Sinopec had relatively smaller fluctuations
Key Time Points: All three companies experienced significant declines around April 7, possibly related to the same market or industry factors
Rebound Performance: All three companies had a certain degree of rebound in mid-April, but failed to recover to the level of late March
Summary
Over the past three months, all three petroleum companies showed a declining trend in the A-share market, with CNOOC having the largest decline and PetroChina performing relatively better. The stock price trends of the three companies were similar, showing a strong industry correlation.
## Notes
1. Limited by the QMT client, currently only supports Windows
2. Before starting the MCP server, ensure that QMT is enabled and running in the background
## Quick Start
1. Install QMT-MCP-Server
```bash
$ pip install git+https://github.com/jm12138/qmt-mcp-server
```
2. Start QMT or MiniQMT client
3. Start MCP Server
1. stdio mode (suitable for local use)
```bash
$ qmt_mcp_server_stdio
```
2. sse mode (suitable for server deployment)
```bash
$ qmt_mcp_server_sse --host 0.0.0.0 --port 8000
```
4. Client Configuration
1. Claude Desktop
```json
{
"mcpServers": {
"qmt-mcp-server": {
"command": "qmt_mcp_server_stdio"
}
}
}
```
2. VS Code
```json
{
"servers": {
"qmt-mcp-server": {
"command": "qmt_mcp_server_stdio"
}
}
}
```
```json
{
"servers": {
"qmt-mcp-server": {
"type": "sse",
"url": "http://0.0.0.0:8000/sse",
}
}
}
```
Connection Info
You Might Also Like
valuecell
Valuecell is a Python project for efficient data management.
hexstrike-ai
HexStrike AI is an AI-powered MCP cybersecurity automation platform with 150+ tools.
AP2
AP2 provides code samples and demos for the Agent Payments Protocol.
YC-Killer
YC-Killer is an AI agents library by Singularity Research, open-sourcing...
mcp-server
MCP Server provides access to stock market data and financial statements.
Vibe-Trading
Vibe-Trading: Your Personal Trading Agent