rowkeeper-mcp
by andronaft
README.md
# rowkeeper-mcp
Knitting and crochet math as an MCP server: how many skeins or balls of yarn to buy when you substitute yarn or work
from a swatch, how many yards are left in a ball by weight and whether the yarn will last (yarn chicken), a pattern's
stitch and row counts converted to your gauge, increases or decreases spread evenly across a row and written out
(K7, M1 or 6 sc, inc), and knitting needle and crochet hook sizes in mm and US. Five read-only tools, no sign-in,
nothing stored.
It is the calculator of the **[RowKeeper](https://zhukovskyi.space/apps/rowkeeper/)** row counter app by Dre Dev,
ported from Dart to Python and checked against the app's own test values. The yarn calculator also runs in the
browser: [yarn yardage calculator](https://zhukovskyi.space/calculators/knitting/yarn-yardage-calculator.html).
- App: [zhukovskyi.space/apps/rowkeeper](https://zhukovskyi.space/apps/rowkeeper/) (coming to Google Play)
- Server: `https://mcp.zhukovskyi.space/rowkeeper/mcp` (streamable HTTP)
## Tools
| Tool | Gives |
|---|---|
| `calculate_yarn_needed` | Skeins to buy, length (yd and m) and grams for a project: yarn substitution from the pattern's skeins and yardage, or an estimate from a weighed swatch and the finished size; with a safety margin |
| `check_yarn_left` | Yards or metres left in a partly used ball from its weight and the ball band; will the yarn last to the end (weigh, knit some rows, weigh again): grams needed, spare or short, rows it lasts |
| `convert_pattern_for_gauge` | A pattern's stitch and row counts recalculated for your gauge, with the width they mean; gauge per 10 cm, per 4 in or per inch |
| `space_increases_evenly` | N increases or decreases spread evenly across S stitches, flat or in the round, or at both edges, written as an instruction with repeats; a plan of shaping every N rows with the stitch count after each |
| `convert_needle_hook_size` | Knitting needle and crochet hook sizes, mm ↔ US number or letter (Craft Yarn Council), nearest standard size |
Yards or metres, grams or ounces, gauge over 10 cm or 4 in. Knitting (K, M1, K2tog) and crochet (sc, inc, dec).
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/rowkeeper/mcp`, no authentication.
**Local (stdio):**
```bash
git clone https://github.com/andronaft/rowkeeper-mcp && cd rowkeeper-mcp
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
```
```json
{ "mcpServers": { "rowkeeper": { "command": "/path/to/rowkeeper-mcp/.venv/bin/python",
"args": ["/path/to/rowkeeper-mcp/server.py", "--stdio"] } } }
```
Ask, for example: *"The pattern calls for 5 skeins of 200 yd; my yarn has 230 yd a skein. How many do I buy?"* or
*"I have 84 stitches and need to increase 12 evenly, knitting flat. Write the row out."*
## Method
- Skeins to buy = ⌈pattern skeins × length per skein × (1 + extra %) ÷ your skein length⌉ (an exact fit is not
rounded up). From a swatch: swatch yarn = swatch weight × ball length ÷ ball weight; project yarn = swatch yarn ×
project area ÷ swatch area (the web calculator's method, built on the same functions).
- Length left = remaining weight × ball band length ÷ ball band weight. Enough to finish: needed = weight used ÷ rows
worked × rows to go; spare = weight you have − needed (the weigh–knit–weigh check, as Yarn.com's *The Yarn Diary*
describes it).
- Gauge: your count = pattern count × your gauge ÷ pattern gauge, rounded to whole stitches; the size it means =
pattern count ÷ pattern gauge × span.
- Even shaping: plain stitches = stitches − the stitches the shapings use (M1 none, a crochet increase one, a
decrease two), shared out so the runs differ by one at most and the longer ones are mixed through the row; worked
flat, the last run is split between both ends. At the edges, knitting keeps one edge stitch outside the shaping.
- Needle and hook sizes: Craft Yarn Council, [Hooks & Needles](https://www.craftyarncouncil.com/standards/hooks-and-needles)
(checked 22.11.2026). 1 yd = 0.9144 m and 1 oz = 28.349523125 g exactly.
- Checked against: 5 × 200 yd at 230 yd a skein + 10 % → 1100 yd, 4.78, buy 5; 37 g of a 100 g / 220 yd ball →
81.4 yd; 12 g for 8 rows, 40 to go, 50 g → 10 g short; 100 sts at 20 → 22 per 10 cm → 110 sts; 84 + 12 flat →
`K3, M1, *K7, M1* ×11, K4`; 80 + 12 → `*K6, M1, K7, M1, K7, M1* ×4`; 5 mm = US 8 = H-8. See `test_server.py`.
Yarn amounts are estimates: ribbing, cables, lace and rows that get longer use yarn differently from plain rows.
Swatch in the stitch you will use, keep a margin and buy one dye lot.
## 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 # 10 tests
```
Hosted with the other Dre Dev MCP servers in one process; `build_app()` is mounted at `/rowkeeper`.
## Licence
MIT for the code. Needle and hook sizes: the Craft Yarn Council's published table. Made by Andrii Zhukovskyi
([Dre Dev](https://zhukovskyi.space/)).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues