ReverseFCFFMCP
by sathanandhh
README.md
# ReverseFCFFMCP
A specialized Model Context Protocol (MCP) server for running **Reverse DCF / FCFF Valuations**.
Instead of asking "What is the value given my assumptions?", this engine asks:
**"Given a target value (e.g., $2T), what combination of growth, margins, reinvestment, and market share must be true?"**
## Features
- **Three Reinvestment Methods**: Sales-to-Capital, ROIC-based, and Explicit.
- **Discounting Conventions**: Mid-year (Damodaran default) and End-year.
- **Terminal Value Consistency**: Enforces terminal reinvestment rate = g / ROIC.
- **Reverse Solvers**: Root-finding (`brentq`) to solve for Margin, Growth, Sales-to-Capital, or ROIC to hit a target Enterprise Value.
- **AI Market Layer**: Translate terminal revenue into required AI market share or required industry size.
- **Governance Layer**: Input sanitization, math guardrails (e.g., preventing WACC ≤ Terminal Growth singularities), and automated evals.
---
## Available MCP Tools
This server exposes the following tools to the MCP client:
### 1. `forward_dcf`
Runs a standard forward Discounted Cash Flow valuation.
- **Inputs**: `current_revenue`, `revenue_cagr`, `ebit_margin`, `wacc`, `terminal_growth`, `forecast_years`, `net_cash`, `reinvestment_method`, `sales_to_capital` / `roic`, etc.
- **Output**: JSON containing projected Revenues, EBITs, NOPATs, Reinvestments, FCFFs, Discount Factors, Present Values, Terminal Value, Enterprise Value, and Equity Value.
### 2. `reverse_solve_margin`
Solves for the exact EBIT margin required to achieve a target Enterprise Value, given fixed assumptions for growth and reinvestment.
- **Inputs**: `target_ev`, `fixed` (a dictionary of the remaining DCF assumptions).
- **Output**: `ebit_margin` (float) and `converged` (boolean).
### 3. `reverse_solve_growth`
Solves for the exact Revenue CAGR required to achieve a target Enterprise Value, given fixed assumptions for margin and reinvestment.
- **Inputs**: `target_ev`, `fixed` (a dictionary of the remaining DCF assumptions).
- **Output**: `revenue_cagr` (float) and `converged` (boolean).
### 4. `validate_damodaran_consistency`
Runs structural validation checks on a set of DCF inputs to catch common modeling errors.
- **Inputs**: A full `DCFInput` object.
- **Output**: A list of warning objects detailing any violated rules (e.g., `wacc_le_terminal_growth`, `terminal_growth_ceiling`, `fundamental_growth_ceiling`).
### 5. `feasibility_grid`
Performs a grid search across combinations of growth, margin, and sales-to-capital to determine which combinations successfully hit a target EV within a specified tolerance.
- **Inputs**: `target_ev`, `fixed` (base assumptions), `param_grid` (dictionary of arrays to test), `tolerance`.
- **Output**: A list of dictionaries representing each scenario, its resulting EV, and a `feasible` boolean flag.
### 6. `run_evals`
Runs automated governance evaluations to verify the engine's mathematical integrity.
- **Inputs**: None.
- **Output**: JSON verifying if the reverse-solver round-trips accurately and if the hard guardrails successfully block invalid inputs.
---
## Claude Desktop Integration (Local stdio)
To use this MCP server locally with Claude Desktop, you must have the `uv` package manager installed (`pip install uv`).
1. Open Claude Desktop and navigate to **Settings > Developer > Edit Config**.
2. This will open your `claude_desktop_config.json` file.
3. Add the `reverse-fcff-mcp` configuration to your `mcpServers` object. It should look like this:
```json
{
"mcpServers": {
"reverse-fcff-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/YOUR_USERNAME/reverse-fcff-mcp.git",
"python",
"-m",
"reverse_fcff_mcp.server"
]
}
}
}This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo issues