Skip to main content
Glama
hvac-charge

hvac-charge

README.md
# hvac-charge-mcp

Refrigerant charging math as an MCP server: superheat and subcooling from gauge pressure and line temperature for
22 refrigerants (R-410A, R-454B, R-32, R-22, R-134a, R-404A, R-407C, R-448A, R-449A, R-1234yf, R-290, R-744…), with
the dew point for superheat and the bubble point for subcooling on blends with glide; the target superheat of a
fixed-orifice (piston) system from indoor wet bulb and outdoor dry bulb; a refrigerant PT chart lookup; and the US EPA
leak rate under 40 CFR 84.106. Four read-only tools, no sign-in, nothing stored.

It is the calculator of the **[HVAC Charge](https://zhukovskyi.space/apps/hvac-charge/)** app by Dre Dev, ported from
Dart to Python and checked against the app's own test values. The same calculator runs free in the browser:
[superheat and subcooling calculator](https://zhukovskyi.space/calculators/hvac/superheat-subcooling-calculator.html).

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

## Tools

| Tool | Gives |
|---|---|
| `check_refrigerant_charge` | Saturation temperatures, superheat and subcooling from suction and liquid pressure (or the saturation temperature a digital manifold shows) and line temperatures; the call (on target, add refrigerant, recover) against the piston target superheat or the TXV/EEV nameplate subcooling; holds the call when a reading is off, TXV superheat is outside 4–25 °F or the air split says low airflow |
| `find_target_superheat` | Required superheat for a piston / fixed orifice from indoor wet bulb and outdoor dry bulb (Bryant/Carrier charging table), or "do not charge by superheat"; optional target temperature split (Title 24 JA6.1-1) |
| `lookup_refrigerant_pt` | Saturation pressure at a temperature or saturation temperature at a gauge pressure, bubble and dew separately, glide, safety class and source |
| `calculate_refrigerant_leak_rate` | Leak rate by the annualizing or rolling average method (40 CFR 84.102), the 10 / 20 / 30 % threshold, whether the rule covers the appliance, repair, verification-test, retrofit-plan and inspection deadlines, the 125 % chronic-leak report |

°F or °C (superheat and subcooling in °F or K); gauge pressure in psig, bar, kPa or MPa; job-site altitude for
gauges zeroed to local air; charge weights in lb, kg or oz. 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/hvac-charge/mcp`, no authentication.

**Local (stdio):**

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

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

Ask, for example: *"R-454B, TXV, suction 107 psig at 52 °F, liquid 312 psig at 92 °F, nameplate subcooling 10 °F:
is the charge right?"* or *"Target superheat for a piston system at 63 °F indoor wet bulb and 87 °F outdoors?"*

## Method

- Superheat = suction line temperature − dew-point saturation temperature at suction pressure; subcooling =
  bubble-point saturation temperature at liquid pressure − liquid line temperature.
- PT data (`hvac_charge_mcp/data/pt_tables.json`, copied cell for cell from the app): Arkema Forane PT charts
  (PPC/SDC 05-2025, NIST REFPROP 10; 2019 wall chart, REFPROP 9 for R-407A, R-507A, R-427A, R-408A, R-409A),
  Chemours Opteon YF (R-1234yf) and the NIST Chemistry WebBook (R-290, R-600a, R-744, R-717, R-12). Cells every
  5 °F from −50 to 150 °F (R-744 to 85 °F); between rows, linear in ln(P) against 1/T. Vacuum cells are inches of
  mercury below one atmosphere (0.4911541 psi/inHg). Readings outside the chart are refused, not extrapolated.
- Altitude: p = 14.696 (1 − 6.8754×10⁻⁶ Z)^5.2559 (ASHRAE Handbook—Fundamentals, Psychrometrics, Eq. 3).
- Piston target superheat: Bryant/Carrier *Table I – Superheat Charging Table*, 324476-101 Rev. B, outdoor 55–115 °F
  by indoor wet bulb 50–76 °F, bilinear between cells, rounded to whole degrees; superheat above target → add,
  below → recover. TXV/EEV: subcooling below the nameplate target → add; superheat must be 4–25 °F at the outdoor
  unit (California Title 24, 2022 Reference Appendices RA3.2). Target split: Title 24, 2019 Joint Appendices,
  Table JA6.1-1; more than 5 °F over it is low airflow. Default tolerance ±3 °F, as in the app.
- Leak rate: 40 CFR 84 subpart C (eCFR as of 2026-11-25). Annualizing: added ÷ full charge × 365 ÷ days since the
  last addition (365 at most; 365 for the first since January 1, 2026). Rolling: added in the last 365 days ÷ full
  charge. Thresholds 20 % commercial refrigeration, 30 % industrial process, 10 % comfort cooling and others, for
  15 lb or more of an HFC; "over" means more than the threshold.
- Checked against (see `tests/test_server.py`): printed Arkema, Chemours and NIST cells (R-410A 118.8 psig at 40 °F,
  R-454B 107.0 psig dew at 40 °F, R-744 1033.1 psia at 85 °F…), the 1 °F Chemours Opteon XL41 (R-454B) table between
  rows, a worked R-454B superheat and subcooling from Chemours XL41 pressures, charging-table cells, the Title 24
  split table, and the app's leak-log cases (10 lb into 100 lb after 72 days = 50.7 %).

Estimates from published tables, not a substitute for the equipment manufacturer's charging instructions and
nameplate. A2L (R-454B, R-32) and A3 (R-290, R-600a) refrigerants need the tools and procedures for flammable
refrigerants; in the US refrigerant work needs EPA Section 608 certification. The leak-rate tool is not legal advice
and does not track an appliance's record history (the app's leak log does).

## 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   # 15 tests
```

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

## Licence

MIT for the code. PT data: Arkema, Chemours and NIST published tables; charging table: Bryant/Carrier; split table:
California Energy Commission. Made by Andrii Zhukovskyi ([Dre Dev](https://zhukovskyi.space/)).