@utilix-tech/mcp 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  Full release notes for all Utilix surfaces (browser tools, REST API, SDKs, MCP server) live at [utilix.tech/changelog](https://utilix.tech/changelog). This file tracks just this package.
4
4
 
5
+ ## 0.13.0
6
+ - Added ICO Favicon Inspector (`read_ico_info`) and Barcode Checksum Validator (`validate_barcode`).
7
+
5
8
  ## 0.12.0
6
9
  - Added IBAN Validator / Formatter (`validate_iban`) and Loan / Mortgage Calculator (`calculate_loan`).
7
10
  - (npm publish for this version was retried after fixing a CI pin: `npm install -g npm@latest` started pulling npm 12, which requires Node >=22 and broke on this job's pinned Node 20 — now pinned to the npm 11 line.)
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @utilix-tech/mcp
2
2
 
3
- MCP server exposing 111 developer utility tools to Claude, Cursor, VS Code Copilot, and any [Model Context Protocol](https://modelcontextprotocol.io) compatible AI assistant.
3
+ MCP server exposing 113 developer utility tools to Claude, Cursor, VS Code Copilot, and any [Model Context Protocol](https://modelcontextprotocol.io) compatible AI assistant.
4
4
 
5
5
  No API key required. All tools run locally. Requires Node.js 18 or later.
6
6
 
@@ -145,7 +145,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
145
145
  | `date_diff` | Calculate the difference between two dates |
146
146
  | `convert_timezone` | Convert a date/time between timezones |
147
147
 
148
- ### Units (5 tools)
148
+ ### Units (6 tools)
149
149
  | Tool | Description |
150
150
  |------|-------------|
151
151
  | `convert_bytes` | Convert between B, KB, MB, GB, TB, KiB, MiB, GiB, TiB |
@@ -153,6 +153,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
153
153
  | `validate_card_number` | Validate a credit card number via the Luhn checksum and detect its network |
154
154
  | `validate_iban` | Validate an IBAN via the mod-97 checksum and format it into grouped blocks |
155
155
  | `calculate_loan` | Compute a loan's monthly payment, total interest, and amortization schedule |
156
+ | `validate_barcode` | Validate an EAN-13, EAN-8, or UPC-A barcode via its weighted mod-10 check digit |
156
157
 
157
158
  ### API / Network (8 tools)
158
159
  | Tool | Description |
@@ -237,11 +238,12 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
237
238
  | `compress_json` | Compress JSON for LLM context budgets |
238
239
  | `diff_json_detailed` | Diff two parsed JSON values, returning every path with its op and unchanged paths |
239
240
 
240
- ### Image (2 tools)
241
+ ### Image (3 tools)
241
242
  | Tool | Description |
242
243
  |------|-------------|
243
244
  | `read_image_info` | Read format, dimensions, bit depth, and alpha channel from image bytes: no decoding required. Supports PNG, JPEG, GIF, WebP, BMP |
244
245
  | `read_exif_data` | Read camera make/model, orientation, timestamps, exposure settings, and GPS coordinates from a JPEG's EXIF data |
246
+ | `read_ico_info` | Read how many images a .ico file embeds and each one's width, height, color depth, and size from its ICONDIR header |
245
247
 
246
248
  ### PDF (1 tool)
247
249
  | Tool | Description |
package/dist/index.js CHANGED
@@ -1926,6 +1926,40 @@ server.tool(
1926
1926
  return text(JSON.stringify(result, null, 2));
1927
1927
  }
1928
1928
  );
1929
+ var _BARCODE_FORMAT_BY_LENGTH = { 8: "EAN-8", 12: "UPC-A", 13: "EAN-13" };
1930
+ function _computeBarcodeCheckDigit(dataDigits) {
1931
+ let sum = 0;
1932
+ const n = dataDigits.length;
1933
+ for (let i = 0; i < n; i++) {
1934
+ const distanceFromEnd = n - 1 - i;
1935
+ const weight = distanceFromEnd % 2 === 0 ? 3 : 1;
1936
+ sum += dataDigits[i] * weight;
1937
+ }
1938
+ return (10 - sum % 10) % 10;
1939
+ }
1940
+ function _validateBarcode(input) {
1941
+ if (!input || !input.trim()) return { error: "Input is empty" };
1942
+ const digits = input.replace(/[\s-]/g, "");
1943
+ if (!/^\d+$/.test(digits)) return { error: "Barcode must contain only digits (spaces and hyphens are ignored)" };
1944
+ const format = _BARCODE_FORMAT_BY_LENGTH[digits.length];
1945
+ if (!format) {
1946
+ return { error: `Unsupported barcode length (${digits.length} digits); expected 8 (EAN-8), 12 (UPC-A), or 13 (EAN-13)` };
1947
+ }
1948
+ const dataDigits = digits.slice(0, -1).split("").map(Number);
1949
+ const checkDigit = Number(digits[digits.length - 1]);
1950
+ const expectedCheckDigit = _computeBarcodeCheckDigit(dataDigits);
1951
+ return { valid: checkDigit === expectedCheckDigit, format, digits, checkDigit, expectedCheckDigit };
1952
+ }
1953
+ server.tool(
1954
+ "validate_barcode",
1955
+ "Validate an EAN-13, EAN-8, or UPC-A barcode number via its weighted mod-10 check digit algorithm. The format is inferred from the digit length (8, 12, or 13).",
1956
+ { barcode: z.string().describe("The barcode digits, with optional spaces or hyphens") },
1957
+ async ({ barcode }) => {
1958
+ const result = _validateBarcode(barcode);
1959
+ if ("error" in result) return errText(result);
1960
+ return text(JSON.stringify(result, null, 2));
1961
+ }
1962
+ );
1929
1963
  server.tool(
1930
1964
  "format_ndjson",
1931
1965
  "Validate newline-delimited JSON (NDJSON/JSON Lines), report per-line errors, and pretty-print each valid line.",
@@ -2669,6 +2703,45 @@ server.tool("read_id3_tags", "Read ID3 tags (title, artist, album, year, genre,
2669
2703
  if ("error" in result) return errText(result);
2670
2704
  return text(JSON.stringify(result, null, 2));
2671
2705
  });
2706
+ function _readU16LE(bytes, offset) {
2707
+ return bytes[offset] | bytes[offset + 1] << 8;
2708
+ }
2709
+ function _readU32LE(bytes, offset) {
2710
+ return (bytes[offset] | bytes[offset + 1] << 8 | bytes[offset + 2] << 16 | bytes[offset + 3] << 24) >>> 0;
2711
+ }
2712
+ function _readIcoInfo(bytes) {
2713
+ if (bytes.length < 6) return { error: "File too small to be a valid ICO file" };
2714
+ if (_readU16LE(bytes, 0) !== 0) return { error: "Not a valid ICO file (reserved header field must be 0)" };
2715
+ const type = _readU16LE(bytes, 2);
2716
+ if (type === 2) return { error: "This is a .cur cursor file (type 2), not a .ico icon file" };
2717
+ if (type !== 1) return { error: `Unrecognized ICONDIR type (${type}); expected 1 for an icon file` };
2718
+ const count = _readU16LE(bytes, 4);
2719
+ if (count === 0) return { error: "ICO file declares zero embedded images" };
2720
+ const images = [];
2721
+ for (let i = 0; i < count; i++) {
2722
+ const offset = 6 + i * 16;
2723
+ if (offset + 16 > bytes.length) return { error: `Truncated ICONDIRENTRY for image ${i}` };
2724
+ const widthRaw = bytes[offset];
2725
+ const heightRaw = bytes[offset + 1];
2726
+ const colorCountRaw = bytes[offset + 2];
2727
+ images.push({
2728
+ width: widthRaw === 0 ? 256 : widthRaw,
2729
+ height: heightRaw === 0 ? 256 : heightRaw,
2730
+ colorCount: colorCountRaw === 0 ? null : colorCountRaw,
2731
+ planes: _readU16LE(bytes, offset + 4),
2732
+ bitCount: _readU16LE(bytes, offset + 6),
2733
+ bytesInRes: _readU32LE(bytes, offset + 8),
2734
+ imageOffset: _readU32LE(bytes, offset + 12)
2735
+ });
2736
+ }
2737
+ return { imageCount: count, images };
2738
+ }
2739
+ server.tool("read_ico_info", "Read a .ico file's ICONDIR/ICONDIRENTRY header table directly from its bytes to report how many images it embeds and each one's width, height, color depth, and size. No image decoding required.", { ico_base64: z.string().describe("Base64-encoded ICO file bytes, optionally prefixed with a data: URL scheme") }, async ({ ico_base64 }) => {
2740
+ const bytes = new Uint8Array(Buffer.from(ico_base64.replace(/^data:.*;base64,/, ""), "base64"));
2741
+ const result = _readIcoInfo(bytes);
2742
+ if ("error" in result) return errText(result);
2743
+ return text(JSON.stringify(result, null, 2));
2744
+ });
2672
2745
  function _parseEnvForDiff(input) {
2673
2746
  const entries = [];
2674
2747
  const errors = [];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@utilix-tech/mcp",
3
- "version": "0.12.0",
4
- "description": "MCP server exposing 111 Utilix developer tools to Claude, Cursor, VS Code Copilot, and any MCP-compatible AI assistant.",
3
+ "version": "0.13.0",
4
+ "description": "MCP server exposing 113 Utilix developer tools to Claude, Cursor, VS Code Copilot, and any MCP-compatible AI assistant.",
5
5
  "author": "Utilix <hello@utilix.tech>",
6
6
  "license": "MIT",
7
7
  "homepage": "https://utilix.tech/mcp",