Skip to main content
Glama
roofcalc-mcp

roofcalc-mcp

README.md
# roofcalc-mcp

Roofing calculator as an MCP server: how many squares and bundles of shingles a roof needs from the house footprint
and the roof pitch, the full shingle material list (starter strip, hip and ridge cap, underlayment, ice and water
shield, drip edge, nails, ridge vent, step flashing), roof pitch conversions (x/12 to degrees, percent, pitch
multiplier, hip/valley factor), ice barrier rows by IRC R905.1.2 and tear-off debris and dumpsters. Five read-only
tools, no sign-in, nothing stored.

It is the calculator of the **[RoofCalc](https://zhukovskyi.space/apps/roofcalc/)** roofing estimator app by Dre Dev,
ported from Dart to Python and checked against the app's own test values. The same squares and bundles calculator
runs in the browser: [shingle bundles calculator](https://zhukovskyi.space/calculators/roofing/shingle-bundles-calculator.html).

- App: [Google Play](https://play.google.com/store/apps/details?id=com.andrii.roofcalc) ·
  [zhukovskyi.space/apps/roofcalc](https://zhukovskyi.space/apps/roofcalc/)
- Server: `https://mcp.zhukovskyi.space/roofcalc/mcp` (streamable HTTP)

## Tools

| Tool | Gives |
|---|---|
| `convert_roof_pitch` | Pitch from x/12, degrees, a measured rise and run, or percent grade: all three forms, slope factor (pitch multiplier), hip/valley factor, rafter length, IRC shingle and metal minimum-slope notes |
| `measure_roof_area` | Real sloped roof area and squares from footprint, overhang and pitch, per section (gable, hip, report-measured) and in total, with eaves, rakes, ridges, hips and valleys |
| `estimate_shingle_materials` | Shingle bundles with waste, starter, hip and ridge cap, underlayment (doubled 2/12–4/12), ice and water shield by code, drip edge, nail boxes, ridge vent, step flashing; each line with its math |
| `size_ice_barrier` | How far up the slope ice and water shield goes (eave to 24 in inside the wall), rows of 36 in membrane, rolls |
| `estimate_tear_off_debris` | Weight of the old roof by layers and shingle type, in lb/tons and kg/tonnes, and how many dumpsters |

Feet and square feet or metres and square metres. Gable, hip and several sections at different pitches. All tools:
`readOnlyHint: true`, `destructiveHint: false`, `openWorldHint: false`.

## Connect

**Claude (claude.ai, Desktop), ChatGPT (developer mode), Cursor, VS Code** — add a remote MCP server with the URL
`https://mcp.zhukovskyi.space/roofcalc/mcp`, no authentication.

**Local (stdio):**

```bash
git clone https://github.com/andronaft/roofcalc-mcp && cd roofcalc-mcp
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
```

```json
{ "mcpServers": { "roofcalc": { "command": "/path/to/roofcalc-mcp/.venv/bin/python",
                               "args": ["/path/to/roofcalc-mcp/server.py", "--stdio"] } } }
```

Ask, for example: *"How many bundles of shingles for a 50 × 30 ft gable house, 1 ft overhangs, 6/12 pitch?"* or
*"What is a 7/12 roof pitch in degrees, and what's the pitch multiplier?"*

## Method

- Slope factor = √(12² + rise²) ÷ 12; hip/valley factor = √(2·12² + rise²) ÷ 12. Degrees = atan(rise ÷ 12).
- Sloped area = plan area (footprint plus the overhang on every side, unless measured at the drip edge) × slope
  factor. Gable: eaves 2 × length, rakes 4 × half-span × factor, ridge = length. Hip: eaves all round, ridge = long
  side − short side, four hips over half the short side × hip factor. 1 square = 100 ft².
- Bundles = area × (1 + waste) ÷ 33.3 ft² (3 bundles per square), rounded up. Waste preset: 10 % gable, 15 % with any
  hip section (Fine Homebuilding, industry practice). 21 pieces per bundle and 4 nails per shingle
  (GAF Timberline HDZ data sheet; IRC R905.2.6), coil nails 7,200 per box.
- Starter on eaves and rakes, 120 ft per bundle (GAF Pro-Start); hip and ridge cap 25 ft per bundle (GAF
  Seal-A-Ridge); drip edge 10 ft pieces lapped 2 in (IRC R905.2.8.5); ridge vent 4 ft pieces.
- Ice barrier (IRC R905.1.2): (overhang + 6.5 in wall + 24 in) × slope factor up the slope, in 36 in rows lapped 3 in,
  200 ft² rolls, plus one width down each valley. Synthetic underlayment over the rest of the deck + 10 % laps, two
  layers from 2/12 up to 4/12, shingles not allowed under 2/12 (IRC R905.2.2).
- Step flashing: one piece per 5 5/8 in shingle course along walls (IRC R905.2.8.3).
- Tear-off debris per square per layer: 3-tab 200 lb, laminate 240 lb, premium 300 lb (IKO roofing dumpster guide).
- Checked against the app's `test/roof_test.dart`: 50 × 30 ft gable at 6/12 with 1 ft overhangs → 1,860.41 ft²,
  18.6 squares, 62 bundles, 2 starter, 3 cap, 18 drip edge, 4 ice and water rolls, 2 underlayment rolls; hip 50 × 30 →
  96 ft of hips; ice barrier 47.5 in, 2 rows (Fine Homebuilding's example); 2 layers tear-off → 4.47 tons, 2
  dumpsters. And the site's table: a 2,000 ft² footprint at 6/12 → 2,236 ft², 74 bundles. See `test_server.py`.
- Not here: metal roofing panels, gutters, prices and quotes. The RoofCalc app does them.

Quantities are estimates for ordering. Package coverage differs between products: read the wrapper. Code notes follow
the model IRC; cities adopt and amend it, so check with your inspector.

## Run and test

```bash
pip install -r requirements.txt
python server.py                  # http://127.0.0.1:8000/mcp
python server.py --stdio
python -m unittest discover tests   # 12 tests
```

Hosted with the other Dre Dev MCP servers in one process; `build_app()` is mounted at `/roofcalc`.

## Licence

MIT for the code. Made by Andrii Zhukovskyi ([Dre Dev](https://zhukovskyi.space/)).