@utilix-tech/mcp 0.38.0 → 0.39.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 +5 -3
- package/dist/index.js +119 -0
- package/package.json +1 -1
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.39.0
|
|
6
|
+
- Add `compare_unit_prices` tool: compare two or more package options by price and quantity to find the true cost per unit, flag the cheapest, and report how much more expensive each other option is by percentage.
|
|
7
|
+
- Add `csv_to_sql_insert` tool: convert CSV data with a header row into parameterless SQL INSERT statements, with basic type inference (numbers/booleans unquoted, empty cells NULL) and ANSI/MySQL identifier quoting.
|
|
8
|
+
|
|
5
9
|
## 0.38.0
|
|
6
10
|
- Add `check_set_cookie_header` tool: parse a Set-Cookie header value and validate its attribute combination, flagging SameSite=None missing Secure, __Host-/__Secure- prefix violations, a missing Secure attribute, and a Max-Age past 400 days.
|
|
7
11
|
- Add `test_gitignore_patterns` tool: test a list of paths against a .gitignore file's patterns, following git's last-match-wins and negation rules, and report which pattern and line number decided each path's outcome.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @utilix-tech/mcp
|
|
2
2
|
|
|
3
|
-
MCP server exposing
|
|
3
|
+
MCP server exposing 163 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
|
|
|
@@ -157,7 +157,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
|
|
|
157
157
|
| `convert_timezone` | Convert a date/time between timezones |
|
|
158
158
|
| `convert_iso8601_duration` | Parse an ISO 8601 duration into components and total seconds, or format seconds into a duration string |
|
|
159
159
|
|
|
160
|
-
### Units (
|
|
160
|
+
### Units (24 tools)
|
|
161
161
|
| Tool | Description |
|
|
162
162
|
|------|-------------|
|
|
163
163
|
| `convert_bytes` | Convert between B, KB, MB, GB, TB, KiB, MiB, GiB, TiB |
|
|
@@ -183,6 +183,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
|
|
|
183
183
|
| `calculate_emi` | Compute the Equated Monthly Installment for a loan from principal, annual rate, and tenure in years or months, with a year-by-year principal/interest breakdown |
|
|
184
184
|
| `calculate_savings_goal` | Solve for months to reach a savings goal at a fixed monthly contribution, or the monthly contribution required to hit a goal by a target month count |
|
|
185
185
|
| `calculate_roi` | Compute return on investment percent from an initial and final value, plus the annualized (CAGR) return given an optional holding period in years |
|
|
186
|
+
| `compare_unit_prices` | Compare two or more package options by price and quantity to find the true cost per unit, flag the cheapest, and report how much more expensive each other option is |
|
|
186
187
|
|
|
187
188
|
### API / Network (15 tools)
|
|
188
189
|
| Tool | Description |
|
|
@@ -227,7 +228,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
|
|
|
227
228
|
| `lint_conventional_commit` | Lint a commit message against the Conventional Commits v1.0.0 spec: header format, blank-line separation, footer tokens, and BREAKING CHANGE casing |
|
|
228
229
|
| `test_gitignore_patterns` | Test a list of paths against a .gitignore file's patterns, following git's last-match-wins and negation rules |
|
|
229
230
|
|
|
230
|
-
### Data (
|
|
231
|
+
### Data (9 tools)
|
|
231
232
|
| Tool | Description |
|
|
232
233
|
|------|-------------|
|
|
233
234
|
| `validate_yaml` | Validate YAML syntax |
|
|
@@ -238,6 +239,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
|
|
|
238
239
|
| `diff_env_example` | Diff a .env file against its .env.example template: flags keys missing from either side, plus empty placeholder values |
|
|
239
240
|
| `parse_markdown_front_matter` | Split a Markdown document into its YAML front matter fields and body content |
|
|
240
241
|
| `generate_markdown_toc` | Scan a Markdown document's ATX headings and build a nested table of contents with GitHub-style anchor slugs |
|
|
242
|
+
| `csv_to_sql_insert` | Convert CSV data with a header row into parameterless SQL INSERT statements, with basic type inference and ANSI/MySQL identifier quoting |
|
|
241
243
|
|
|
242
244
|
### CSS (2 tools)
|
|
243
245
|
| Tool | Description |
|
package/dist/index.js
CHANGED
|
@@ -6596,5 +6596,124 @@ server.tool(
|
|
|
6596
6596
|
return text(JSON.stringify(result, null, 2));
|
|
6597
6597
|
}
|
|
6598
6598
|
);
|
|
6599
|
+
function _compareUnitPricesMcp(items) {
|
|
6600
|
+
if (!Array.isArray(items) || items.length < 2) {
|
|
6601
|
+
return { error: "At least 2 items are required to compare" };
|
|
6602
|
+
}
|
|
6603
|
+
for (const item of items) {
|
|
6604
|
+
if (!item.label || typeof item.label !== "string") {
|
|
6605
|
+
return { error: "Each item must have a non-empty label" };
|
|
6606
|
+
}
|
|
6607
|
+
if (typeof item.price !== "number" || !Number.isFinite(item.price) || item.price <= 0) {
|
|
6608
|
+
return { error: `Item "${item.label}" must have a price greater than zero` };
|
|
6609
|
+
}
|
|
6610
|
+
if (typeof item.quantity !== "number" || !Number.isFinite(item.quantity) || item.quantity <= 0) {
|
|
6611
|
+
return { error: `Item "${item.label}" must have a quantity greater than zero` };
|
|
6612
|
+
}
|
|
6613
|
+
}
|
|
6614
|
+
const round4 = (n) => Math.round(n * 1e4) / 1e4;
|
|
6615
|
+
const unitPrices = items.map((item) => item.price / item.quantity);
|
|
6616
|
+
const bestUnitPrice = Math.min(...unitPrices);
|
|
6617
|
+
const results = items.map((item, i) => ({
|
|
6618
|
+
label: item.label,
|
|
6619
|
+
price: round4(item.price),
|
|
6620
|
+
quantity: round4(item.quantity),
|
|
6621
|
+
unitPrice: round4(unitPrices[i]),
|
|
6622
|
+
isBest: unitPrices[i] === bestUnitPrice,
|
|
6623
|
+
percentMoreThanBest: round4((unitPrices[i] - bestUnitPrice) / bestUnitPrice * 100)
|
|
6624
|
+
}));
|
|
6625
|
+
const bestLabel = results.find((r) => r.isBest).label;
|
|
6626
|
+
return { items: results, bestLabel };
|
|
6627
|
+
}
|
|
6628
|
+
server.tool(
|
|
6629
|
+
"compare_unit_prices",
|
|
6630
|
+
"Compare two or more package options by price and quantity to find the true cost per unit (price / quantity) for each, flag the cheapest, and report how much more expensive each other option is by percentage. Unit-agnostic: pass quantity in whatever unit makes the options comparable (grams, litres, item count, etc.), no conversion is done.",
|
|
6631
|
+
{
|
|
6632
|
+
items: z.array(z.object({
|
|
6633
|
+
label: z.string().describe("Name for this option"),
|
|
6634
|
+
price: z.number().describe("Total price of this option (must be greater than zero)"),
|
|
6635
|
+
quantity: z.number().describe("Quantity in whatever unit makes options comparable (must be greater than zero)")
|
|
6636
|
+
})).min(2).describe("Two or more package options to compare")
|
|
6637
|
+
},
|
|
6638
|
+
async ({ items }) => {
|
|
6639
|
+
const result = _compareUnitPricesMcp(items);
|
|
6640
|
+
if ("error" in result) return errText(result);
|
|
6641
|
+
return text(JSON.stringify(result, null, 2));
|
|
6642
|
+
}
|
|
6643
|
+
);
|
|
6644
|
+
function _parseCsvRowForSqlMcp(line, delimiter) {
|
|
6645
|
+
const fields = [];
|
|
6646
|
+
let cur = "";
|
|
6647
|
+
let inQuote = false;
|
|
6648
|
+
for (let i = 0; i < line.length; i++) {
|
|
6649
|
+
if (line[i] === '"') {
|
|
6650
|
+
if (inQuote && line[i + 1] === '"') {
|
|
6651
|
+
cur += '"';
|
|
6652
|
+
i++;
|
|
6653
|
+
} else inQuote = !inQuote;
|
|
6654
|
+
} else if (line[i] === delimiter && !inQuote) {
|
|
6655
|
+
fields.push(cur);
|
|
6656
|
+
cur = "";
|
|
6657
|
+
} else {
|
|
6658
|
+
cur += line[i];
|
|
6659
|
+
}
|
|
6660
|
+
}
|
|
6661
|
+
fields.push(cur);
|
|
6662
|
+
return fields;
|
|
6663
|
+
}
|
|
6664
|
+
function _quoteSqlIdentifierMcp(name, dialect) {
|
|
6665
|
+
if (dialect === "mysql") return "`" + name.replace(/`/g, "``") + "`";
|
|
6666
|
+
return '"' + name.replace(/"/g, '""') + '"';
|
|
6667
|
+
}
|
|
6668
|
+
function _formatSqlValueMcp(raw) {
|
|
6669
|
+
const trimmed = raw.trim();
|
|
6670
|
+
if (trimmed === "") return "NULL";
|
|
6671
|
+
if (/^-?\d+(\.\d+)?$/.test(trimmed)) return trimmed;
|
|
6672
|
+
if (/^(true|false)$/i.test(trimmed)) return trimmed.toLowerCase();
|
|
6673
|
+
return "'" + trimmed.replace(/'/g, "''") + "'";
|
|
6674
|
+
}
|
|
6675
|
+
function _csvToSqlInsertMcp(input, tableName, dialect, batchSize) {
|
|
6676
|
+
if (!input || input.trim() === "") return { error: "Input is empty" };
|
|
6677
|
+
const lines = input.replace(/\r\n/g, "\n").split("\n").filter((l) => l.trim() !== "");
|
|
6678
|
+
if (lines.length === 0) return { error: "No data found" };
|
|
6679
|
+
const allRows = lines.map((l) => _parseCsvRowForSqlMcp(l, ","));
|
|
6680
|
+
const headers = allRows[0].map((h) => h.trim());
|
|
6681
|
+
const rows = allRows.slice(1);
|
|
6682
|
+
const table = (tableName ?? "").trim() || "my_table";
|
|
6683
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(table)) {
|
|
6684
|
+
return { error: "tableName must start with a letter or underscore and contain only letters, digits, and underscores" };
|
|
6685
|
+
}
|
|
6686
|
+
const dial = dialect === "mysql" ? "mysql" : "ansi";
|
|
6687
|
+
const batch = batchSize !== void 0 && Number.isFinite(batchSize) && batchSize > 0 ? Math.floor(batchSize) : 1;
|
|
6688
|
+
const quotedTable = _quoteSqlIdentifierMcp(table, dial);
|
|
6689
|
+
const quotedColumns = headers.map((h) => _quoteSqlIdentifierMcp(h, dial)).join(", ");
|
|
6690
|
+
const statements = [];
|
|
6691
|
+
for (let i = 0; i < rows.length; i += batch) {
|
|
6692
|
+
const chunk = rows.slice(i, i + batch);
|
|
6693
|
+
const tuples = chunk.map((row) => "(" + headers.map((_, idx) => _formatSqlValueMcp(row[idx] ?? "")).join(", ") + ")");
|
|
6694
|
+
statements.push(`INSERT INTO ${quotedTable} (${quotedColumns}) VALUES ${tuples.join(", ")};`);
|
|
6695
|
+
}
|
|
6696
|
+
return {
|
|
6697
|
+
sql: statements.join("\n"),
|
|
6698
|
+
rowCount: rows.length,
|
|
6699
|
+
columnCount: headers.length,
|
|
6700
|
+
columns: headers
|
|
6701
|
+
};
|
|
6702
|
+
}
|
|
6703
|
+
server.tool(
|
|
6704
|
+
"csv_to_sql_insert",
|
|
6705
|
+
"Paste CSV data and get parameterless SQL INSERT statements back, with basic type inference: unquoted for integers/decimals and true/false, NULL for empty cells, single-quoted (with '' escaping) for everything else. Column and table identifiers are quoted per the chosen dialect so reserved words and mixed-case names round-trip safely.",
|
|
6706
|
+
{
|
|
6707
|
+
csv: z.string().describe("CSV data with a header row"),
|
|
6708
|
+
tableName: z.string().optional().describe('Target table name, must be a valid SQL identifier (default "my_table")'),
|
|
6709
|
+
dialect: z.enum(["ansi", "mysql"]).optional().describe('Identifier quoting style: ANSI double quotes or MySQL backticks (default "ansi")'),
|
|
6710
|
+
batchSize: z.number().optional().describe("Rows per INSERT statement (default 1, one statement per row)")
|
|
6711
|
+
},
|
|
6712
|
+
async ({ csv, tableName, dialect, batchSize }) => {
|
|
6713
|
+
const result = _csvToSqlInsertMcp(csv, tableName, dialect, batchSize);
|
|
6714
|
+
if ("error" in result) return errText(result);
|
|
6715
|
+
return text(JSON.stringify(result, null, 2));
|
|
6716
|
+
}
|
|
6717
|
+
);
|
|
6599
6718
|
var transport = new StdioServerTransport();
|
|
6600
6719
|
await server.connect(transport);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilix-tech/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"description": "MCP server exposing 152 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",
|