yaktool-gs1-mcp
v0.3.0
Published
GS1 barcode data as an MCP server: build a GS1-128 / GS1 element string from Application Identifiers with FNC1 placement handled, generate a GS1 DataMatrix (ECC200) as SVG, validate the eight GS1 identification keys beyond GTIN — SSCC, GLN, GRAI, GIAI, GS
Maintainers
Readme
yaktool-gs1-mcp
GS1 barcode data as an MCP server — the GS1-domain suite of yaktool.com.
The parts of GS1 that are easy to get subtly wrong: where the FNC1 separator belongs, which Application Identifiers have a predefined length, and which identification key uses a check character pair instead of a check digit. No network I/O.
Tools
build_gs1_element_string— build an element string from Application Identifiers with FNC1 placement handled for you: a separator after every variable-length field except the last, none after a predefined-length one. Returns the human-readable form, the encodable form and a round-trip self-check — the output is parsed back and compared before it is returned.generate_gs1_datamatrix— generate a GS1 DataMatrix (ECC200) as SVG, with FNC1 in the first position as GS1 requires. The encoder is written here rather than pulled in, because the core package carries zero runtime dependencies; it is cross-validated in tests against bwip-js, zxing and the ISO/IEC 16022 worked example.validate_gs1_extended_key— validate the eight GS1 identification keys beyond GTIN: SSCC, GLN, GRAI, GIAI, GSRN, GDTI, GINC and GMN. Each has its own length rule, its own serial-component rules and — for GMN — a check character pair computed over CSET 82, not a Mod-10 check digit.list_gs1_keys— the eight keys with their lengths, structure and what each identifies, for choosing the right key before building anything.check_itf14_spec— judge the print specification of an ITF-14 case code and compute how big it will actually be. Case codes fail at goods-in for their dimensions far more often than for their number, and the rule that catches people is that the bearer bar depends on the press: a plate-based process needs a constant 4.83 mm bar surrounding the symbol and its quiet zones, a plateless one only twice the narrow bar, top and bottom. Checks the GTIN-14 check digit, X-dimension, the 31.75 mm minimum bar height (it does not shrink with the symbol), 10X quiet zones and the wide-to-narrow ratio; the width comes from the standard's own formula, whose worked example (142.75 mm) is a regression test. It states the ISO/IEC 15416 grade requirement but never pretends to measure it.decode_variable_measure_code— decode a price- or weight-embedded in-store barcode (RCN-12/13, prefix 02 or 20–29 — what a deli or produce scale prints) into item reference and embedded price or weight, under every documented national scheme whose prefix matches: North America, UK branded and in-store, Australia, Germany, Sweden and Greece, each from the member organisation's own document. The price verifier digit (GS1 weighting factors 2−, 3, 5+, 5−, not mod-10) is recomputed and readings that agree with it come first; schemes without a verifier are said to be unfalsifiable rather than quietly dropped. Batch viavalues.build_variable_measure_code— the inverse: scheme + item reference + price or weight → the complete number with both check digits, every weighted product shown as a step. The standard's own worked examples (2875 → 9, 14685 → 6) are regression tests.
Install
claude mcp add yaktool-gs1 -- npx -y yaktool-gs1-mcpSame engine as the browser tools at yaktool.com/ecommerce/gs1-128-builder.
