io.github.dengyu123456/crochet-engine
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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: ASCII & SVG Art Studio
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.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Convert PNG/JPEG into fuse-bead charts with MARD codes, PNG, CSV and an editable web link.
Design, save, and run outcome-aligned AI workflows and verifiers, with reliable image output.
Charts and dashboards as images for AI agents. No browser, same data same bytes. Local and free.
Agent-Native design tool - create and edit visual designs with agent assistance
Related MCP Servers
- 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 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
- AlicenseAqualityBmaintenanceEnables AI agents to create, validate, review, patch, save, share, and preview Minecraft textures and skins by compiling JSON specs deterministically to PNG, with review sheets, art feedback, docs, examples, and workspace-safe file operations.1477 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to inspect images, compare and apply 41 dithering algorithms with 256 curated or custom palettes, and produce stills, animations, video, and print separations locally while saving reusable recipes. It exposes these image-processing workflows through typed MCP tools, resources, and prompts, keeping source files and artifacts in a user-controlled workspace.MIT