stitchmath-mcp

by double2dev

Not rated
GitHub

About

Professional knitting and crochet math calculators that enable AI to design perfectly sized patterns.

Details

Author
double2dev
Categories
Productivity

Setup

Install stitchmath-mcp in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/double2dev/stitchmath-core

Follow the installation instructions in the repository README, then restart your MCP client.

StitchMath Coreis the open-source mathematical calculation engine and standardized dataset repository byStitchMath.com. Built for developers, designers, and craft bloggers, this library eliminates guesswork in knitting and crochet by providing robust algorithms for gauge sizing, even row decreases, yarn WPI classification, and international needle size conversions.

[!IMPORTANT]🌟 Need the Full Interactive Web Suite & AI Assistant?
This repository contains our lightweight algorithmic SDK and public datasets. For the complete visual experience—including20+ interactive calculators, our customSweater Pattern Generator, and theAI Pattern Assistant—visit the official web application athttps://stitchmath.com.

🆚 Open-Source SDK vs. StitchMath.com Platform

👉Experience all interactive tools for free on StitchMath.com →

- 📏Gauge Conversion Algorithm: Adjust pattern stitch counts precisely based on actual swatch measurements.
- ➕Increase & Decrease Spacing: Automatically calculate even stitch distribution and generate row work instructions (k2tog,m1).
- ⚖️Curated JSON Datasets: Machine-readable, standardized JSON files for:

- Needle Sizes(data/needle-sizes.json): Comprehensive US, UK/Canadian, and Metric (mm) conversions.
- Yarn Weights & WPI(data/yarn-weights.json): Standard 0–6 classifications, Wraps Per Inch ranges, and UK/Aus Ply equivalents.
- Standard Dimensions(data/blanket-sizes.json): Standard sizes for throws, baby blankets, scarves, and socks.

StitchMath Core now includes a built-in MCP server, allowing AI assistants like Claude Desktop and Cursor to perform 100% accurate knitting math, gauge conversions, and sizing calculations directly within your chats.

The server exposes the following tools to LLMs:

- calculate_gauge: Adjust stitch counts precisely based on actual swatch measurements.
- calculate_even_spacing: Calculate evenly spaced increases or decreases across a row.
- convert_needle_size: Convert between US, UK, and Metric needle sizes.
- convert_units: Convert Imperial / Metric dimensions.
- get_blanket_cast_on: Get recommended cast-on stitches for standard blanket sizes.

Add the following to yourclaude_desktop_config.json:

{ "mcpServers": { "stitchmath": { "command": "npx", "args": ["-y", "stitchmath-core"] } } }

You can installstitchmath-corevia npm or yarn into your Node.js, React, Vue, or React Native projects:

When a pattern calls for 20 stitches over 4 inches, but your actual swatch is 22 stitches over 4 inches:

const { calculateGauge } = require('stitchmath-core'); // How many stitches should you cast on for a 36-inch bust? const castOnStitches = calculateGauge(22, 4, 36); console.log(Cast on ${castOnStitches} stitches); // Output: Cast on 198 stitches

2. Calculate Even Decreases Across a Row

When shaping a sleeve or hat crown and you need to decrease 8 stitches evenly across 80 total stitches:

const { calculateEvenSpacing } = require('stitchmath-core'); const shaping = calculateEvenSpacing(80, 8, true); // true = decrease console.log(shaping.instructions); // Output: Work 9 sts, then [k2tog (or decrease), work 9 sts] across the row.

3. Lookup Needle Sizes & Conversions

const { convertNeedleSize } = require('stitchmath-core'); const sizeInfo = convertNeedleSize('8', 'us'); console.log(sizeInfo); // Output: { mm: '5.0', us: '8', uk: '6' }

You can import our curated industry datasets directly without importing the calculation functions:

// Import needle chart dataset directly const needleChart = require('stitchmath-core/data/needle-sizes.json'); // Import yarn weight classifications and WPI standards const yarnChart = require('stitchmath-core/data/yarn-weights.json'); // Import standard blanket and scarf dimensions const blanketDimensions = require('stitchmath-core/data/blanket-sizes.json');

🌐 Embedding StitchMath on Your Blog or Website

Are you a craft blogger, pattern designer, or knitting tutorial author? We encourage you to reference and embedStitchMathin your articles!

To add a direct link or badge to the official calculation suite on your website, simply copy the following HTML snippet:

<!-- StitchMath Badge & Link --> <a href="https://stitchmath.com" target="_blank" rel="noopener noreferrer" style="display:inline-block;padding:10px 20px;background:#10b981;color:#fff;text-decoration:none;border-radius:25px;font-weight:bold;box-shadow:0 4px 10px rgba(16,185,129,0.3);"> 🧶 Powered by StitchMath Calculators → </a>

By linking toStitchMath.com, you help your readers calculate exact gauge swatches and sizing without leaving their browser!

We welcome contributions from fellow developers, knitters, and crocheters!
- Fork the repository.
- Create your feature branch (git checkout -b feature/amazing-calculation).
- Commit your changes (git commit -m 'Add new sock heel shaping formula').
- Push to the branch (git push origin feature/amazing-calculation).
- Open a Pull Request.

This repository is licensed under theMIT License. See theLICENSEfile for details.

Made with ❤️ by the craft tech team atStitchMath.com.
Making knitting and crochet math simple for crafters everywhere.

The 1Password MCP server creates a bridge that allows MCP clients such as Codex and Kiro to manage your 1Password Environments with secure authorization prompts.

This is the 1st, easiest, and cheapest PPT, slides, presentation AI generation MCP Server in the world.

Persistent memory for any AI assistant. Zero token cost until recall. Stores memories in local SQLite, ranks by 6-factor scoring, returns results 79% smaller than JSON. Works with Claude, ChatGPT, Grok, Cursor, Windsurf, and any MCP client.

A MCP server that enables AI assistants to interact with Anki, the spaced repetition flashcard application.

Enables LLM clients to interact with macOS applications through AppleScript. Built using the @beyondbetter/bb-mcp-server library, this server provides safe, controlled execution of predefined scripts with optional support for arbitrary script execution.

An MCP server for WordPress plugin audits

Turn your AI assistant into a digital marketing hub that creates, organizes, and analyzes links and QR Codes on demand.

Connect AI clients to Cal.com scheduling through the Model Context Protocol using the hosted server at mcp.cal.com or a local instance.

Sync Calendars, Scheduling Links, AI Executive Scheduling Assistant, Unified Calendar

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.