Skip to main content
Glama
alforge-labs

alpha-forge-mcp

Official

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
ALPHA_FORGE_BINNoPath to the alpha-forge binary. If not set, the binary is searched on PATH or in default install locations.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_strategiesA

List all registered AlphaForge strategies (strategy_id, name, version, timeframe).

get_strategyA

Get the full JSON definition of a registered strategy by its strategy_id.

list_resultsA

List saved backtest results, optionally filtered by strategy_id.

get_resultA

Get metrics and trades for a saved backtest result (result_id = strategy_id or run_id).

run_backtestA

Run a backtest for symbol with a registered strategy. Optional dates are YYYY-MM-DD.

Prerequisite: call `fetch_data` for the symbol first so the OHLCV cache exists.
Long-running: up to a 300-second timeout; reports progress to capable clients.
run_optimizeA

Optimize strategy parameters with Optuna for symbol. metric defaults to sharpe_ratio.

save defaults to true so the result JSON is persisted (with `saved_path` in the
response) and can be fed to `apply_optimization`; pass save=false to skip saving.
Long-running: up to a 600-second timeout; reports progress to capable clients.
generate_pinescriptB

Generate TradingView Pine Script v6 for a strategy. Returns {strategy_id, pinescript}.

run_walk_forwardA

Run walk-forward optimization for symbol (out-of-sample robustness check).

windows defaults to 5, metric to sharpe_ratio. Run it after run_optimize to compare
in-sample vs out-of-sample behaviour (the optimize_and_verify workflow).
Long-running: up to a 600-second timeout; reports progress to capable clients.
run_monte_carloA

Run a Monte Carlo simulation from a saved backtest result (resamples its trades).

Prerequisite: a saved result (run_backtest/run_optimize with save) — result_id =
strategy_id or run_id. simulations defaults to 1000. Returns ruin probability, equity
percentiles, and drawdown distribution for risk assessment.
Long-running: reports progress to capable clients; has an execution timeout.
fetch_dataA

Fetch & cache historical OHLCV for symbol (prerequisite for run_backtest).

period is e.g. 1y / 5y / 6m / 30d / max (defaults to 1y). Returns {symbol, period,
output}. The CLI has no --start/--end, so only period is exposed. Run this before
run_backtest. Reports progress to capable clients; has an execution timeout.
save_strategyA

Register a strategy from its JSON body (not a file path; agent-friendly).

Pass the full strategy-definition JSON as a string; it is validated as a JSON object
and written to a temp file before `strategy save`. Returns {output}. A registered
strategy is the prerequisite for run_backtest/run_optimize. Reports progress to
capable clients; has an execution timeout.
forge_statusA

Report alpha-forge capabilities/prerequisites before use (doctor + version).

Read-only triage: returns {binary_found, version, authenticated, plan, doctor, error}.
Never fails when the binary is missing — returns binary_found=false instead.
apply_optimizationA

Apply an optimization result file to a strategy, saving <strategy_id>_optimized.

Prerequisite: run_optimize(save=true) — result_file is its `saved_path`. Runs
non-interactively (--yes). Returns {result_file, strategy_id, output}. Follow up by
generating Pine Script for `<strategy_id>_optimized`. Reports progress to capable
clients; has an execution timeout.
list_journalsA

List strategies that have a journal (history of snapshots and runs).

get_journalA

Get the full journal (snapshots, runs, tags, notes) for a strategy_id.

exploration_statusA

Show the strategy-exploration coverage map (explored vs. untried combos).

Optional `goal` filters by exploration goal; defaults to the "default" goal.
get_indicatorA

Get metadata for a technical indicator (description, parameters, output, example).

`indicator` is the indicator name (e.g. RSI, MACD). This is metadata only — the CLI
has no compute-over-symbol command — so it does not run a calculation on price data.

Prompts

Interactive templates invoked by user choice

NameDescription
backtest_and_reviewGuide: run a backtest for a strategy/symbol, then review the metrics.
optimize_and_verifyGuide: optimize a strategy with Optuna, then check it is not overfit.

Resources

Contextual data attached and managed by the client

NameDescription
resource_strategiesAll registered strategies (same payload as the list_strategies tool).
resource_resultsAll saved backtest results (same payload as the list_results tool).

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alforge-labs/alpha-forge-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server