# alforge-labs/alpha-forge-mcp [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/alforge-labs/alpha-forge-mcp  
**GitHub Stars:** 1  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/alforge-labs-alpha-forge-mcp

## Description
AlphaForge quant CLI as an MCP server — backtest, optimize (Optuna TPE), and walk-forward-test trading strategies from Claude Desktop, Cursor, or Claude Code. Local-first, anti-overfitting. uvx alpha-forge-mcp

## Tools
Capabilities this server exposes over MCP:

- **list_strategies** — List registered strategies
- **get_strategy** — Full JSON of one strategy
- **list_results** — List saved backtest results
- **get_result** — Metrics of one result (heavy arrays folded into counts by default; `summary=false` for full)
- **run_backtest** — Run a backtest (`summary=true` by default omits heavy arrays)
- **run_optimize** — Optimize parameters (Optuna)
- **apply_optimization** — Apply an optimization result file to a strategy
- **run_walk_forward** — Walk-forward (out-of-sample) optimization
- **run_monte_carlo** — Monte Carlo from a saved result
- **fetch_data** — Fetch & cache historical OHLCV (prereq for `run_backtest`)
- **save_strategy** — Register a strategy from its JSON **body
- **generate_pinescript** — Generate Pine Script v6 source
- **forge_status** — Report capabilities/prerequisites (doctor + version)
- **list_journals** — List strategies that have a journal
- **get_journal** — Full journal (snapshots, runs, tags, notes) of one strategy
- **exploration_status** — Strategy-exploration coverage map (explored vs. untried)
- **get_indicator** — Metadata for one technical indicator

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "alpha-forge-mcp": {
    "command": "uvx",
    "args": ["alpha-forge-mcp"]
  }
}
```

## Documentation

## What alforge-labs/alpha-forge-mcp MCP server does

The alforge-labs/alpha-forge-mcp MCP server connects MCP-capable AI clients to the AlphaForge `alpha-forge` command-line application. It is an open-source wrapper rather than an independent trading or research engine: the underlying binary performs the quant operations, while the MCP layer launches commands, parses JSON output, and returns structured results.

The server supports a strategy workflow from data preparation through validation and export. Agents can register and inspect JSON strategies, fetch cached historical OHLCV data, run backtests, optimize parameters with Optuna, perform out-of-sample walk-forward optimization, apply saved optimization results, run Monte Carlo simulations, and generate Pine Script v6 source for TradingView.

## How it works

Communication uses MCP over stdio. Most operations map directly to an `alpha-forge` command with JSON output. Read operations retrieve strategies, results, journals, exploration status, system information, or indicator metadata. Write and execution operations invoke the corresponding CLI action and return an object containing success status, data, and an error field.

A typical sequence starts with `forge_status` to check prerequisites, followed by `fetch_data` for the requested symbol. The agent can then call `run_backtest`, `run_optimize`, and `run_walk_forward`, apply a saved optimization result, and pass the resulting strategy to `generate_pinescript`. Backtest and result responses summarize large arrays by default; callers can request full result data where supported.

Long-running operations execute outside the event loop and advertise progress notifications to clients that support them. Backtests have a timeout of up to 300 seconds, while optimization and walk-forward jobs can run for up to 600 seconds. Timeout responses use a retryable error category.

## Setup and configuration

Install and launch the MCP package with `uvx alpha-forge-mcp`, then configure it as a stdio MCP server in the chosen client. The alpha-forge executable must also be installed and accessible, and its valid license is required for actual operations. The wrapper itself does not contain AlphaForge's core functionality.

Run `forge_status` before other actions to determine whether the binary is present and inspect reported prerequisites. If authentication is required, the returned error information directs the operator toward the AlphaForge authentication command.

## Tools and capabilities

The alforge-labs/alpha-forge-mcp MCP server exposes tools for:

- Listing and retrieving strategies, saved results, journals, and technical-indicator metadata.
- Saving a strategy from an inline JSON body rather than a file path.
- Fetching and caching historical OHLCV data.
- Running backtests, Optuna TPE parameter optimization, walk-forward optimization, and Monte Carlo simulations.
- Applying a saved optimization file to create an optimized strategy.
- Generating Pine Script v6, optionally with webhook output.
- Checking AlphaForge capabilities and tracking explored versus untried strategy coverage.

Optimization metrics are constrained to supported objectives such as Sharpe ratio, Sortino ratio, Calmar ratio, total return, CAGR, profit factor, win rate, expectancy, and Omega ratio. Optimization saves its result by default, allowing the returned path to be supplied to `apply_optimization`.

## Limitations and notes

The alforge-labs/alpha-forge-mcp MCP server does not calculate indicators over price data; `get_indicator` returns metadata only.

`fetch_data` accepts a period but does not expose start and end dates because the underlying CLI lacks those options. `save_strategy` expects a JSON definition body, while `apply_optimization` expects a result-file path. The commercial, closed-source AlphaForge binary and a valid license remain mandatory. Errors are returned inside the normal tool result, including categories such as missing binary, authentication required, premium feature restriction, missing strategy, timeout, malformed output, and execution failure.

_Full upstream README: https://allmcps.com/mcp/alforge-labs-alpha-forge-mcp/readme_

