@utilix-tech/mcp 0.25.0 → 0.26.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 +4 -0
- package/README.md +4 -2
- package/dist/index.js +94 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
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.26.0
|
|
6
|
+
- Add `calculate_break_even` tool: break-even unit count and revenue from fixed costs, variable cost per unit, and price per unit, plus profit and margin of safety at an optional sales volume.
|
|
7
|
+
- Add `calculate_string_distance` tool: Levenshtein edit distance and normalized similarity between two strings, with an optional Damerau (transposition) mode.
|
|
8
|
+
|
|
5
9
|
## 0.25.0
|
|
6
10
|
- Add `calculate_discount` tool: solve a sale price, amount saved, or discount percent from any one of them, or stack successive discounts where 20% then 10% is an effective 28% off.
|
|
7
11
|
- Add `convert_subtitles` tool: convert between SubRip (.srt) and WebVTT (.vtt) with an optional time shift to resync every cue.
|
package/README.md
CHANGED
|
@@ -126,7 +126,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
|
|
|
126
126
|
| `generate_qr` | Generate a QR code as an SVG string |
|
|
127
127
|
| `generate_random_data` | Generate random mock data: names, emails, UUIDs, IPs, etc. |
|
|
128
128
|
|
|
129
|
-
### Text (
|
|
129
|
+
### Text (13 tools)
|
|
130
130
|
| Tool | Description |
|
|
131
131
|
|------|-------------|
|
|
132
132
|
| `convert_case` | Convert text case: camelCase, snake_case, PascalCase, etc. |
|
|
@@ -141,6 +141,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
|
|
|
141
141
|
| `detect_passive_voice` | Flag sentences written in passive voice, e.g. "was written", "were approved by the team" |
|
|
142
142
|
| `score_readability` | Score text with Flesch Reading Ease, Flesch-Kincaid Grade Level, and Gunning Fog Index |
|
|
143
143
|
| `detect_filler_words` | Scan text for filler words, hedge phrases, and clichés with per-phrase counts and a density score |
|
|
144
|
+
| `calculate_string_distance` | Compute the Levenshtein (or Damerau) edit distance and normalized similarity between two strings |
|
|
144
145
|
|
|
145
146
|
### Time (6 tools)
|
|
146
147
|
| Tool | Description |
|
|
@@ -152,7 +153,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
|
|
|
152
153
|
| `convert_timezone` | Convert a date/time between timezones |
|
|
153
154
|
| `convert_iso8601_duration` | Parse an ISO 8601 duration into components and total seconds, or format seconds into a duration string |
|
|
154
155
|
|
|
155
|
-
### Units (
|
|
156
|
+
### Units (18 tools)
|
|
156
157
|
| Tool | Description |
|
|
157
158
|
|------|-------------|
|
|
158
159
|
| `convert_bytes` | Convert between B, KB, MB, GB, TB, KiB, MiB, GiB, TiB |
|
|
@@ -172,6 +173,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
|
|
|
172
173
|
| `calculate_margin_markup` | Given any two of cost, price, margin percent, and markup percent, solve for the other two plus gross profit |
|
|
173
174
|
| `calculate_discount` | Solve a sale price, amount saved, or discount percent from any one of them, or stack successive discounts in order |
|
|
174
175
|
| `convert_subtitles` | Convert subtitles between SubRip (.srt) and WebVTT (.vtt), with an optional time shift to resync every cue |
|
|
176
|
+
| `calculate_break_even` | Compute the break-even unit count and revenue from fixed costs, variable cost per unit, and price per unit |
|
|
175
177
|
|
|
176
178
|
### API / Network (10 tools)
|
|
177
179
|
| Tool | Description |
|
package/dist/index.js
CHANGED
|
@@ -4342,5 +4342,99 @@ server.tool(
|
|
|
4342
4342
|
return text(JSON.stringify(result, null, 2));
|
|
4343
4343
|
}
|
|
4344
4344
|
);
|
|
4345
|
+
function _calculateBreakEvenMcp(fixedCosts, variableCostPerUnit, pricePerUnit, salesVolume) {
|
|
4346
|
+
if (!Number.isFinite(fixedCosts)) return { error: "fixedCosts must be a finite number" };
|
|
4347
|
+
if (!Number.isFinite(variableCostPerUnit)) return { error: "variableCostPerUnit must be a finite number" };
|
|
4348
|
+
if (!Number.isFinite(pricePerUnit)) return { error: "pricePerUnit must be a finite number" };
|
|
4349
|
+
if (fixedCosts < 0) return { error: "fixedCosts cannot be negative" };
|
|
4350
|
+
if (variableCostPerUnit < 0) return { error: "variableCostPerUnit cannot be negative" };
|
|
4351
|
+
if (pricePerUnit <= 0) return { error: "pricePerUnit must be greater than zero" };
|
|
4352
|
+
if (pricePerUnit <= variableCostPerUnit) {
|
|
4353
|
+
return { error: "pricePerUnit must be greater than variableCostPerUnit, otherwise every unit sold loses money and break-even is never reached" };
|
|
4354
|
+
}
|
|
4355
|
+
const round4 = (n) => Math.round(n * 1e4) / 1e4;
|
|
4356
|
+
const contributionMarginPerUnit = pricePerUnit - variableCostPerUnit;
|
|
4357
|
+
const contributionMarginRatio = contributionMarginPerUnit / pricePerUnit * 100;
|
|
4358
|
+
const breakEvenUnits = fixedCosts / contributionMarginPerUnit;
|
|
4359
|
+
const breakEvenUnitsRounded = Math.ceil(breakEvenUnits);
|
|
4360
|
+
const breakEvenRevenue = breakEvenUnits * pricePerUnit;
|
|
4361
|
+
const result = {
|
|
4362
|
+
fixedCosts: round4(fixedCosts),
|
|
4363
|
+
variableCostPerUnit: round4(variableCostPerUnit),
|
|
4364
|
+
pricePerUnit: round4(pricePerUnit),
|
|
4365
|
+
contributionMarginPerUnit: round4(contributionMarginPerUnit),
|
|
4366
|
+
contributionMarginRatio: round4(contributionMarginRatio),
|
|
4367
|
+
breakEvenUnits: round4(breakEvenUnits),
|
|
4368
|
+
breakEvenUnitsRounded,
|
|
4369
|
+
breakEvenRevenue: round4(breakEvenRevenue)
|
|
4370
|
+
};
|
|
4371
|
+
if (typeof salesVolume === "number" && Number.isFinite(salesVolume)) {
|
|
4372
|
+
if (salesVolume < 0) return { error: "salesVolume cannot be negative" };
|
|
4373
|
+
const marginOfSafetyUnits = salesVolume - breakEvenUnits;
|
|
4374
|
+
result.salesVolume = round4(salesVolume);
|
|
4375
|
+
result.revenueAtSalesVolume = round4(salesVolume * pricePerUnit);
|
|
4376
|
+
result.profitAtSalesVolume = round4(salesVolume * contributionMarginPerUnit - fixedCosts);
|
|
4377
|
+
result.marginOfSafetyUnits = round4(marginOfSafetyUnits);
|
|
4378
|
+
result.marginOfSafetyPercent = salesVolume > 0 ? round4(marginOfSafetyUnits / salesVolume * 100) : 0;
|
|
4379
|
+
}
|
|
4380
|
+
return result;
|
|
4381
|
+
}
|
|
4382
|
+
server.tool(
|
|
4383
|
+
"calculate_break_even",
|
|
4384
|
+
"From fixed costs, the variable cost per unit, and the selling price per unit, compute the break-even point: the unit count and revenue at which profit is exactly zero. The price must exceed the variable cost, since otherwise every unit sold loses money and break-even is never reached no matter the volume. Optionally pass a sales volume to also get the profit (or loss) at that volume and the margin of safety above break-even. Pure arithmetic, no live cost/pricing feed.",
|
|
4385
|
+
{
|
|
4386
|
+
fixedCosts: z.number().describe("Total fixed costs for the period (cannot be negative)"),
|
|
4387
|
+
variableCostPerUnit: z.number().describe("Variable cost to produce one unit (cannot be negative)"),
|
|
4388
|
+
pricePerUnit: z.number().describe("Selling price per unit (must be greater than variableCostPerUnit)"),
|
|
4389
|
+
salesVolume: z.number().optional().describe("Optional actual/planned unit sales, to compute profit and margin of safety at that volume")
|
|
4390
|
+
},
|
|
4391
|
+
async ({ fixedCosts, variableCostPerUnit, pricePerUnit, salesVolume }) => {
|
|
4392
|
+
const result = _calculateBreakEvenMcp(fixedCosts, variableCostPerUnit, pricePerUnit, salesVolume);
|
|
4393
|
+
if ("error" in result) return errText(result);
|
|
4394
|
+
return text(JSON.stringify(result, null, 2));
|
|
4395
|
+
}
|
|
4396
|
+
);
|
|
4397
|
+
function _calculateStringDistanceMcp(a, b, mode, caseSensitive) {
|
|
4398
|
+
const MAX_LEN = 5e3;
|
|
4399
|
+
if (a.length > MAX_LEN || b.length > MAX_LEN) return { error: `Strings must be at most ${MAX_LEN} characters` };
|
|
4400
|
+
const s1 = caseSensitive ? a : a.toLowerCase();
|
|
4401
|
+
const s2 = caseSensitive ? b : b.toLowerCase();
|
|
4402
|
+
const m = s1.length;
|
|
4403
|
+
const n = s2.length;
|
|
4404
|
+
const maxLength = Math.max(m, n);
|
|
4405
|
+
if (m === 0 || n === 0) {
|
|
4406
|
+
return { a, b, distance: maxLength, similarity: maxLength === 0 ? 1 : 0, maxLength, mode };
|
|
4407
|
+
}
|
|
4408
|
+
const dp = Array.from({ length: m + 1 }, () => new Array(n + 1).fill(0));
|
|
4409
|
+
for (let i = 0; i <= m; i++) dp[i][0] = i;
|
|
4410
|
+
for (let j = 0; j <= n; j++) dp[0][j] = j;
|
|
4411
|
+
for (let i = 1; i <= m; i++) {
|
|
4412
|
+
for (let j = 1; j <= n; j++) {
|
|
4413
|
+
const cost = s1[i - 1] === s2[j - 1] ? 0 : 1;
|
|
4414
|
+
dp[i][j] = Math.min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + cost);
|
|
4415
|
+
if (mode === "damerau" && i > 1 && j > 1 && s1[i - 1] === s2[j - 2] && s1[i - 2] === s2[j - 1]) {
|
|
4416
|
+
dp[i][j] = Math.min(dp[i][j], dp[i - 2][j - 2] + 1);
|
|
4417
|
+
}
|
|
4418
|
+
}
|
|
4419
|
+
}
|
|
4420
|
+
const distance = dp[m][n];
|
|
4421
|
+
const similarity = maxLength === 0 ? 1 : Math.round((1 - distance / maxLength) * 1e4) / 1e4;
|
|
4422
|
+
return { a, b, distance, similarity, maxLength, mode };
|
|
4423
|
+
}
|
|
4424
|
+
server.tool(
|
|
4425
|
+
"calculate_string_distance",
|
|
4426
|
+
'Compute the Levenshtein edit distance between two strings: the minimum number of single-character insertions, deletions, and substitutions needed to turn a into b, plus a normalized 0-1 similarity ratio. Pass mode "damerau" to also count an adjacent-character transposition as a single edit (optimal-string-alignment variant, not unrestricted Damerau-Levenshtein).',
|
|
4427
|
+
{
|
|
4428
|
+
a: z.string().describe("The first string (max 5000 characters)"),
|
|
4429
|
+
b: z.string().describe("The second string (max 5000 characters)"),
|
|
4430
|
+
mode: z.enum(["levenshtein", "damerau"]).default("levenshtein").describe("levenshtein counts a transposition as 2 edits; damerau counts it as 1"),
|
|
4431
|
+
caseSensitive: z.boolean().default(true)
|
|
4432
|
+
},
|
|
4433
|
+
async ({ a, b, mode, caseSensitive }) => {
|
|
4434
|
+
const result = _calculateStringDistanceMcp(a, b, mode, caseSensitive);
|
|
4435
|
+
if ("error" in result) return errText(result);
|
|
4436
|
+
return text(JSON.stringify(result, null, 2));
|
|
4437
|
+
}
|
|
4438
|
+
);
|
|
4345
4439
|
var transport = new StdioServerTransport();
|
|
4346
4440
|
await server.connect(transport);
|
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.26.0",
|
|
4
|
+
"description": "MCP server exposing 139 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",
|