Skip to main content
Glama
lye-calc-mcp

lye-calc-mcp

lye-calc-mcp

Soap lye math as an MCP server: how much sodium hydroxide (bar soap) or potassium hydroxide (liquid soap) and water your oils need at a given superfat, the soap qualities of the recipe against SoapCalc's suggested ranges, and how much oil fills a mold or makes a batch of a given weight. Three read-only tools, no sign-in, nothing stored.

It is the calculator of the Lye Calc soap 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: soap lye calculator.

Tools

Tool

Gives

calculate_soap_recipe

NaOH / KOH (purity included) and water to weigh, fragrance, batch weight, lye concentration and water : lye ratio, each oil's share and SAP, the seven soap qualities with ranges, and warnings (superfat, solution strength, soft bar, cloudy liquid soap)

find_soap_oil

SAP (NaOH and KOH), iodine, INS and fatty acids of 78 oils, butters and fats; names in 12 languages (olive, Оливкова олія, Olivenöl, オリーブオイル…)

size_soap_batch

Oil weight for a mold (length × width × fill height) or for a target batch weight, split per oil

Weights in g, kg, oz or lb. Bar, liquid (KOH) and dual-lye soap. Water as lye concentration, % of oils or water : lye ratio. All tools: readOnlyHint: true, destructiveHint: false, openWorldHint: false.

Related MCP server: softwash-mcp

Connect

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

Local (stdio):

git clone https://github.com/andronaft/lye-calc-mcp && cd lye-calc-mcp
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
{ "mcpServers": { "lye-calc": { "command": "/path/to/lye-calc-mcp/.venv/bin/python",
                                "args": ["/path/to/lye-calc-mcp/server.py", "--stdio"] } } }

Ask, for example: "Lye and water for 700 g olive, 200 g coconut and 100 g shea at 5 % superfat" or "How much oil for a 10 × 3.5 in loaf mold filled 3 in high, 60 % olive, 30 % coconut, 10 % castor?"

Method

  • lye = Σ oil weight × SAP(KOH) × (1 − superfat) ÷ purity; KOH → NaOH by molar mass 39.997 / 56.106.

  • SAP values, iodine, INS and fatty acids as published in the SoapCalc oil list (snapshot 2026-10-25, data/oils.json); soap qualities and their ranges as SoapCalc defines them.

  • Mold: cubic inches × 0.4 = ounces of oil (the soapers' rule of thumb). Batch weight: exact, since lye, water and fragrance all scale with the oils.

  • Checked against: 100 % olive at 5 % → 128.6 g NaOH per kg (SoapCalc); a published palm-free bar (63 g NaOH for 450 g oils); a published KOH liquid soap (115.8 g of 90 % KOH). See test_server.py.

  • Not counted: acid additives (citric, lactic acid, vinegar) that use up lye. The Lye Calc app counts them.

Lye amounts are estimates from average SAP values; a supplier's certificate of analysis may differ. Lye is caustic: goggles, gloves, lye into water, and a scale that reads 1 g.

Run and test

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 /lye-calc.

Licence

MIT for the code. Oil numbers: SoapCalc's published oil list. Made by Andrii Zhukovskyi (Dre Dev).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables users to calculate pool chemical doses from water tests, determine FC/CYA chlorine targets, evaluate CSI/LSI water balance, and compute pool volume in US or metric units via four read-only tools.
      MIT
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables calculating soft-wash tank recipes, downstream injector dilution, sodium hypochlorite strength loss in storage, and whole-job chemical plans for house, roof, concrete, fence, and deck surfaces through read-only MCP tools.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables candle makers to calculate wax and fragrance amounts, convert fragrance loads, estimate costs, set profitable Etsy, craft fair, and wholesale prices, and get wick sizing advice from burn tests through five read-only tools.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables sourdough bakers to compute dough formulas, true hydration, recipe scaling, starter feeds, levain builds, and water temperature for a target dough temperature. All five tools are read-only and require no sign-in.
      MIT