Metadata-Version: 2.4
Name: time-series-forecast-mcp
Version: 0.1.0
Summary: 时间序列预测 MCP (Model Context Protocol) - 提供 AR、MA、ARIMA、GARCH、指数平滑五种时间序列预测能力
Author-email: Your Name <your.email@example.com>
License-Expression: MIT
Keywords: time-series,forecasting,MCP,ARIMA,GARCH,exponential-smoothing
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: fastmcp>=2.0.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: statsmodels>=0.14.0
Requires-Dist: arch>=7.0.0
Requires-Dist: scipy>=1.10.0
Provides-Extra: full
Requires-Dist: pmdarima>=2.0.0; extra == "full"
Provides-Extra: test
Requires-Dist: pytest>=7.0.0; extra == "test"
Requires-Dist: pytest-cov>=4.0.0; extra == "test"

# Time Series Forecast MCP

时间序列预测 MCP (Model Context Protocol)，提供五种时间序列预测模型：

- **AR**: 自回归模型
- **MA**: 移动平均模型
- **ARIMA**: 自回归积分移动平均模型（支持自动选参）
- **GARCH**: 广义自回归条件异方差模型（波动率预测）
- **EXPONENTIAL_SMOOTHING**: 指数平滑模型（支持季节性）

## 安装

```bash
pip install time-series-forecast-mcp
```

## 使用

### 作为 MCP 服务启动

```bash
python -m time_series_forecast_mcp
```

或使用 fastmcp CLI：

```bash
fastmcp run server.py:mcp
```

### 工具列表

#### list_forecast_models
列出支持的时间序列预测模型及适用场景说明。

#### forecast_time_series
对历史时间序列进行预测。

**参数**:
- `model_type`: AR / MA / ARIMA / GARCH / EXPONENTIAL_SMOOTHING
- `series`: 历史观测值，按时间升序排列
- `horizon`: 向前预测步数（默认 12）
- `p`: AR 阶数或 ARIMA/GARCH 的 p（可选）
- `d`: ARIMA 差分阶数（可选）
- `q`: MA 阶数或 ARIMA/GARCH 的 q（可选）
- `seasonal_period`: 季节周期，仅 EXPONENTIAL_SMOOTHING 使用（可选）
- `confidence_level`: 置信水平，默认 0.95

**返回**:
- `forecast`: 点预测
- `lower_bound / upper_bound`: 置信区间
- `model_info`: 模型参数与 AIC/BIC 等信息
- `diagnostics`: 样本量等诊断信息

## 依赖

- fastmcp >= 2.0.0
- numpy >= 1.24.0
- pandas >= 2.0.0
- statsmodels >= 0.14.0
- arch >= 7.0.0
- scipy >= 1.10.0

## 许可证

MIT License
