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

# Introduction

> Deterministic quant tools for AI trading agents:via MCP

QuantContext is an [MCP](https://modelcontextprotocol.io/) server that gives AI agents deterministic quant computation: stock screening, strategy backtesting, and factor analysis. Works with Claude, Codex, Opencode, and any MCP-compatible agent.

Every number is **computed from real market data**, not generated by an LLM. Same input, same output.

## Why this exists

LLMs hallucinate numbers. QuantContext enforces a strict boundary:

* **LLM layer**:decides *what* to compute, selects parameters, explains results
* **QuantContext layer**:executes deterministic Python computation, returns structured JSON
* **Data layer**:yfinance (prices + fundamentals), Kenneth French (Fama-French factors)

The LLM never touches a number. Python computes everything.

## The three tools

<CardGroup cols={3}>
  <Card title="screen_stocks" icon="filter" href="/docs/tools/screen-stocks">
    Screen a stock universe by fundamental, momentum, value, quality, technical, or multi-factor criteria. Returns ranked candidates.
  </Card>

  <Card title="backtest_strategy" icon="chart-line" href="/docs/tools/backtest-strategy">
    Test a strategy historically with a rebalance-loop engine. Returns equity curve, trade log, and performance metrics (CAGR, Sharpe, max drawdown).
  </Card>

  <Card title="factor_analysis" icon="magnifying-glass-chart" href="/docs/tools/factor-analysis">
    Decompose strategy returns into Fama-French factors (market, size, value, momentum). Returns alpha with t-statistic and factor loadings.
  </Card>
</CardGroup>

## Tools compose naturally

```
screen_stocks → backtest_strategy → factor_analysis
```

Screen candidates, backtest over time, decompose returns to understand where alpha comes from.

## No API keys required

Public data only: Yahoo Finance (via yfinance) and the Kenneth French Data Library. No account, no keys, no quotas.
