Content
# agu-mcp — MCP Server
> Let Claude directly query and analyze A-share data! Real-time quotes, K-lines, technical indicators, fundamentals, AI stock screening, all in one place.
## ✨ Features
| Tool | Description |
|------|------|
| `get_realtime_quote` | Real-time quotes (price, price change, PE/PB, market value, 52-week high/low) |
| `get_batch_quotes` | Batch quote query |
| `get_kline` | K-line data (daily/weekly/monthly, supports forward adjustment) |
| `get_technical_indicators` | Technical indicators (MACD/RSI/KDJ/Bollinger Bands/Moving Averages) |
| `search_stocks` | Stock search (code/name/pinyin) |
| `get_sector_performance` | Sector performance ranking |
| `get_money_flow` | Money flow (main/retail/large/medium/small orders) |
| `get_fundamentals` | Fundamental data (ROE/gross margin/debt ratio/revenue/profit) |
| `get_stock_news` | News announcements |
| `ai_stock_screening` | AI stock screening (PE/PB/technical indicators/moving average arrangement conditions) |
## 🚀 Quick Start
### Installation
```bash
# Clone the project
cd agu-mcp
npm install
npm run build
```
### Configure Claude Code
The project comes with a `.mcp.json` file, which can be automatically loaded by restarting Claude Code.
Alternatively, add a global configuration in `~/.claude/mcp.json`:
```json
{
"mcpServers": {
"agu": {
"command": "node",
"args": ["path/to/agu-mcp/dist/index.js"]
}
}
}
```
### Usage Examples
```
"Check the real-time quote for Guizhou茅台"
"Analyze the MACD and RSI indicators for 600519"
"Which sectors performed well today?"
"Screen stocks with PE between 10-20 and MACD golden cross"
"View the money flow for Ningde Times over the past 5 days"
```
## 🏗 Technical Architecture
```
agu-mcp/
├── src/
│ ├── index.ts # Entry point + service registration
│ ├── config.ts # Configuration (cache TTL, data source)
│ ├── tools/ # 10 MCP tool implementations
│ │ ├── quote.ts # Real-time quotes
│ │ ├── kline.ts # K-line data
│ │ ├── indicators.ts # Technical indicators
│ │ ├── search.ts # Stock search
│ │ ├── sector.ts # Sector performance
│ │ ├── moneyflow.ts # Money flow
│ │ ├── fundamentals.ts # Fundamentals
│ │ ├── news.ts # News announcements
│ │ ├── screening.ts # AI stock screening
│ │ └── formatters.ts # Output formatting
│ ├── data/
│ │ ├── eastmoney.ts # East Money HTTP adapter
│ │ └── cache.ts # Memory + SQLite cache
│ ├── analysis/
│ │ ├── indicators.ts # Technical indicator calculation engine
│ │ └── screening.ts # Stock screening engine
│ └── utils/
│ ├── stockCode.ts # Stock code parsing
│ └── logger.ts # Logging utility
└── dist/ # Compilation output
```
## 📊 Data Sources
- **East Money HTTP API** (free, no registration required, no API key)
- **Tencent Market Data Interface** (backup)
- All data is publicly available market data
## 💡 Notes
- The data source is East Money's public interface, for personal learning and research purposes only
- High-frequency requests may be rate-limited, with built-in caching strategies (real-time quotes every 5 seconds, K-line data every 1 minute, etc.)
- Non-trading hours return the latest trading day's data
- **This tool does not constitute any investment advice**
## 📜 License
MIT