Skip to main content
Glama
README.md
# Startup Valuation Engine

<!-- mcp-name: com.ascent-partners/startup-valuation -->

> **A comprehensive startup valuation library** implementing 80+ formulas from the *Startup Valuation* textbook — Python library, MCP server, and AI-agent skills.

[![CI](https://github.com/simonmak-ascent/startup-valuation/actions/workflows/ci.yml/badge.svg)](https://github.com/simonmak-ascent/startup-valuation/actions/workflows/ci.yml)
[![MCP Registry](https://img.shields.io/badge/MCP%20Registry-com.ascent-partners%2Fstartup-valuation-4CAF50)](https://registry.modelcontextprotocol.io/v0/servers?search=com.ascent-partners/startup-valuation)
[![Glama](https://glama.ai/mcp/connectors/com.ascent-partners/startup-valuation/badges/score.svg)](https://glama.ai/mcp/connectors/com.ascent-partners/startup-valuation)
[![MCP tools](https://img.shields.io/badge/MCP-14%20tools-4CAF50)](https://startup-valuation.ascent-partners.com/mcp)
[![PyPI](https://img.shields.io/pypi/v/startup-valuation.svg)](https://pypi.org/project/startup-valuation/)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![Coverage](https://img.shields.io/badge/coverage-88%25-brightgreen)](https://github.com/simonmak-ascent/startup-valuation/actions/workflows/ci.yml)
[![Docs](https://img.shields.io/badge/docs-live-blue)](https://startup-valuation.ascent-partners.com/docs)
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/simonmak-ascent/startup-valuation/badge)](https://scorecard.dev/viewer/?uri=github.com/simonmak-ascent/startup-valuation)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Overview

A production-grade Python library for startup valuation, implementing every formula from the **[Startup Valuation](https://www.amazon.com/Startup-Valuation-Comprehensive-Fast-Growing-Pre-Revenue-ebook/dp/B0FYTGNVWS/)** textbook by Simon Mak (Valuation in Practice Series, Ascent Partners). Designed for developers, financial analysts, and AI agents who need auditable, structured valuation computations.

**Three-layer architecture:**

```mermaid
graph TB
    subgraph Library["Python Library"]
        MOD["14 Modules<br/>80+ Functions"] --> VR["ValuationResult"]
    end
    subgraph MCP["MCP Server"]
        VR --> SVR["FastMCP Server<br/>14 Tools"]
    end
    subgraph Skills["AI-agent skills"]
        SVR --> CORE["Core"]
        SVR --> ADV["Advanced"]
        SVR --> IND["Industry"]
        SVR --> STAKE["Stakeholder"]
        SVR --> EMER["Emerging"]
    end
    style Library fill:#0083AB,color:#fff
    style MCP fill:#4CAF50,color:#fff
    style Skills fill:#9C27B0,color:#fff
```

1. **Python Library** — 15 modules, 80+ typed functions, all returning `ValuationResult` (value + assumptions + sensitivity)
2. **MCP Server** — 14 folded tools (80+ formulas) for AI agents via stdio and hosted Streamable HTTP
3. **AI-agent skills** — 6 skill definitions with workflow guidance for valuation domains

## The deployed platform

The library ships with a web application at **<https://startup-valuation.ascent-partners.com>**:

| | |
|---|---|
| calculators | 14 interactive methods; every figure arrives with its formula, inputs, assumptions and steps |
| comparables | live multiples from Yahoo Finance, with the sample size each median rests on (`n=`) |
| documentation | <https://startup-valuation.ascent-partners.com/docs> — built from `docs/` into the image, so it ships with the app |
| languages | English at `/`, 简体中文 at `/zh`, 繁體中文 at `/hk` — the whole chrome, not only the copy |
| MCP | Streamable HTTP at `/mcp` (14 tools); a bare `GET` answers 405 by design |

There are **no accounts and no database**: nothing is stored, and the only external dependency is the
market-data source, which `/api/health` reports.

## Installation

```bash
pip install startup-valuation          # library only
pip install startup-valuation[mcp]     # + MCP server
pip install startup-valuation[dev]     # + pytest, ruff, mypy
```

## Quick Start (≤ 5 minutes)

**Fastest path:** one line — `pip install "startup-valuation[mcp]"` — then call any `*_valuation`
tool (Scorecard, VC method, Black-Scholes, scenario analysis).

### Python Library

```python
from startup_valuation.core import scorecard_valuation, vc_method_post_money
from startup_valuation.advanced import black_scholes, scenario_analysis
from startup_valuation.types import Scenario

# Scorecard Method (pre-revenue startups)
result = scorecard_valuation(
    average_valuation=1_500_000,
    weights=[0.30, 0.25, 0.15, 0.10, 0.10, 0.05, 0.05],
    scores=[1.25, 1.50, 1.20, 0.75, 1.00, 0.90, 1.00],
)
print(f"Scorecard: ${result.value:,.0f}")  # $1,800,000

# Black-Scholes for real options (startup equity)
result = black_scholes(
    underlying=20_000_000, strike=5_000_000,
    risk_free_rate=0.05, volatility=0.40, time_to_maturity=1.0,
)
print(f"Option value: ${result.value:,.0f}")  # $15,240,000

# Scenario Analysis
scenarios = [
    Scenario("bull", 0.20, 10_000_000),
    Scenario("base", 0.60, 5_000_000),
    Scenario("bear", 0.20, 1_000_000),
]
result = scenario_analysis(scenarios)
print(f"Expected value: ${result.value:,.0f}")  # $5,200,000
```

### MCP Server (for AI Agents)

The server exposes **14 tools**, each folding a family of formulas behind a `method`
argument — probability, time value, CAPM, core pre-revenue methods, options,
comparables, SaaS, marketplaces, fintech, biotech, hardware, international,
stakeholder equity, emerging methods, and a triangulated full analysis.

**Local (stdio):**

```bash
pip install "startup-valuation[mcp]"
startup-valuation-mcp          # console script installed with the [mcp] extra

**Prompts and resources.** Besides the 14 tools, the server offers three guided
prompts (`value_pre_revenue_startup`, `value_saas_startup`, `model_funding_round`)
and a machine-readable method catalog at `startup-valuation://methods`, so agents
can see every method's required parameters before calling a tool.

# or: python -m startup_valuation.mcp
# or ephemeral, no clone: uvx --from startup-valuation startup-valuation-mcp
```

**Hosted (Streamable HTTP)** — no install, no API key:

```
https://startup-valuation.ascent-partners.com/mcp
```

**OpenCode** — add to `opencode.json`:

```json
"startup-valuation": {
  "type": "remote",
  "url": "https://startup-valuation.ascent-partners.com/mcp",
  "timeout": 60000
}
```

**Claude Desktop / Cursor** — add the HTTP URL `https://startup-valuation.ascent-partners.com/mcp`
as an MCP server, or run the stdio entrypoint above.

**MCP Registry** — published as `com.ascent-partners/startup-valuation`
(manifest: [`server.json`](server.json)) and listed on
[Glama](https://glama.ai/mcp/connectors/com.ascent-partners/startup-valuation) and the
[Official MCP Registry](https://registry.modelcontextprotocol.io). The
[`glama.json`](glama.json) file holds the Glama maintainer entry.

### AI-agent skills

Copy the `skills/` directory to your agent's skills folder:

- **`valuation-core`** — Scorecard, Berkus, VC Method, Risk Factor Summation
- **`valuation-foundations`** — Probability, time value, CAPM, comparables
- **`valuation-advanced`** — Black-Scholes, Binomial, Monte Carlo, Scenario Analysis
- **`valuation-industry`** — SaaS, Biotech, Fintech, Marketplace, Hardware
- **`valuation-stakeholder`** — Dilution, OPM, PWERM, Liquidation Preference
- **`valuation-emerging`** — SAFE, Crypto (MV=PQ), ESG, Metcalfe's Law

## Valuation Methods by Category

| Category          | Methods                                            | Chapter |
| ----------------- | -------------------------------------------------- | ------- |
| **Probability**   | Expected value, joint probability, Poisson         | 2       |
| **Time Value**    | PV, NPV, annuity                                   | 2       |
| **CAPM**          | CAPM, portfolio beta, startup-adjusted             | 2       |
| **Core**          | Scorecard, Berkus, Risk Factor, VC Method          | 3       |
| **Advanced**      | Black-Scholes, Binomial, Monte Carlo, Scenario     | 4       |
| **Comparables**   | P/E, P/S, EV/EBITDA, regression-adjusted           | 5       |
| **SaaS**          | LTV, CAC, NRR, Magic Number, Rule of 40            | 11      |
| **Biotech**       | rNPV, decision tree, peak sales, pipeline          | 11      |
| **Fintech**       | Payment revenue, lending, neobank, network effects | 11      |
| **Marketplace**   | GMV, take rate, liquidity, network density         | 11      |
| **Hardware**      | TRL-adjusted, break-even, P-weighted DCF           | 11      |
| **International** | PPP, CRP, currency-adjusted DCF, Damodaran         | 12      |
| **Stakeholders**  | Dilution, OPM, PWERM, liquidation, synergies       | 13      |
| **Emerging**      | SAFE, MV=PQ, ESG, Metcalfe's, data moat            | 14      |

### The valuation ladder

```mermaid
flowchart LR
    IDEA["Idea / pre-revenue"] --> SC["Scorecard · Berkus · Risk Factor"]
    SC --> VC["VC Method · OPM · PWERM"]
    VC --> ADV["Black-Scholes · Binomial · Monte Carlo · Scenario"]
    ADV --> COMP["Comparables: P/E · P/S · EV/EBITDA"]
    COMP --> IND["Industry: SaaS · Biotech · Fintech · Marketplace · Hardware"]
    IND --> R["ValuationResult (value · assumptions · sensitivity)"]
```

### Distribution

```mermaid
flowchart LR
    PKG["startup-valuation<br/>15 modules · 80+ functions"] --> L["pip install startup-valuation"]
    PKG --> MP["pip install startup-valuation[mcp]<br/>→ 14-tool MCP server"]
    MP --> T1["stdio (local)"]
    MP --> T2["hosted Streamable HTTP"]
```

## Why This Library?

- **Auditable** — Every function returns `ValuationResult` with value, method, inputs, assumptions, and sensitivity analysis
- **Textbook-accurate** — All formulas verified against book example values with unit tests
- **AI-ready** — MCP server and Skills for seamless AI agent integration
- **Industry-specific** — Dedicated modules for SaaS, biotech, fintech, marketplace, and hardware startups
- **Open source** — MIT license, extensible, well-documented

## Development

```bash
# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run with coverage
pytest --cov=startup_valuation --cov-report=term-missing

# Lint
ruff check .

# Type check
mypy src/startup_valuation --ignore-missing-imports
```

Web application and delivery contract:

```bash
pnpm check                       # tsc --noEmit
pnpm test                        # vitest: units, the chrome table, the quote mapping
pnpm build                       # next build (standalone)

python3 -m pytest tests-ci/      # pin checker, docs link rewriter
node --test tests-ci/workflows.test.mjs   # workflow invariants, one fixture per arm
python3 tests-ci/health_gate_sim.py       # the pin gate's behaviour, executed
python3 tests-ci/sampler_sim.py           # the failure report's markers, executed

node --test tests-deployed/deployed.test.mjs   # against the DEPLOYED origin
```

The last one is the gate that matters after a merge: it waits for every node to serve the pinned
digest, then asserts the product — including that `/docs` can load the stylesheet it references.
Suites that execute a shell program (`health_gate_sim`, `sampler_sim`) exist because a substring
assertion over YAML cannot see whether the thing runs.

## Documentation

- **API Reference:** [startup-valuation.ascent-partners.com/docs](https://startup-valuation.ascent-partners.com/docs)
  (mirrored on [GitHub Pages](https://simonmak-ascent.github.io/startup-valuation/))
- **Wiki (Theory & Derivations):** [GitHub Wiki](https://github.com/simonmak-ascent/startup-valuation/wiki)
- **PyPI:** [pypi.org/project/startup-valuation](https://pypi.org/project/startup-valuation/)
- **Chapter Index:** Maps every function to its textbook chapter
- **Examples:** Interactive code snippets for each valuation category

## Companion Textbook

**[Startup Valuation: A Comprehensive Guide to Valuing Fast-Growing Pre-Revenue Companies](https://www.amazon.com/Startup-Valuation-Comprehensive-Fast-Growing-Pre-Revenue-ebook/dp/B0FYTGNVWS/)**  
_Theory, Methods, Regulation, and Practice_ — Valuation in Practice Series by Ascent Partners  
By Simon Mak · 338 pages · 15 chapters · 300+ exercises · 20+ real-world cases

## Citing This Project

```bibtex
@software{startup_valuation_engine,
  author = {Mak, Simon},
  title = {Startup Valuation Engine},
  year = {2026},
  url = {https://github.com/simonmak-ascent/startup-valuation},
  license = {MIT},
}
```

Based on formulas from the **Startup Valuation** textbook.

## Use with Context7

Up-to-date Startup Valuation Engine documentation is indexed on [Context7](https://context7.com/simonmak-ascent/startup-valuation), so coding agents can pull it into context on demand. With the Context7 MCP server or `ctx7` CLI installed, name the library in your prompt:

```text
use library /simonmak-ascent/startup-valuation for API and docs
```

## License

MIT — see [LICENSE](LICENSE).

---

By [Ascent Partners](https://www.ascent.partners) — part of the Valuation in Practice Series.

If this saves you time, a ⭐ on GitHub helps others find it.

TDQS

A4.6/5.0

Scored across 14 tools

Disambiguation5/5

Each tool owns a clearly bounded domain (SaaS, marketplace, fintech, hardware, biotech, cap table, discounting, cost of capital, comparables, emerging instruments), and the descriptions include explicit routing hints such as 'for marketplace GMV use valuation_marketplace' and 'for plain DCF use valuation_time_value'. The few residual overlaps (expected_value_discrete vs. scenario_analysis, time_value dcf vs. fintech payment_processor DCF) are named and resolved in the text, so an agent has a deterministic selection path.

Naming Consistency5/5

All 14 tools follow an identical valuation_<domain> convention with descriptive, parallel suffixes (valuation_saas, valuation_biotech, valuation_capm, valuation_emerging). No mixing of camelCase, verbs, or ad-hoc abbreviations.

Tool Count5/5

14 tools sit comfortably in the well-scoped 3-15 band, and each one covers a distinct slice of the valuation curriculum rather than duplicating another. The per-tool 'method' dispatch keeps the top-level surface small while exposing many formulas without exploding the tool count.

Completeness4/5

Coverage is broad: pre-revenue methods, sector models, DCF/time value, CAPM/WACC, country risk, cap-table allocation, comparables, options, and SAFE/token/ESG models, which forms an end-to-end valuation lifecycle. Minor gaps remain — no method-discovery/introspection tool, and no sensitivity or cross-tool aggregation workflow, so an agent must assemble multi-step valuations manually.

Maintenance

ActivityActive
ResponsivenessNo recent community issues