> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quantspace.limex.pro/llms.txt
> Use this file to discover all available pages before exploring further.

# Jump Models Server

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

## Overview

The Jump Models Server fits JumpModel and SparseJumpModel regimes from tabular features and returns. It supports online state prediction, probability prediction, result/artifact chaining, and native strategy backtests from states or probabilities.

## Connection

Add this server to your MCP client configuration.

<Tabs>
  <Tab title="Cursor">
    ```json theme={null}
    {
      "mcpServers": {
        "jump-models": {
          "url": "https://mcp-production-11da.up.railway.app/mcp/jump-models"
        }
      }
    }
    ```
  </Tab>
</Tabs>

Restart the client after changing MCP configuration. The server tools appear automatically after the connection is established.

## Transport

| Property         | Value                                                        |
| ---------------- | ------------------------------------------------------------ |
| Protocol         | MCP over Streamable HTTP                                     |
| MCP URL          | `https://mcp-production-11da.up.railway.app/mcp/jump-models` |
| Health URL       | `https://mcp-production-11da.up.railway.app/health`          |
| MCP path         | `/mcp/jump-models`                                           |
| Request envelope | `{"request": {...}}`                                         |
| Auth             | Public endpoint; do not send an `Authorization` header       |

## Best-Fit Workflows

* Fit JumpModel or SparseJumpModel regimes from numeric feature matrices.
* Run online state prediction and state-probability prediction.
* Backtest regime state exposure into strategy rows and metrics.
* Chain CSV, table, result, and artifact outputs into model tools.
* Use the included Nasdaq-100 example data path.

## Recommended Tools

* get-data
* table\_dropna -> table\_to\_ndarray
* jump-model-create -> jump-model-fit -> jump-model-predict-online
* sparse-jump-model-create -> sparse-jump-model-fit -> sparse-jump-model-predict-online
* jump-model-backtest
* save\_tool\_result

## Tools

| Tool                                     | Description                                                                                                                                                        | Returns  |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- |
| `get-data`                               | Retrieve daily Nasdaq-100 closing price data from Yahoo Finance. Returns tabular rows with a stored `result_id` and saves the generated CSV as a runtime artifact. | `Any`    |
| `data-loader-load`                       | Load raw return data, compute features, and filter by `start_date` / `end_date`.                                                                                   | `Any`    |
| `jump-model-create`                      | Create a configured `JumpModel` instance and return a handle.                                                                                                      | `object` |
| `jump-model-fit`                         | Fit a `JumpModel` with coordinate descent. Accepts `X`, optional `ret_ser`, optional `feat_weights`, and `sort_by`.                                                | `Any`    |
| `jump-model-predict-online`              | Predict states online, where each row is predicted using only prior data.                                                                                          | `Any`    |
| `jump-model-predict-proba-online`        | Predict state probabilities online.                                                                                                                                | `Any`    |
| `jump-model-predict`                     | Predict states using all available data in `X`.                                                                                                                    | `Any`    |
| `jump-model-predict-proba`               | Predict state probabilities using all available data in `X`.                                                                                                       | `Any`    |
| `sparse-jump-model-create`               | Create a configured `SparseJumpModel` instance and return a handle.                                                                                                | `object` |
| `sparse-jump-model-fit`                  | Fit a sparse jump model with coordinate descent. Accepts `X`, optional `ret_ser`, and `sort_by`.                                                                   | `Any`    |
| `sparse-jump-model-predict-online`       | Predict sparse-model states online.                                                                                                                                | `Any`    |
| `sparse-jump-model-predict-proba-online` | Predict sparse-model state probabilities online.                                                                                                                   | `Any`    |
| `jump-model-backtest`                    | Backtest regime states or online predictions into strategy rows and metrics. Accepts inline rows, returns, states, `states_result_id`, or a model handle plus `X`. | `object` |
| `matplotlib-setting`                     | Set global Matplotlib rcParams for publication-quality figures.                                                                                                    | `Any`    |

## Examples

### Run a Simple State Backtest

```json theme={null}
{
  "request": {
    "rows": [
      {
        "timestamp": "2024-01-02",
        "ret": 0.01
      },
      {
        "timestamp": "2024-01-03",
        "ret": -0.02
      },
      {
        "timestamp": "2024-01-04",
        "ret": 0.005
      }
    ],
    "states": [
      0,
      1,
      0
    ],
    "state_exposure": {
      "0": 1.0,
      "1": 0.0
    },
    "transaction_cost_bps": 1.0
  }
}
```

