Skip to main content

Overview

The Volatility Scaling Lab Server supports volatility-scaling research workflows: EWMA volatility estimation, volatility-targeting data preparation, Monte Carlo band analysis, and performance/risk diagnostics.

Connection

Add this server to your MCP client configuration.
{
  "mcpServers": {
    "volatility-scaling-lab": {
      "url": "https://volatility-scaling-lab-production.up.railway.app/mcp/qca-open-loop-volatility"
    }
  }
}
Restart the client after changing MCP configuration. The server tools appear automatically after the connection is established.

Transport

PropertyValue
ProtocolMCP over Streamable HTTP
MCP URLhttps://volatility-scaling-lab-production.up.railway.app/mcp/qca-open-loop-volatility
Health URLhttps://volatility-scaling-lab-production.up.railway.app/health
MCP path/mcp/qca-open-loop-volatility
Request envelope{"request": {...}}
AuthOptional bearer token when enabled for the endpoint

Best-Fit Workflows

  • Load market and risk-free data for a ticker/date range.
  • Compute EWMA volatility from returns or from ticker/date input.
  • Analyze Monte Carlo percentiles and band widths.
  • Compare a strategy volatility path against Monte Carlo confidence bands.
  • Compute return, volatility, Sharpe, drawdown, and tracking-error metrics.
  • compute-ewma-volatility-series
  • load-and-prepare-data
  • analyze-monte-carlo-results
  • compare-strategy-to-monte-carlo
  • compute-annualized-return
  • compute-annualized-volatility
  • compute-sharpe-ratio

Tools

ToolDescriptionReturns
dual-ewmaestimator-updateUpdates the dual exponential weighted moving average (EWMA) estimator for volatility calculations using risky and index return values. Params: r_risky: float (risky asset return), r_index: float (index return)Any
ewmavolatility-estimator-updateUpdates an EWMA volatility estimator with a new return value, computing the exponentially weighted moving average volatility. Params: return_value (float): the latest return value to incorporate into the volatility estimateAny
ewmavolatility-estimator-resetResets the EWMA volatility estimator to its initial state, clearing any accumulated data and starting fresh. Params: noneAny
ewmavolatility-estimator-get-current-volatilityRetrieves the current EWMA volatility estimate from the volatility estimator. Params: No parameters.Any
dual-ewmaestimator-resetResets the internal state of the DualEWMAEstimator volatility estimator. Params: noneAny
dual-ewmaestimator-get-current-volatilitiesReturns the current volatility estimates calculated by the DualEWMA estimator. Params: noneAny
compute-volatility-tracking-errorComputes annualized volatility tracking error by measuring the mean absolute difference between daily volatility estimates and a target volatility, scaled by the square root of trading periods per year. Params: sigma_hat_index (np.ndarray): daily volatility estimates; sigma_target (float): target daily volatility; periods_per_year (int, default=252): trading days per yearfloat
compute-annualized-returnCalculates annualized return from daily returns using either arithmetic mean or geometric (CAGR) method. Params: Inputs: returns (np.ndarray of daily returns), periods_per_year (int, default 252 trading days), method (‘arithmetic’ or ‘geometric’)float
compute-annualized-volatilityCompute annualized volatility from daily returns. Takes an array of daily returns and returns a single float representing the annualized volatility, scaled by the number of trading days per year. Params: returns: np.ndarray (daily returns), periods_per_year: int (default=252)float
compute-sharpe-ratioComputes the Sharpe ratio from daily returns by annualizing return and volatility. Returns a float ratio without risk-free rate subtraction. Params: returns (np.ndarray): daily returns array; periods_per_year (int, default=252): trading days per yearfloat
compute-maximum-drawdownComputes the maximum drawdown of a cumulative return series, returning the largest peak-to-trough decline as a positive percentage (e.g., 0.55 for 55% drawdown). Params: cumulative_returns: np.ndarray - cumulative return series starting at 1.0 (e.g., np.array([1.0, 1.05, 0.98]))float
metrics-to-dataframeConverts a dictionary of strategy metrics into a comparison DataFrame, organizing strategies as rows and metrics as columns. Params: metrics_dict: Dictionary mapping strategy names to their metrics (e.g., {‘Strategy A’: {‘Sharpe Ratio’: 1.2, ‘Volatility’: 0.05}})pd.DataFrame
load-and-prepare-dataLoads and prepares financial data for backtesting, including asset prices and risk-free rates, aligned to a trading calendar and transformed into returns. Params: start_date (str, default ‘2000-06-06’), end_date (strNone, defaults to today when omitted), cash_rate_convention (str, default ‘calendar_day’), ticker (str, default ‘IVV’)pd.DataFrame
compute-ewma-volatility-seriesCompute the EWMA volatility series for returns. Accepts direct returns, tabular/stored payloads with return_column, or ticker + date range to load data inside the tool. Params: halflife (default 126), annualize (default true), periods_per_year (default 252).pd.DataFrame
analyze-monte-carlo-resultsAnalyze Monte Carlo simulation results to compute summary statistics including final, steady-state, and early-period percentiles and band widths. Params: df: pd.DataFrame - simulation results (required)Dict[str, float]
compare-strategy-to-monte-carloCompares a strategy’s running annualized volatility to Monte Carlo confidence bands and returns key statistics. Params: strategy_sigma_hat_ann: np.ndarray of strategy’s volatility estimates; mc_df: pd.DataFrame with p10, p50, p90 columnsDict[str, float]
plot-cumulative-returnsGenerates a line plot comparing cumulative returns across multiple trading strategies over time. Saves the figure if a path is provided. Params: Inputs: results_dict (dict of strategy name to DataFrame), save_path (optional save location), title (plot title, default: ‘Cumulative Returns Comparison’)None
plot-weightsPlots strategy weights over time from a DataFrame, showing risky and cash allocations with optional title and saving capability. Params: Inputs: results_df (pd.DataFrame with ‘w’ and ‘c’ columns), strategy_name (optional title), save_path (optional save location)None
plot-controller-statesGenerates a plot showing controller states (kappa) over time from a results DataFrame, with optional leverage controller visualization. Params: results_df (pd.DataFrame): DataFrame containing ‘kappa’ and optional ‘kappa_lev’ columns; strategy_name (str): Strategy name for plot title; save_path (Optional[str]): Path to save the figureNone
plot-drawdownGenerates a drawdown plot comparing multiple trading strategies over time, showing percentage drawdowns from running maximums. Params: Inputs: results_dict (dict of strategy names to DataFrames with ‘R_index’ column), save_path (optional path to save figure), title (plot title, default ‘Drawdown Comparison’)None
create-metrics-table-markdownGenerates a markdown table summarizing performance metrics for different strategies and saves it to a file. Params: metrics_dict: Dict[str, Dict[str, float]] - strategy metrics (e.g., {‘Strategy A’: {‘Sharpe Ratio’: 1.2, ‘Win Rate’: 0.65}}); filename: str - output path (default: ‘results/metrics_table.md’)None

