
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
finance-mcp-alpha
Advanced tools
MCP Server for calculating WorldQuant 101 Alpha factors using Tushare data
A powerful Model Context Protocol (MCP) server for calculating WorldQuant 101 Alpha factors using real-time Chinese stock market data from Tushare. Built with TypeScript and designed for quantitative trading analysis and research.
src/
├── index.ts # MCP server entry point
├── tools/
│ └── calculate_alpha.ts # Alpha calculation tool
├── alphas/
│ └── index.ts # Alpha factor implementations
└── utils/
├── tushare.ts # Tushare API client
└── operators.ts # Mathematical operators
npm install finance-mcp-alpha
git clone https://github.com/guangxiangdebizi/FinanceMCP-Alpha.git
cd FinanceMCP-Alpha
npm install
npm run build
npm start
The server will start on http://localhost:3000 by default.
🚀 FinanceMCP-Alpha Server Started
=====================================
Transport: Streamable HTTP
MCP Endpoint: http://localhost:3000/mcp
Health Check: http://localhost:3000/health
=====================================
Add to your MCP client configuration (e.g., mcp.json or Claude Desktop config):
{
"mcpServers": {
"finance-alpha": {
"type": "streamableHttp",
"url": "http://localhost:3000/mcp",
"headers": {
"X-Tushare-Token": "YOUR_TUSHARE_TOKEN_HERE"
},
"timeout": 600
}
}
}
⚠️ Important: Get your free Tushare token at https://tushare.pro/register
Once connected, you can use the calculate_alpha tool:
Calculate Alpha factors for stock 000001.SZ from 20240101 to 20241011
with factors Alpha3, Alpha13, Alpha50
This package implements the following WorldQuant 101 Alpha factors:
Formula: (-1 * correlation(rank(open), rank(volume), 10))
Use Case: Measures negative correlation between opening price ranks and volume ranks. High values suggest contrarian price-volume behavior.
Formula: (-1 * rank(covariance(rank(close), rank(volume), 5)))
Use Case: Captures ranked covariance between closing prices and volume. Identifies price-volume anomalies.
Formula: (-1 * sum(rank(correlation(rank(high), rank(volume), 3)), 3))
Use Case: Sum of ranked correlations between high prices and volume. Detects short-term momentum shifts.
Formula: (-1 * rank(covariance(rank(high), rank(volume), 5)))
Use Case: Similar to Alpha13 but focuses on intraday volatility patterns using high prices.
Formula: (-1 * correlation(high, rank(volume), 5))
Use Case: Negative correlation between high prices and volume ranks. Identifies volume divergence from price peaks.
Formula: (-1 * ts_max(rank(correlation(rank(volume), rank(vwap), 5)), 5))
Use Case: Maximum ranked correlation between volume and VWAP. Measures volume-price efficiency.
Formula: (-1 * correlation(rank((close - ts_min(low, 12)) / (ts_max(high, 12) - ts_min(low, 12))), rank(volume), 6))
Use Case: Correlation between normalized price position and volume. Captures momentum-volume relationships.
calculate_alpha| Parameter | Type | Required | Description |
|---|---|---|---|
stock_code | string | ✅ | Stock code in Tushare format (e.g., 000001.SZ, 600000.SH) |
start_date | string | ✅ | Start date in YYYYMMDD format (e.g., 20240101) |
end_date | string | ✅ | End date in YYYYMMDD format (e.g., 20241011) |
factors | array | ✅ | List of factors: ["Alpha3", "Alpha13", "Alpha15", "Alpha16", "Alpha44", "Alpha50", "Alpha55"] |
XXXXXX.SZ (e.g., 000001.SZ - Ping An Bank)XXXXXX.SH (e.g., 600000.SH - SPD Bank)The tool returns a comprehensive Markdown report including:
| Percentile | Signal | Emoji | Action |
|---|---|---|---|
| ≥ 80% | STRONG BUY | 🟢 | Strong buying opportunity |
| 60-80% | BUY | 🟢 | Moderate buying opportunity |
| 40-60% | HOLD | 🟡 | Neutral, wait for clearer signal |
| 20-40% | SELL | 🔴 | Moderate selling pressure |
| < 20% | STRONG SELL | 🔴 | Strong selling pressure |
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run in development mode
npm run dev
# Start production server
npm start
Create a .env file (optional):
PORT=3000
Test the health endpoint:
curl http://localhost:3000/health
Expected response:
{
"status": "healthy",
"transport": "streamable-http",
"activeSessions": 0,
"serverInfo": {
"name": "FinanceMCP-Alpha",
"version": "1.0.0"
}
}
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
This software is for educational and research purposes only. Alpha factors are statistical indicators and should not be the sole basis for investment decisions. Past performance does not guarantee future results. Always conduct thorough research and consult with financial professionals before making investment decisions.
Xingyu Chen
⭐ If you find this project helpful, please consider giving it a star on GitHub!
Happy Trading! 📈
FAQs
MCP Server for calculating WorldQuant 101 Alpha factors using Tushare data
The npm package finance-mcp-alpha receives a total of 3 weekly downloads. As such, finance-mcp-alpha popularity was classified as not popular.
We found that finance-mcp-alpha demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.