loading…
Search for a command to run...
loading…
An MCP server powered by Meta's Prophet that enables LLMs to perform time-series forecasting, trend analysis, and predictive modeling on historical data. It pro
An MCP server powered by Meta's Prophet that enables LLMs to perform time-series forecasting, trend analysis, and predictive modeling on historical data. It provides LLM-friendly statistical summaries, automated business-rule validation, and ready-to-render Chart.js visualizations.
An open-source Model Context Protocol (MCP) server engineered for Time-Series Forecasting.
Powered by Meta's Prophet, this server enables LLMs to generate accurate forecasts, trend analyses, and confidence intervals from historical data — turning raw numbers into actionable insights within AI workflows.
Note: This project is a specialized fork of the sendgrid-mcp server, re-engineered to provide robust forecasting capabilities via the MCP protocol.
Leverages Meta's Prophet to predict future trends based on historical data. Handles seasonality, outliers, and trend changes automatically.
Choose the right forecasting model for your scenario:
cap (max) and optional floor (min) — ideal for metrics like market share, adoption rates, or capacity-limited systems.Supports daily, hourly, weekly, and monthly time series via the freq parameter — use the frequency that matches your input data.
Returns data in a structured, two-part format optimized for Large Language Models:
content[0] — Text Summary: Plain-English analysis with trend direction (e.g., "UPWARD +26.1%"), statistical breakdowns, growth model details, and a full forecast data table.content[1] — Chart.js Config: A proper JSON payload (chartjs_config:{...}) ready for visualization — no regex parsing needed.Every response includes a Chart.js configuration with:
Input validation with clear error messages for:
cap for logistic growthfloor >= cap combinations┌─────────────────────────────────────────────────────────────┐
│ 1. LLM sends historical data (dates + values) via MCP │
│ 2. User selects growth model (linear or logistic) │
│ 3. Prophet model learns patterns and generates forecast │
│ 4. Response contains two content items: │
│ ├── content[0]: Human-readable summary + data table │
│ └── content[1]: Chart.js JSON config for visualization │
└─────────────────────────────────────────────────────────────┘
The MCP tools/call response returns two content items:
### Prophet Forecast Data ###
Growth model used: LOGISTIC (cap=120, floor=30)
Summary of forecast metrics:
- Historical Period: 2025-02-01 to 2025-03-02
- Trend Direction: UPWARD (+26.1% vs historical mean)
Date | yhat | yhat_lower | yhat_upper
-------------------------------------
2025-03-03 | 79.56 | 76.93 | 81.98
...
chartjs_config:{"type":"line","data":{"labels":[...],"datasets":[...]},"options":{...}}
This is valid JSON prefixed with chartjs_config: — parse it as:
cfg_json = content[1]["text"][len("chartjs_config:"):]
config = json.loads(cfg_json)
forecast_time_series| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ds |
array[string] |
✅ Yes | — | List of dates in ISO format (YYYY-MM-DD) |
y |
array[number] |
✅ Yes | — | List of numeric values aligned with ds |
periods |
integer |
No | 10 |
Number of future periods to forecast |
growth |
string |
No | "linear" |
Growth model: "linear" or "logistic" |
cap |
number |
When logistic | — | Saturating maximum (forecast won't exceed this) |
floor |
number |
No | — | Saturating minimum (forecast won't go below this) |
freq |
string |
No | "D" |
Time series frequency: "D", "H", "W", "MS" |
| Scenario | Growth | Why |
|---|---|---|
| Revenue, temperature, stock prices | linear |
No natural ceiling or floor |
| Market share, adoption rate | logistic |
Saturates at 100% |
| Server capacity, team bandwidth | logistic |
Physical limits exist |
| Website conversion rate | logistic |
Bounded between 0–100% |
| Column | Meaning |
|---|---|
ds |
Date for the observed or predicted value |
yhat |
Predicted value (model's best estimate) |
yhat_lower |
Lower bound of confidence interval |
yhat_upper |
Upper bound of confidence interval |
Prophet_mcp/
├── app.py # Flask server — MCP endpoint, auth, JSON-RPC routing
├── mcp_helper.py # Core engine — Prophet forecasting, summary, Chart.js config
├── requirements.txt # Python dependencies
├── Procfile # Cloud deployment (gunicorn)
├── README.md # This file
├── .gitignore # Git exclusions
└── examples/ # Local testing utilities (not required for deployment)
├── plot_forecast.py # Basic forecast test with Chart.js visualization
└── test_gcp_marketing.py # Real-world marketing scenario (30-day conversions)
# Create environment
conda create -n prophet-mcp python=3.11
conda activate prophet-mcp
# Install dependencies
pip install -r requirements.txt
Windows Users: Prophet requires
CmdStan. If you encounter issues, refer to the Prophet Installation Guide or install via conda:conda install -c conda-forge prophet.
The server uses Bearer Token authentication. Set the MCP_TOKEN environment variable:
# Set your token (required)
export MCP_TOKEN="your-secure-token-here"
MCP_TOKEN="your-token" python app.py
gunicorn app:app
http://localhost:3000POST http://localhost:3000/mcpGET /health| Variable | Default | Description |
|---|---|---|
MCP_TOKEN |
(required) | Bearer token for authentication |
PORT |
3000 |
Server port |
MCP_DEBUG |
false |
Enable Flask debug mode |
All /mcp requests must include the header:
Authorization: Bearer <your-token>
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token>" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "forecast_time_series",
"arguments": {
"ds": ["2025-01-01","2025-01-02","2025-01-03","2025-01-04","2025-01-05",
"2025-01-06","2025-01-07","2025-01-08","2025-01-09","2025-01-10"],
"y": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
"periods": 5,
"growth": "logistic",
"cap": 25,
"floor": 5
}
},
"id": 1
}'
MCP_TOKEN="your-token" python examples/plot_forecast.py
MCP_TOKEN="your-token" python examples/test_gcp_marketing.py
Both scripts will:
content[1]For deploying to Google Cloud Run (or any cloud provider), you need:
app.py
mcp_helper.py
requirements.txt
Procfile
The examples/ folder is for local testing only and is not required in production.
The server binds to 0.0.0.0 and reads the PORT environment variable automatically for cloud compatibility.
/mcp endpointsMCP_TOKEN environment variable (no defaults — must be explicitly set)MCP_DEBUG=true)| Package | Purpose |
|---|---|
flask |
Web server framework |
pandas |
Data manipulation |
prophet |
Time-series forecasting engine |
gunicorn |
Production WSGI server |
requests |
HTTP client (examples only) |
MIT License
Contributions are welcome! Please feel free to submit a Pull Request.
Author: Pradeep Chandra Kalahasthi
Original Base: sendgrid-mcp
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"prophet-mcp-server": {
"command": "npx",
"args": []
}
}
}