forecasting-calculator-mcp

promptadvisers/forecasting-calculator-mcp

3.2

If you are the rightful owner of forecasting-calculator-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Forecasting Calculator MCP Server is a sophisticated tool designed to provide multiple statistical forecasting methods for time series data.

Forecasting Calculator MCP Server

A sophisticated Model Context Protocol (MCP) server that provides multiple statistical forecasting methods for time series data.

Features

  • Multiple Forecasting Methods:

    • Linear Regression - For steady trends
    • Moving Average - For smoothing fluctuations
    • Exponential Smoothing - For recent-weighted predictions
    • Polynomial Regression - For non-linear patterns
    • Simple ARIMA - For autocorrelated data
  • Interactive Usage: Ask for forecasts with natural language

  • Mathematical Explanations: Get detailed breakdowns of calculations

  • Flexible Input: Accepts arrays or space/comma-separated numbers

  • Configurable Periods: Forecast 1-100 periods into the future

Installation

  1. Create and activate virtual environment:
cd forecasting-calculator-mcp
python3 -m venv mcp_venv
source mcp_venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Make scripts executable:
chmod +x forecasting_calculator_server.py
chmod +x run_forecasting_calculator.sh

Testing

Test the server directly:

# Test initialization
echo '{"jsonrpc": "2.0", "method": "initialize", "params": {"protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": {"name": "test", "version": "1.0"}}, "id": 1}' | python forecasting_calculator_server.py

# Test tool listing
echo '{"jsonrpc": "2.0", "method": "tools/list", "params": {}, "id": 2}' | python forecasting_calculator_server.py

Claude Desktop Configuration

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "forecasting-calculator": {
      "command": "/path/to/your/forecasting-calculator-mcp/run_forecasting_calculator.sh",
      "args": [],
      "env": {}
    }
  }
}

Note: Replace /path/to/your/ with the actual path where you installed the server.

Usage Examples

In Claude Desktop:

  1. Simple Linear Forecast:

    • "Forecast [300, 400, 500] for 3 periods using linear regression"
  2. Revenue Projection:

    • "My revenue was 1000, 1200, 1400, 1650. Forecast next 6 months with exponential smoothing"
  3. Understand Methods:

    • "Explain the forecasting methods available"

Methods Overview

MethodBest ForUse Case
LinearSteady trendsConsistent growth/decline
Moving AverageNoisy dataSmoothing volatility
Exponential SmoothingRecent trendsFast-changing conditions
PolynomialCurvesAcceleration/deceleration
Simple ARIMATime dependenciesAutocorrelated series

Troubleshooting

IssueSolution
No module named 'mcp'Activate virtual environment
spawn python ENOENTUse python3 in wrapper script
Server not showing in ClaudeRestart Claude Desktop
Import errorsInstall all requirements with pip

Technical Details

  • Uses standard MCP SDK (not FastMCP)
  • Includes ServerCapabilities in initialization
  • Safe mathematical operations with NumPy
  • Comprehensive error handling
  • Virtual environment isolation

License

MIT