growlab-mcp
by andronaft
README.md
# growlab-mcp
Hydroponics math as an MCP server: convert EC to ppm on the 500, 640 and 700 scales and back, work out how many ml,
grams or teaspoons of each nutrient part go into a reservoir (any brand, from the label doses, at any strength or to
a target EC), fix a reservoir whose EC is too high or too low or that needs topping up, calculate leaf VPD with the
humidity to aim for, and look up the EC and pH range for 23 hydroponic crops. Five read-only tools, no sign-in,
nothing stored.
It is the calculator of the **[GrowLab](https://zhukovskyi.space/apps/growlab/)** hydroponic nutrient app by Dre Dev,
ported from Dart to Python and checked against the app's own test values. The same EC to ppm converter runs in the
browser: [EC to ppm converter](https://zhukovskyi.space/calculators/hydroponics/ec-to-ppm-converter.html).
- App: [zhukovskyi.space/apps/growlab](https://zhukovskyi.space/apps/growlab/)
- Server: `https://mcp.zhukovskyi.space/growlab/mcp` (streamable HTTP)
## Tools
| Tool | Gives |
|---|---|
| `convert_ec_ppm` | EC in mS/cm, µS/cm and CF, ppm on the 500 (NaCl), 640 and 700 (442) scales, from any of them; optional check against a crop's EC range |
| `calculate_nutrient_doses` | ml, g and US teaspoons of each nutrient part for a reservoir in litres or gallons, from label doses in ml/L, ml/gal, tsp/gal, g/L or g/gal; at a set strength or mixed to a target EC; expected EC of the fresh mix; a warning when a dose looks like the wrong unit |
| `correct_reservoir_ec` | Plain water to add (or drain and refill) when EC is too high, share of the label dose to add when it is too low, and how to top up a tank so it lands on target |
| `calculate_leaf_vpd` | Leaf VPD in kPa from air temperature, humidity and leaf temperature, against the seedling, vegetative or flowering band; the humidity range to aim for, dew point, condensation warning; daily light integral (DLI) with the crop's target |
| `get_crop_ec_ph_targets` | EC (mS/cm and ppm) and pH range for 23 crops, the stage EC, a week-by-week starter feeding schedule, VPD band and DLI target |
Litres or US gallons, °C or °F, EC in mS/cm, µS/cm or ppm on any scale. Label dose presets for GH Flora Series
3-part (grow), Masterblend 4-18-38, Jack's 321 and FoxFarm Grow Big Hydroponic. 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/growlab/mcp`, no authentication.
**Local (stdio):**
```bash
git clone https://github.com/andronaft/growlab-mcp && cd growlab-mcp
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
```
```json
{ "mcpServers": { "growlab": { "command": "/path/to/growlab-mcp/.venv/bin/python",
"args": ["/path/to/growlab-mcp/server.py", "--stdio"] } } }
```
Ask, for example: *"My feed chart says 840 ppm but my meter is on the 500 scale. What should it read?"* or
*"My 100 L lettuce tank reads 2.0 EC and I want 1.5, tap water is 0.2. How much water do I add?"*
## Method
- ppm = EC (µS/cm) × 0.5 for NaCl-calibrated meters, × 0.7 for 442 meters (Hanna Instruments, "What is the
relationship between TDS and EC?"). The 640 scale is plain arithmetic (× 0.64): no meter maker's manual we found
confirms it. 1.413 mS/cm calibration solution reads about 706.5, 904.3 and 989.1 ppm on the three scales.
- Doses: label dose per litre × litres × strength; 1 US gal = 3.785411784 L, 1 US tsp = 4.92892 ml. Mixing to a
target: strength = (EC target − EC water) ÷ EC of the full dose; the full-dose EC is measured once or calibrated
from a test mix, (EC measured − EC water) ÷ test strength. Over 10 ml or g per litre is flagged as a probable unit
mix-up (GrowLab's own rule of thumb, not a published limit).
- Corrections: mass balance on EC, C1·V1 + C2·V2 = C3·V3: add water V·(EC now − EC target)/(EC target − EC water),
or drain V·(EC now − EC target)/(EC now − EC water); strengthen by (EC target − EC now)/EC full of the label dose;
top up by dosing only the added water. Within 0.05 mS/cm counts as on target. The procedure follows Oklahoma State
University Extension HLA-6722 (dilute when high, add concentrate when low).
- VPD: saturation vapour pressure 0.6108·exp(17.27·T/(T + 237.3)) kPa (FAO-56, Allen et al. 1998, Eq. 11), leaf VPD
= e°(T leaf) − e°(T air)·RH/100, dew point from Eq. 14. Bands: seedlings and cuttings 0.4–0.8, vegetative 0.8–1.2,
flower and fruit 1.0–1.5 kPa (greenhouse guidance, MSU Floriculture). DLI = PPFD × hours × 0.0036 (Purdue
Extension HO-238-W); crop DLI targets from Cornell University (Mattson).
- Crop EC and pH: OSU Extension fact sheet HLA-6722 (Dunn & Singh, 2017), Table 2, 23 rows as printed. The starter
schedule spreads that range over 2 seedling, 4 vegetative and 8 flowering weeks, as the app does.
- Checked against: FAO-56 Table 2.3 (2.338, 3.168, 4.243 kPa at 20, 25, 30 °C), leaf VPD 0.908 kPa at 25 °C air,
23 °C leaf, 60 %; 1.4 mS/cm = 700 / 980 ppm; 840 ppm (700 scale) = 1.2 mS/cm; the app's dilution (100 L from 2.0
to 1.5: add 33.3 L or drain 25 L), strengthen and top-up cases; DLI 4.68 mol/m²/day for 100 µmol/m²/s over 13 h
(Ohio State). See `tests/test_server.py`.
- Not here: pH-adjuster doses (they depend on the product and the water's alkalinity, so the app gives none either),
the app's log, reminders and pH pen calibration history.
All results are estimates: EC is taken as proportional to the dose, which holds in the dilute range used in
hydroponics, and a nutrient label or system may differ from the published ranges. Mix, stir, then measure EC and pH.
## 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 # 14 tests
```
Hosted with the other Dre Dev MCP servers in one process; `build_app()` is mounted at `/growlab`.
## Licence
MIT for the code. Crop ranges: OSU Extension HLA-6722; nutrient line doses: the makers' own published labels and
feeding charts. Made by Andrii Zhukovskyi ([Dre Dev](https://zhukovskyi.space/)).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues