# pineforge-4pass/pineforge-codegen-mcp [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/pineforge-4pass/pineforge-codegen-mcp  
**GitHub Stars:** 7  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/pineforge-4pass-pineforge-codegen-mcp

## Description
Backtest PineScript v6 strategies locally: transpiles Pine→C++ and runs on the deterministic, TradingView-validated PineForge engine (245/246 strict parity, no API key).

## Tools
Capabilities this server exposes over MCP:

- **transpile_pine** — Pine v6 → C++ translation unit (transpile-only)
- **list_engine_params** — Catalog of every `overrides` + `runtime` knob accepted by the backtests
- **backtest_pine** — Single backtest of a Pine source against an OHLCV CSV
- **backtest_pine_grid** — Cartesian sweep of `inputs` × `overrides` reusing one compile
- **fetch_binance_ohlcv** — Write a backtest-ready CSV from Binance spot or USDT-perp klines
- **binance_symbols** — List / filter Binance symbols (5-min in-process cache)
- **list_coverage_topics** — Every Pine v6 coverage topic with a one-line status + summary
- **check_pine_feature** — Look up whether a Pine identifier/namespace is supported in PineForge
- **get_coverage_topic** — Full detail + supported/unsupported feature lists for one coverage topic
- **engine_info** — Report the bundled engine: mode, baked-in flag, version

## Claude Desktop Quick Installation
Remote MCP endpoint (confidence: high). Install path detected from listing signals. Add as a URL/SSE server in your client:

```json
"mcpServers": {
  "pineforge-codegen-mcp": {
    "url": "https://mcp.pineforge.dev/mcp"
  }
}
```

## Documentation

## What pineforge-4pass/pineforge-codegen-mcp MCP server does

The pineforge-4pass/pineforge-codegen-mcp MCP server gives an AI agent local tools for working with Pine Script v6 strategies. It can translate Pine source into a C++ translation unit, execute a strategy against OHLCV data, and return the engine's backtest results. The backtest workflow is intended for historical evaluation of a supplied strategy and data file; it is not a forecasting or investment-advice tool.

The bundled PineForge engine runs the translation and backtest in-process inside the container. The project describes the engine as deterministic and reports strict TradingView parity for 245 of 246 reference strategies, with the remaining discrepancy attributed to a TradingView-side margin-boundary behavior.

## How it works

A typical request supplies Pine v6 source and a path to an OHLCV CSV under the mounted `/work` directory. `backtest_pine` performs one run. `backtest_pine_grid` varies Pine input values and engine overrides while reusing one compilation, which is useful for parameter exploration. The returned schema includes a summary and applied settings, along with the engine identifier.

The server can also obtain Binance spot or USDT-perpetual klines and write them as backtest-ready CSV data. `binance_symbols` lists or filters available Binance symbols and keeps results in an in-process cache for five minutes. Network access is needed for these Binance tools; local backtests can use supplied files instead.

## Setup and configuration

Run the container through stdio with Docker:

```bash
docker run --rm -i -v "$PWD:/work" ghcr.io/pineforge-4pass/pineforge-backtest-mcp:latest
```

The `-i` option is required for the MCP JSON-RPC stream, while a TTY should not be added. Mounting the working directory lets the server read input CSVs and write fetched data. Docker is the only stated runtime requirement, and the container includes the transpiler and engine, so a host Docker daemon is not needed by the engine itself. No API key is required. Binance fetching additionally requires outbound network access.

The README shows configuration examples for Claude Desktop and Cursor using the Docker command. It also documents a hosted Streamable HTTP endpoint, but that service is separate from the local repository and has metering and fixed-data limitations.

## Tools and capabilities

The pineforge-4pass/pineforge-codegen-mcp MCP server exposes these capabilities:

- Translate Pine v6 source without running a backtest.
- Run one backtest against an OHLCV CSV.
- Sweep `inputs` and `overrides` combinations with one compile.
- Fetch Binance spot or USDT-perpetual OHLCV data.
- List and filter Binance symbols.
- Inspect engine parameters before composing a request.
- Check Pine identifier and namespace support.
- Browse coverage topics and detailed supported or unsupported features.
- Report the bundled engine mode, version, and baked-in status.

Engine controls include strategy fields such as initial capital, pyramiding, slippage, commission settings, quantity defaults, order processing, and close-entry behavior. Runtime options include input and script timeframes, bar magnification, sample count, and magnifier distribution. A script timeframe finer than the input timeframe is rejected with a structured error.

## Limitations and notes

The implementation targets Pine Script v6 and runs locally in the supplied container. Results depend on the strategy source and historical OHLCV data, including modeling choices such as commissions, slippage, order processing, and bar magnification. A backtest describes past behavior and does not establish future returns.

The local repository is described as unmetered and able to run with user-provided CSVs. Binance tools are the exception to fully offline operation because they call Binance's public API. Pine coverage is not universal, so agents should use the coverage lookup tools before relying on an identifier or namespace.

_Full upstream README: https://allmcps.com/mcp/pineforge-4pass-pineforge-codegen-mcp/readme_