Examples

Compute EWMA volatility from market data

{
  "request": {
    "ticker": "SPY",
    "start_date": "2020-01-01",
    "halflife": 252,
    "annualize": true
  }
}

Load aligned market and cash-rate data

{
  "request": {
    "ticker": "SPY",
    "start_date": "2020-01-01",
    "cash_rate_convention": "calendar_day"
  }
}

Analyze Monte Carlo output

{
  "request": {
    "df": {
      "rows": [
        {
          "step": 1,
          "p10": 0.1,
          "p50": 0.15,
          "p90": 0.2,
          "target": 0.15
        },
        {
          "step": 2,
          "p10": 0.11,
          "p50": 0.15,
          "p90": 0.19,
          "target": 0.15
        }
      ]
    }
  }
}

Notes

  • compute-ewma-volatility-series is the preferred one-step tool for requests that start from a ticker and date range.
  • When end_date is omitted, data-loading tools use the current date on the server.
  • Large tabular outputs can be returned as result handles.

Client setup

Configure this endpoint in Cursor, Claude Desktop, or a generic MCP client.

Shared tools

Use health, result, artifact, environment, and table helper tools.

Other Servers

Dataloader

Market-data retrieval, TA-Lib indicators, and dataframe exports.

Fama-French Replicate

Official and replicated Fama-French factors plus loadings and alpha estimation.

Statistical Factor Models

Stock-Watson, complete-panel, and dynamic statistical factor extraction.

Jump Models

JumpModel and SparseJumpModel regime fitting, online prediction, and backtesting.

Wavelet Mean Reversion

Wavelet-based mean reversion analysis for financial time series.

Parallax ExtremeHurst

ExtremeHurst signal generation from OHLCV data.

EP Ratio Screener

Fundamental stock screening based on earnings yield and balance-sheet quality.