Content
# Futures MCP - Futures Trading Strategy Analysis Platform
Futures trading strategy analysis MCP (Model Content Protocol) service and Streamlit interactive platform.
## Project Introduction
This project is a futures trading strategy analysis platform that integrates real-time market data, technical analysis, news, and AI analysis. It provides two ways of use:
1. **MCP Service**: Integrated with AI assistants like Claude, get futures analysis through dialogue.
2. **Streamlit Interface**: Provides an intuitive graphical interface to directly view futures data and analysis results.
Main features:
- Real-time futures market data
- Rich technical analysis indicators
- Related news
- AI-driven market analysis
- Friendly web interface
- Standard MCP protocol implementation
- DeepSeek AI integration
## Tech Stack
- Python 3.10+
- MCP standard protocol - interaction with AI assistants
- Streamlit - interactive web interface
- akshare - futures data acquisition
- DeepSeek API - AI analysis support
- Plotly - data visualization
## Functional Features
### 1. Data Acquisition
- Real-time futures market data
- Historical price data
- Related news
### 2. Technical Analysis
- Moving Average (MA)
- MACD indicator
- RSI indicator
- Bollinger Bands
- KDJ indicator
- Volume analysis
### 3. AI Analysis
- Market trend analysis
- Technical indicator interpretation
- News sentiment analysis
- Trading suggestions
## Installation Instructions
1. Clone the project:
```bash
git clone https://github.com/sencloud/futures_mcp.git
cd futures_mcp
```
2. Create a virtual environment:
```bash
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
```
3. Install dependencies:
```bash
pip install -r requirements.txt
```
4. Configure environment variables:
```bash
cp .env.example .env
# Edit .env file, set DEEPSEEK_API_KEY
```
## Usage Instructions
This project provides two ways of use: MCP service and Streamlit interface.
### Method 1: MCP Service + AI Assistant
1. Start MCP server:
```bash
python mcp_server.py
```
2. Configure Claude Desktop:
- Create or edit Claude Desktop configuration file, note that if it fails to start, you need to confirm to execute directly in the command prompt `python /absolute/path/to/futures_mcp/mcp_server.py` whether it is normal:
**macOS**:
```bash
mkdir -p ~/Library/Application\ Support/Claude/
nano ~/Library/Application\ Support/Claude/claude_desktop_config.json
```
**Windows**:
```
%APPDATA%\Claude\claude_desktop_config.json
```
- Add the following configuration (replace the path with your actual path):
```json
{
"mcpServers": {
"futures-mcp": {
"command": "python",
"args": [
"/absolute/path/to/futures_mcp/mcp_server.py"
]
}
}
}
```
3. Restart Claude Desktop
4. Now you can use the futures tool in Claude Desktop

5. You can try asking Claude:
- "Get the current price of soybean meal"
- "Analyze the technical indicators of soybean meal recently"
- "Give me recent futures news"
### Method 2: Streamlit Interface
If you want to use an intuitive graphical interface:
```bash
streamlit run app.py
```
Visit the browser http://localhost:8501

### Streamlit Interface Usage Process
1. **Select futures variety**: Select the futures code to analyze in the sidebar
2. **Set time range**: Select the start and end dates of historical data
3. **View market data**: View real-time prices and K-line charts
4. **Analyze technical indicators**: View various technical analysis indicators
5. **Get news**: Read related news
6. **Get AI analysis**: Click the "Start analysis" button to get professional analysis provided by DeepSeek AI
## Obtain DeepSeek API Key
To use the AI analysis function, you need a DeepSeek API key (note that if you want the online function, please use Volcano Engine, currently the functions in this code library use Volcano Engine):
1. Visit [DeepSeek Official Website](https://deepseek.com/)
2. Register/login account
3. Navigate to API settings page
4. Create a new API key
5. Add the obtained key to `.env` file
## MCP Tools
This project provides the following MCP tools:
1. **get_current_price**
- Get real-time futures price
- Parameters: symbol (futures code, e.g., M2509)
2. **get_prices**
- Get historical price data
- Parameters: symbol, start_date (optional), end_date (optional), interval (optional)
3. **get_news**
- Get related news
- Parameters: symbol
4. **get_technical_indicators**
- Get technical analysis indicators
- Parameters: symbol, start_date (optional), end_date (optional)
5. **analyze_futures**
- AI analyze futures data
- Parameters: symbol
## Project Structure
```
futures_mcp/
├── app.py # Streamlit application main file
├── mcp_server.py # MCP server
├── technical_analysis.py # Technical analysis tool
├── .env.example # Environment variable example
├── claude_desktop_config.example.json # Claude Desktop configuration example
├── requirements.txt # Project dependencies
└── README.md # Project documentation
```
## Others
If you like my project, you can buy me a cup of coffee:
<img src="https://github.com/user-attachments/assets/e75ef971-ff56-41e5-88b9-317595d22f81" alt="image" width="300" height="300">
## License
MIT License
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.
Vibe-Trading
Vibe-Trading: Your Personal Trading Agent
AP2
AP2 provides code samples and demos for the Agent Payments Protocol.
tradingview-mcp
AI-assisted TradingView chart analysis — connect Claude Code to your...
YC-Killer
YC-Killer is an AI agents library by Singularity Research, open-sourcing...