@utilix-tech/mcp 0.12.0 → 0.14.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 +6 -0
- package/README.md +6 -3
- package/dist/index.js +101 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
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.14.0
|
|
6
|
+
- Added VAT / Sales Tax Calculator (`calculate_tax`).
|
|
7
|
+
|
|
8
|
+
## 0.13.0
|
|
9
|
+
- Added ICO Favicon Inspector (`read_ico_info`) and Barcode Checksum Validator (`validate_barcode`).
|
|
10
|
+
|
|
5
11
|
## 0.12.0
|
|
6
12
|
- Added IBAN Validator / Formatter (`validate_iban`) and Loan / Mortgage Calculator (`calculate_loan`).
|
|
7
13
|
- (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
|
|
3
|
+
MCP server exposing 114 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 (
|
|
148
|
+
### Units (7 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,8 @@ 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 |
|
|
157
|
+
| `calculate_tax` | Add or remove VAT/sales tax from a price, in either direction |
|
|
156
158
|
|
|
157
159
|
### API / Network (8 tools)
|
|
158
160
|
| Tool | Description |
|
|
@@ -237,11 +239,12 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
|
|
|
237
239
|
| `compress_json` | Compress JSON for LLM context budgets |
|
|
238
240
|
| `diff_json_detailed` | Diff two parsed JSON values, returning every path with its op and unchanged paths |
|
|
239
241
|
|
|
240
|
-
### Image (
|
|
242
|
+
### Image (3 tools)
|
|
241
243
|
| Tool | Description |
|
|
242
244
|
|------|-------------|
|
|
243
245
|
| `read_image_info` | Read format, dimensions, bit depth, and alpha channel from image bytes: no decoding required. Supports PNG, JPEG, GIF, WebP, BMP |
|
|
244
246
|
| `read_exif_data` | Read camera make/model, orientation, timestamps, exposure settings, and GPS coordinates from a JPEG's EXIF data |
|
|
247
|
+
| `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
248
|
|
|
246
249
|
### PDF (1 tool)
|
|
247
250
|
| Tool | Description |
|
package/dist/index.js
CHANGED
|
@@ -1926,6 +1926,68 @@ 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
|
+
);
|
|
1963
|
+
function _calculateTax(amount, ratePercent, direction) {
|
|
1964
|
+
if (!Number.isFinite(amount) || amount < 0) return { error: "Amount must be zero or a positive number" };
|
|
1965
|
+
if (!Number.isFinite(ratePercent) || ratePercent < 0) return { error: "Tax rate must be zero or a positive number" };
|
|
1966
|
+
if (direction !== "add" && direction !== "remove") return { error: 'Direction must be "add" or "remove"' };
|
|
1967
|
+
if (direction === "add") {
|
|
1968
|
+
const netAmount2 = _roundMoneyMcp(amount);
|
|
1969
|
+
const taxAmount2 = _roundMoneyMcp(amount * (ratePercent / 100));
|
|
1970
|
+
return { netAmount: netAmount2, taxAmount: taxAmount2, grossAmount: _roundMoneyMcp(netAmount2 + taxAmount2), ratePercent, direction };
|
|
1971
|
+
}
|
|
1972
|
+
const grossAmount = _roundMoneyMcp(amount);
|
|
1973
|
+
const netAmount = _roundMoneyMcp(amount / (1 + ratePercent / 100));
|
|
1974
|
+
const taxAmount = _roundMoneyMcp(grossAmount - netAmount);
|
|
1975
|
+
return { netAmount, taxAmount, grossAmount, ratePercent, direction };
|
|
1976
|
+
}
|
|
1977
|
+
server.tool(
|
|
1978
|
+
"calculate_tax",
|
|
1979
|
+
"Add tax to a net (pre-tax) amount or remove tax from a gross (tax-inclusive) amount, given a rate. Pure formula, not a live VAT/sales-tax rate lookup.",
|
|
1980
|
+
{
|
|
1981
|
+
amount: z.number().describe("The amount to add tax to (net) or remove tax from (gross)"),
|
|
1982
|
+
ratePercent: z.number().describe("Tax rate as a percent, e.g. 20"),
|
|
1983
|
+
direction: z.enum(["add", "remove"]).describe('"add" treats amount as net and computes gross; "remove" treats amount as gross and backs out net')
|
|
1984
|
+
},
|
|
1985
|
+
async ({ amount, ratePercent, direction }) => {
|
|
1986
|
+
const result = _calculateTax(amount, ratePercent, direction);
|
|
1987
|
+
if ("error" in result) return errText(result);
|
|
1988
|
+
return text(JSON.stringify(result, null, 2));
|
|
1989
|
+
}
|
|
1990
|
+
);
|
|
1929
1991
|
server.tool(
|
|
1930
1992
|
"format_ndjson",
|
|
1931
1993
|
"Validate newline-delimited JSON (NDJSON/JSON Lines), report per-line errors, and pretty-print each valid line.",
|
|
@@ -2669,6 +2731,45 @@ server.tool("read_id3_tags", "Read ID3 tags (title, artist, album, year, genre,
|
|
|
2669
2731
|
if ("error" in result) return errText(result);
|
|
2670
2732
|
return text(JSON.stringify(result, null, 2));
|
|
2671
2733
|
});
|
|
2734
|
+
function _readU16LE(bytes, offset) {
|
|
2735
|
+
return bytes[offset] | bytes[offset + 1] << 8;
|
|
2736
|
+
}
|
|
2737
|
+
function _readU32LE(bytes, offset) {
|
|
2738
|
+
return (bytes[offset] | bytes[offset + 1] << 8 | bytes[offset + 2] << 16 | bytes[offset + 3] << 24) >>> 0;
|
|
2739
|
+
}
|
|
2740
|
+
function _readIcoInfo(bytes) {
|
|
2741
|
+
if (bytes.length < 6) return { error: "File too small to be a valid ICO file" };
|
|
2742
|
+
if (_readU16LE(bytes, 0) !== 0) return { error: "Not a valid ICO file (reserved header field must be 0)" };
|
|
2743
|
+
const type = _readU16LE(bytes, 2);
|
|
2744
|
+
if (type === 2) return { error: "This is a .cur cursor file (type 2), not a .ico icon file" };
|
|
2745
|
+
if (type !== 1) return { error: `Unrecognized ICONDIR type (${type}); expected 1 for an icon file` };
|
|
2746
|
+
const count = _readU16LE(bytes, 4);
|
|
2747
|
+
if (count === 0) return { error: "ICO file declares zero embedded images" };
|
|
2748
|
+
const images = [];
|
|
2749
|
+
for (let i = 0; i < count; i++) {
|
|
2750
|
+
const offset = 6 + i * 16;
|
|
2751
|
+
if (offset + 16 > bytes.length) return { error: `Truncated ICONDIRENTRY for image ${i}` };
|
|
2752
|
+
const widthRaw = bytes[offset];
|
|
2753
|
+
const heightRaw = bytes[offset + 1];
|
|
2754
|
+
const colorCountRaw = bytes[offset + 2];
|
|
2755
|
+
images.push({
|
|
2756
|
+
width: widthRaw === 0 ? 256 : widthRaw,
|
|
2757
|
+
height: heightRaw === 0 ? 256 : heightRaw,
|
|
2758
|
+
colorCount: colorCountRaw === 0 ? null : colorCountRaw,
|
|
2759
|
+
planes: _readU16LE(bytes, offset + 4),
|
|
2760
|
+
bitCount: _readU16LE(bytes, offset + 6),
|
|
2761
|
+
bytesInRes: _readU32LE(bytes, offset + 8),
|
|
2762
|
+
imageOffset: _readU32LE(bytes, offset + 12)
|
|
2763
|
+
});
|
|
2764
|
+
}
|
|
2765
|
+
return { imageCount: count, images };
|
|
2766
|
+
}
|
|
2767
|
+
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 }) => {
|
|
2768
|
+
const bytes = new Uint8Array(Buffer.from(ico_base64.replace(/^data:.*;base64,/, ""), "base64"));
|
|
2769
|
+
const result = _readIcoInfo(bytes);
|
|
2770
|
+
if ("error" in result) return errText(result);
|
|
2771
|
+
return text(JSON.stringify(result, null, 2));
|
|
2772
|
+
});
|
|
2672
2773
|
function _parseEnvForDiff(input) {
|
|
2673
2774
|
const entries = [];
|
|
2674
2775
|
const errors = [];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilix-tech/mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "MCP server exposing
|
|
3
|
+
"version": "0.14.0",
|
|
4
|
+
"description": "MCP server exposing 114 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",
|