io.github.dengyu123456/crochet-engine
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@io.github.dengyu123456/crochet-engineturn photo.jpg into a C2C crochet chart with 8 colors and yarn estimates"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
crochetpatterngen-engine
The deterministic photo-to-crochet-chart engine behind crochetpatterngen.com — packaged as a Python library, CLI, and MCP server so AI agents (Claude Desktop, Cursor, etc.) can turn photos into crochet charts with exact stitch counts.
Deterministic, not generative. There is no AI image generation here — just resize, median-cut color quantization, and confetti cleanup. Same input, same chart, same stitch counts, every time. No hallucinated rows.
Why this engine
Real stitch counts — every chart comes with per-color hex + stitch counts that sum exactly to the grid size. What you see is what you crochet.
C2C block aspect correction — C2C blocks are physically wider than tall (0.7:1 h:w). The engine adjusts grid dimensions so the worked piece keeps the photo's proportions instead of coming out squashed.
5 technique presets —
graph,c2c,tapestry,mosaic,filet.Yarn estimation — per-color yardage for 6 yarn weights (fingering → super bulky).
Zero heavy deps — Pillow + numpy only. Optional
rembgextra for background removal.
Related MCP server: mcp-image-tools
Install
pip install crochetpatterngen-engine # core
pip install crochetpatterngen-engine[mcp] # + MCP server
pip install crochetpatterngen-engine[rembg] # + background removalPython API
from PIL import Image
from crochet_chart_engine import generate_chart, render_design, estimate_yarn
png_bytes, meta = generate_chart(
Image.open("photo.jpg"),
technique="c2c", # graph | c2c | tapestry | mosaic | filet
grid_w=60, # 20..120
n_colors=8, # 2..16
)
# meta: {"grid_w", "grid_h", "colors": [{"hex", "count"}],
# "total_stitches", "technique", "warning"}
yarn = estimate_yarn(meta, weight="worsted")
# {"total_yards": ..., "colors": [{"hex", "count", "yards"}], ...}
png_bytes, meta = render_design("designs/frog.txt") # ASCII design -> chartCLI
crochet-chart chart photo.jpg out.png --technique c2c --grid-w 60 --colors 8
crochet-chart design designs/frog.txt frog.png
crochet-chart yarn photo.jpg --technique graph --weight worstedMCP server (Claude Desktop & friends)
Add to claude_desktop_config.json:
{
"mcpServers": {
"crochet": {
"command": "uvx",
"args": ["--from", "crochetpatterngen-engine[mcp]", "crochetpatterngen-mcp"]
}
}
}Or with a regular pip install:
{
"mcpServers": {
"crochet": {
"command": "python",
"args": ["-m", "crochet_chart_engine.mcp_server"]
}
}
}Tools exposed (stdio transport):
Tool | What it does |
| Local image path → chart PNG (base64 or saved to |
| ASCII design file → chart PNG + stitch counts |
| Stitch counts → per-color yardage for one yarn weight or |
ASCII design format
See designs/frog.txt and designs/dragon.txt:
# comment
palette: G=#58A05C, W=#FFFFFF, .=#FAFAF7
title: Frog Face
technique: graph
---
..GGGG..........GGGG....
.GGWWGG........GGWWGG...One character per stitch; . is the background/padding color. Rows are padded to the longest row.
Development
pip install -e .[dev,mcp]
pytest tests/License
MIT — see LICENSE.
Free web tool + pattern library at crochetpatterngen.com.
This server cannot be deployed
Maintenance
Related MCP Connectors
Design, save, and run outcome-aligned AI workflows and verifiers, with reliable image output.
Generate image thumbnails, resize, convert and compress photos from your AI chat. Local files.
Agent-Native design tool - create and edit visual designs with agent assistance
Image & PDF tools for AI agents: compress, convert, resize, PDF, AI vision, pipeline.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceOfficial BMBrick engine for converting local images into high-fidelity LEGO-style brick mosaics for AI agents.10 npm1-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to perform image processing tasks such as sprite sheet splitting, resizing, cropping, and batch operations on local images.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to visually interact with LibreSprite for real-time pixel art creation and automated drawing with self-healing capabilities.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI to create ASCII and SVG art through a character canvas, with tools for drawing, previewing, and exporting to multiple formats, as well as composing stop-motion animations with optional voice-over.MIT