### Create a JumpModel

```json theme={null}
{
  "request": {
    "init_kwargs": {
      "n_components": 2,
      "n_init": 3,
      "jump_penalty": 0.0
    }
  }
}
```

### Fit a Prepared Matrix

```json theme={null}
{
  "request": {
    "handle": "<handle-from-create>",
    "X": {
      "result_id": "<matrix-result-id>"
    },
    "ret_ser": {
      "result_id": "<return-vector-result-id>"
    },
    "sort_by": "cumret"
  }
}
```

## n8n Workflow

This server works well as an n8n regime-report workflow with a Schedule Trigger and an optional `POST` Webhook. n8n can fetch market data, build features, fit a model, resolve stored prediction outputs, and return or deliver a text/graph report.

Recommended n8n MCP chain:

1. Trigger on a schedule or webhook and set `tickers`, `start_date`, `end_date`, `jump_penalty`, `n_components`, and `n_init`.
2. Fetch market data through the Dataloader MCP endpoint, then call `result_get` if the extraction returns `result_id`.
3. Build numeric features in a Code node or with table helper tools.
4. Call `jump-model-create`, then `jump-model-fit` with `X`, `ret_ser`, and `sort_by: "cumret"`.
5. Call `jump-model-predict-proba-online` and `jump-model-predict`.
6. Resolve both prediction `result_id` values with `result_get`.
7. Format the final regime report in n8n and respond through the webhook or delivery nodes.

The hosted Jump Models endpoint is no-bearer. If you place a private gateway in front of it, configure auth through n8n Credentials instead of hard-coding headers.

See [n8n Workflows](/quantx/servers/deployed/n8n-workflows) for the shared webhook and MCP session patterns.

Available n8n template:

* [Regime Model JSON](/quantx/servers/deployed/workflows/jump-models-regime-model.json) - public regime-report webhook at `POST https://n8n.limex.pro/webhook/9f2988bf-7247-4c07-95c7-9e37188e93c9`. The template removes the scheduled email-delivery branch; add your own delivery nodes after import.

## Notes

* `table_to_ndarray` outputs can be passed directly to fit and predict tools as `X={"result_id":"<matrix_result_id>"}`.
* Use `table_dropna` or `table_impute` before `table_to_ndarray` when feature columns can contain blanks or nulls.
* `jump-model-backtest` is the native path for equity, strategy return, drawdown, Sharpe, and turnover metrics.
* The hosted endpoint is intentionally no-bearer; omit the `headers` block for this server.

<CardGroup cols={3}>
  <Card title="Client setup" icon="plug" href="/quantx/servers/deployed/client-setup">
    Configure this endpoint in Cursor, Claude Desktop, or a generic MCP client.
  </Card>

  <Card title="n8n workflows" icon="workflow" href="/quantx/servers/deployed/n8n-workflows">
    Build webhook and scheduled regime-report flows around this MCP endpoint.
  </Card>

  <Card title="Shared tools" icon="wrench" href="/quantx/servers/deployed/shared-tools">
    Use health, result, artifact, environment, and table helper tools.
  </Card>
</CardGroup>

## Other Servers

<CardGroup cols={3}>
  <Card title="Dataloader" icon="server" href="/quantx/servers/dataloader">
    Market-data retrieval, TA-Lib indicators, and dataframe exports.
  </Card>

  <Card title="Fama-French Replicate" icon="server" href="/quantx/servers/fama-french-replicate">
    Official and replicated Fama-French factors plus loadings and alpha estimation.
  </Card>

  <Card title="Statistical Factor Models" icon="server" href="/quantx/servers/statistical-factor-models">
    Stock-Watson, complete-panel, and dynamic statistical factor extraction.
  </Card>

  <Card title="Wavelet Mean Reversion" icon="server" href="/quantx/servers/wavelet-mean-reversion">
    Wavelet-based mean reversion analysis for financial time series.
  </Card>

  <Card title="Parallax ExtremeHurst" icon="server" href="/quantx/servers/parallax-extreme-hurst">
    ExtremeHurst signal generation from OHLCV data.
  </Card>

  <Card title="EP Ratio Screener" icon="server" href="/quantx/servers/ep-ratio-screener">
    Fundamental stock screening based on earnings yield and balance-sheet quality.
  </Card>

  <Card title="Volatility Scaling Lab" icon="server" href="/quantx/servers/volatility-scaling-lab">
    Volatility targeting, EWMA volatility, Monte Carlo bands, and risk diagnostics.
  </Card>
</CardGroup>
