@utilix-tech/mcp 0.4.1 → 0.5.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/README.md +5 -3
- package/dist/index.js +98 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @utilix-tech/mcp
|
|
2
2
|
|
|
3
|
-
MCP server exposing
|
|
3
|
+
MCP server exposing 99 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
|
|
|
@@ -150,13 +150,14 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
|
|
|
150
150
|
| `convert_bytes` | Convert between B, KB, MB, GB, TB, KiB, MiB, GiB, TiB |
|
|
151
151
|
| `px_to_units` | Convert pixels to rem, em, pt, and vw |
|
|
152
152
|
|
|
153
|
-
### API / Network (
|
|
153
|
+
### API / Network (5 tools)
|
|
154
154
|
| Tool | Description |
|
|
155
155
|
|------|-------------|
|
|
156
156
|
| `decode_jwt` | Decode a JWT: header, payload, and expiry |
|
|
157
157
|
| `build_curl` | Build a cURL command from method, URL, headers, and body |
|
|
158
158
|
| `curl_to_code` | Convert a cURL command to fetch, axios, Python, Go, PHP, or Ruby |
|
|
159
159
|
| `cors_headers` | Generate CORS response headers for a configuration |
|
|
160
|
+
| `parse_har` | Parse a DevTools .har network export into requests and summary stats |
|
|
160
161
|
|
|
161
162
|
### Color (4 tools)
|
|
162
163
|
| Tool | Description |
|
|
@@ -177,13 +178,14 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
|
|
|
177
178
|
| `parse_env` | Parse a .env file and return all key-value pairs |
|
|
178
179
|
| `parse_docker_image` | Parse a Docker image reference into its components |
|
|
179
180
|
|
|
180
|
-
### Data (
|
|
181
|
+
### Data (5 tools)
|
|
181
182
|
| Tool | Description |
|
|
182
183
|
|------|-------------|
|
|
183
184
|
| `validate_yaml` | Validate YAML syntax |
|
|
184
185
|
| `toml_to_json` | Convert TOML to JSON |
|
|
185
186
|
| `xml_to_json` | Convert XML to JSON |
|
|
186
187
|
| `parse_csv` | Parse a CSV string and return the data as JSON |
|
|
188
|
+
| `format_ndjson` | Validate and pretty-print newline-delimited JSON (NDJSON) |
|
|
187
189
|
|
|
188
190
|
### CSS (2 tools)
|
|
189
191
|
| Tool | Description |
|
package/dist/index.js
CHANGED
|
@@ -1398,5 +1398,103 @@ server.tool("read_image_info", "Read image format, dimensions, and color info di
|
|
|
1398
1398
|
const bytes = new Uint8Array(Buffer.from(image_base64.replace(/^data:.*;base64,/, ""), "base64"));
|
|
1399
1399
|
return { content: [{ type: "text", text: JSON.stringify(_readImageInfo(bytes), null, 2) }] };
|
|
1400
1400
|
});
|
|
1401
|
+
function _parseHar(input) {
|
|
1402
|
+
if (!input || !input.trim()) return { error: "Input is empty" };
|
|
1403
|
+
let data;
|
|
1404
|
+
try {
|
|
1405
|
+
data = JSON.parse(input);
|
|
1406
|
+
} catch (e) {
|
|
1407
|
+
return { error: `Invalid JSON: ${e instanceof Error ? e.message : String(e)}` };
|
|
1408
|
+
}
|
|
1409
|
+
if (typeof data !== "object" || data === null || !("log" in data)) {
|
|
1410
|
+
return { error: 'Not a valid HAR file: missing "log" property' };
|
|
1411
|
+
}
|
|
1412
|
+
const log = data.log;
|
|
1413
|
+
if (typeof log !== "object" || log === null || !Array.isArray(log.entries)) {
|
|
1414
|
+
return { error: 'Not a valid HAR file: "log.entries" must be an array' };
|
|
1415
|
+
}
|
|
1416
|
+
const logObj = log;
|
|
1417
|
+
const entries = [];
|
|
1418
|
+
const methods = {};
|
|
1419
|
+
const statusCodes = {};
|
|
1420
|
+
let totalSize = 0;
|
|
1421
|
+
let totalTime = 0;
|
|
1422
|
+
let failedRequests = 0;
|
|
1423
|
+
for (const raw of logObj.entries) {
|
|
1424
|
+
if (typeof raw !== "object" || raw === null) continue;
|
|
1425
|
+
const e = raw;
|
|
1426
|
+
const request = e.request ?? {};
|
|
1427
|
+
const response = e.response ?? {};
|
|
1428
|
+
const content = response.content ?? {};
|
|
1429
|
+
const method = typeof request.method === "string" ? request.method : "GET";
|
|
1430
|
+
const url = typeof request.url === "string" ? request.url : "";
|
|
1431
|
+
const status = typeof response.status === "number" ? response.status : 0;
|
|
1432
|
+
const statusText = typeof response.statusText === "string" ? response.statusText : "";
|
|
1433
|
+
const httpVersion = typeof response.httpVersion === "string" ? response.httpVersion : "";
|
|
1434
|
+
const mimeType = typeof content.mimeType === "string" ? content.mimeType : "";
|
|
1435
|
+
const size = typeof content.size === "number" && content.size > 0 ? content.size : 0;
|
|
1436
|
+
const time = typeof e.time === "number" ? e.time : 0;
|
|
1437
|
+
const startedDateTime = typeof e.startedDateTime === "string" ? e.startedDateTime : "";
|
|
1438
|
+
entries.push({ method, url, status, statusText, httpVersion, mimeType, size, time, startedDateTime });
|
|
1439
|
+
methods[method] = (methods[method] ?? 0) + 1;
|
|
1440
|
+
if (status > 0) statusCodes[String(status)] = (statusCodes[String(status)] ?? 0) + 1;
|
|
1441
|
+
totalSize += size;
|
|
1442
|
+
totalTime += time;
|
|
1443
|
+
if (status === 0 || status >= 400) failedRequests++;
|
|
1444
|
+
}
|
|
1445
|
+
const totalRequests = entries.length;
|
|
1446
|
+
const avgTime = totalRequests > 0 ? Math.round(totalTime / totalRequests * 100) / 100 : 0;
|
|
1447
|
+
const creator = logObj.creator ?? {};
|
|
1448
|
+
return {
|
|
1449
|
+
version: typeof logObj.version === "string" ? logObj.version : "",
|
|
1450
|
+
creator: { name: typeof creator.name === "string" ? creator.name : "", version: typeof creator.version === "string" ? creator.version : "" },
|
|
1451
|
+
entries,
|
|
1452
|
+
summary: { totalRequests, totalSize, totalTime, avgTime, failedRequests, methods, statusCodes }
|
|
1453
|
+
};
|
|
1454
|
+
}
|
|
1455
|
+
function _validateNdjson(input) {
|
|
1456
|
+
const rawLines = input.split("\n");
|
|
1457
|
+
const lines = [];
|
|
1458
|
+
let validCount = 0;
|
|
1459
|
+
rawLines.forEach((raw, idx) => {
|
|
1460
|
+
if (raw.trim() === "") return;
|
|
1461
|
+
const lineNum = idx + 1;
|
|
1462
|
+
try {
|
|
1463
|
+
JSON.parse(raw);
|
|
1464
|
+
lines.push({ line: lineNum, raw, valid: true });
|
|
1465
|
+
validCount++;
|
|
1466
|
+
} catch (e) {
|
|
1467
|
+
lines.push({ line: lineNum, raw, valid: false, error: e instanceof Error ? e.message : String(e) });
|
|
1468
|
+
}
|
|
1469
|
+
});
|
|
1470
|
+
return { valid: lines.length > 0 && validCount === lines.length, totalLines: lines.length, validLines: validCount, invalidLines: lines.length - validCount, lines };
|
|
1471
|
+
}
|
|
1472
|
+
server.tool(
|
|
1473
|
+
"parse_har",
|
|
1474
|
+
"Parse a browser DevTools .har network export into a readable list of requests (method, URL, status, size, timing) plus aggregate summary stats.",
|
|
1475
|
+
{ har: z.string().describe("Raw HAR file contents (JSON)") },
|
|
1476
|
+
async ({ har }) => {
|
|
1477
|
+
const result = _parseHar(har);
|
|
1478
|
+
if ("error" in result) return errText(result);
|
|
1479
|
+
return text(JSON.stringify(result, null, 2));
|
|
1480
|
+
}
|
|
1481
|
+
);
|
|
1482
|
+
server.tool(
|
|
1483
|
+
"format_ndjson",
|
|
1484
|
+
"Validate newline-delimited JSON (NDJSON/JSON Lines), report per-line errors, and pretty-print each valid line.",
|
|
1485
|
+
{
|
|
1486
|
+
input: z.string().describe("NDJSON content: one JSON value per line"),
|
|
1487
|
+
indent: z.number().int().default(2).describe("Spaces per indent level")
|
|
1488
|
+
},
|
|
1489
|
+
async ({ input, indent }) => {
|
|
1490
|
+
const validation = _validateNdjson(input);
|
|
1491
|
+
if (!validation.valid) {
|
|
1492
|
+
const firstError = validation.lines.find((l) => !l.valid);
|
|
1493
|
+
return errText({ error: firstError ? `Line ${firstError.line}: ${firstError.error}` : "Invalid NDJSON" });
|
|
1494
|
+
}
|
|
1495
|
+
const formatted = validation.lines.map((l) => JSON.stringify(JSON.parse(l.raw), null, indent)).join("\n");
|
|
1496
|
+
return text(formatted);
|
|
1497
|
+
}
|
|
1498
|
+
);
|
|
1401
1499
|
var transport = new StdioServerTransport();
|
|
1402
1500
|
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.5.0",
|
|
4
|
+
"description": "MCP server exposing 99 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",
|