@utilix-tech/mcp 0.39.0 → 0.40.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,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.40.0
6
+ - Add `generate_sri_hash` tool: compute SHA-256/384/512 Subresource Integrity hashes for a script or stylesheet's content, formatted as the `<algorithm>-<base64>` string an HTML `integrity` attribute expects.
7
+ - Add `analyze_email_headers` tool: parse a raw email header block into structured From/To/Subject fields, the Received hop chain in order, and SPF/DKIM/DMARC results from an Authentication-Results header.
8
+
5
9
  ## 0.39.0
6
10
  - 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
11
  - 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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @utilix-tech/mcp
2
2
 
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.
3
+ MCP server exposing 165 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
 
@@ -110,13 +110,14 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
110
110
  | `base62_encode` | Encode text as Base62 (alphanumeric, URL-safe) |
111
111
  | `base62_decode` | Decode a Base62 string back to text |
112
112
 
113
- ### Hashing (4 tools)
113
+ ### Hashing (5 tools)
114
114
  | Tool | Description |
115
115
  |------|-------------|
116
116
  | `hash` | Hash a string with MD5, SHA-1, SHA-256, SHA-384, or SHA-512 |
117
117
  | `hash_all` | Hash a string with all algorithms at once |
118
118
  | `bcrypt_hash` | Hash a password using bcrypt |
119
119
  | `bcrypt_verify` | Verify a password against a bcrypt hash |
120
+ | `generate_sri_hash` | Compute a Subresource Integrity hash (SHA-256/384/512) for a script or stylesheet's content, formatted for an HTML `integrity` attribute |
120
121
 
121
122
  ### Generators (6 tools)
122
123
  | Tool | Description |
@@ -185,7 +186,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
185
186
  | `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
187
  | `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 |
187
188
 
188
- ### API / Network (15 tools)
189
+ ### API / Network (16 tools)
189
190
  | Tool | Description |
190
191
  |------|-------------|
191
192
  | `decode_jwt` | Decode a JWT: header, payload, and expiry |
@@ -203,6 +204,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
203
204
  | `parse_ipv6_address` | Expand an IPv6 address to its full 8-group form or compress it to its RFC 5952 canonical shortest form, classify its address type, and handle an embedded IPv4 suffix or zone ID |
204
205
  | `build_link_header` | Build and explain an HTTP Link response header from URL/rel pairs (preload, preconnect, prefetch, canonical, pagination, etc.) |
205
206
  | `check_set_cookie_header` | Parse a Set-Cookie header and validate its attribute combination: SameSite=None requires Secure, __Host-/__Secure- prefix rules, missing Secure, overly long Max-Age |
207
+ | `analyze_email_headers` | Parse a raw email header block into structured fields, the Received hop chain, and SPF/DKIM/DMARC results from an Authentication-Results header |
206
208
 
207
209
  ### Color (4 tools)
208
210
  | Tool | Description |
package/dist/index.js CHANGED
@@ -6715,5 +6715,120 @@ server.tool(
6715
6715
  return text(JSON.stringify(result, null, 2));
6716
6716
  }
6717
6717
  );
6718
+ var _SRI_ALGORITHMS_MCP = ["SHA-256", "SHA-384", "SHA-512"];
6719
+ var _SRI_NODE_ALG_MAP_MCP = {
6720
+ "SHA-256": "sha256",
6721
+ "SHA-384": "sha384",
6722
+ "SHA-512": "sha512"
6723
+ };
6724
+ function _generateSriAllMcp(content) {
6725
+ if (!content) return { error: "Content is required" };
6726
+ const results = _SRI_ALGORITHMS_MCP.map((algorithm) => {
6727
+ const nodeAlg = _SRI_NODE_ALG_MAP_MCP[algorithm];
6728
+ const base64 = createHash(nodeAlg).update(content, "utf8").digest("base64");
6729
+ return { algorithm, base64, integrity: `${nodeAlg}-${base64}` };
6730
+ });
6731
+ return { results };
6732
+ }
6733
+ server.tool(
6734
+ "generate_sri_hash",
6735
+ "Compute a Subresource Integrity (SRI) hash for a script or stylesheet's content: digest it with SHA-256, SHA-384, and SHA-512 and return each as the `<algorithm>-<base64>` string an HTML `integrity` attribute expects. Returns all three algorithms at once.",
6736
+ {
6737
+ content: z.string().min(1).describe("The exact file/script content to hash, byte-for-byte")
6738
+ },
6739
+ async ({ content }) => {
6740
+ const result = _generateSriAllMcp(content);
6741
+ if ("error" in result) return errText(result);
6742
+ return text(JSON.stringify(result, null, 2));
6743
+ }
6744
+ );
6745
+ function _analyzeEmailHeadersMcp(raw) {
6746
+ if (!raw || !raw.trim()) return { error: "Raw email header text is required" };
6747
+ const normalized = raw.replace(/\r\n/g, "\n");
6748
+ const blockEnd = normalized.indexOf("\n\n");
6749
+ const headerBlock = blockEnd === -1 ? normalized : normalized.slice(0, blockEnd);
6750
+ const rawLines = headerBlock.split("\n");
6751
+ const unfolded = [];
6752
+ for (const line of rawLines) {
6753
+ if (/^[ \t]/.test(line) && unfolded.length > 0) {
6754
+ unfolded[unfolded.length - 1] += " " + line.trim();
6755
+ } else if (line.trim() !== "") {
6756
+ unfolded.push(line);
6757
+ }
6758
+ }
6759
+ const headers = [];
6760
+ for (const line of unfolded) {
6761
+ const colonIdx = line.indexOf(":");
6762
+ if (colonIdx === -1) continue;
6763
+ const name = line.slice(0, colonIdx).trim();
6764
+ const value = line.slice(colonIdx + 1).trim();
6765
+ if (!name) continue;
6766
+ headers.push({ name, value });
6767
+ }
6768
+ if (headers.length === 0) {
6769
+ return { error: 'No parseable headers found \u2014 expected lines like "From: ..." or "Received: ..."' };
6770
+ }
6771
+ const findFirst = (name) => headers.find((h) => h.name.toLowerCase() === name.toLowerCase())?.value ?? null;
6772
+ const findAll = (name) => headers.filter((h) => h.name.toLowerCase() === name.toLowerCase());
6773
+ const receivedHops = findAll("received").map((h, i) => {
6774
+ const fromMatch = h.value.match(/from\s+([^\s;]+(?:\s*\([^)]*\))?)/i);
6775
+ const byMatch = h.value.match(/\bby\s+([^\s;]+)/i);
6776
+ const segments = h.value.split(";");
6777
+ const date = segments.length > 1 ? segments[segments.length - 1].trim() : null;
6778
+ return {
6779
+ index: i + 1,
6780
+ raw: h.value,
6781
+ from: fromMatch ? fromMatch[1].trim() : null,
6782
+ by: byMatch ? byMatch[1].trim() : null,
6783
+ date: date || null
6784
+ };
6785
+ });
6786
+ const authResultsHeader = findFirst("authentication-results");
6787
+ const authResults = [];
6788
+ if (authResultsHeader) {
6789
+ const re = /\b(spf|dkim|dmarc)=(\w+)/gi;
6790
+ let m;
6791
+ while ((m = re.exec(authResultsHeader)) !== null) {
6792
+ authResults.push({ mechanism: m[1].toLowerCase(), result: m[2].toLowerCase() });
6793
+ }
6794
+ }
6795
+ const findAuth = (mechanism) => authResults.find((a) => a.mechanism === mechanism)?.result ?? null;
6796
+ const warnings = [];
6797
+ if (receivedHops.length === 0) {
6798
+ warnings.push("No Received headers found \u2014 this may be a partial header block rather than a full raw source.");
6799
+ }
6800
+ if (!authResultsHeader) {
6801
+ warnings.push("No Authentication-Results header found \u2014 SPF/DKIM/DMARC cannot be determined from this header block alone.");
6802
+ }
6803
+ return {
6804
+ headers,
6805
+ from: findFirst("from"),
6806
+ to: findFirst("to"),
6807
+ subject: findFirst("subject"),
6808
+ date: findFirst("date"),
6809
+ messageId: findFirst("message-id"),
6810
+ returnPath: findFirst("return-path"),
6811
+ replyTo: findFirst("reply-to"),
6812
+ receivedHops,
6813
+ hopCount: receivedHops.length,
6814
+ authResults,
6815
+ spf: findAuth("spf"),
6816
+ dkim: findAuth("dkim"),
6817
+ dmarc: findAuth("dmarc"),
6818
+ warnings
6819
+ };
6820
+ }
6821
+ server.tool(
6822
+ "analyze_email_headers",
6823
+ `Parse a raw email header block (e.g. Gmail's "Show original", or the headers from a .eml file) into structured fields, the Received hop chain in the order they appear, and any SPF/DKIM/DMARC verdicts already present in an Authentication-Results header. Never performs a live DNS/SPF/DKIM check, it only reports what the pasted headers already claim.`,
6824
+ {
6825
+ headers: z.string().min(1).describe("The raw email header block (From/To/Received/Authentication-Results/...)")
6826
+ },
6827
+ async ({ headers }) => {
6828
+ const result = _analyzeEmailHeadersMcp(headers);
6829
+ if ("error" in result) return errText(result);
6830
+ return text(JSON.stringify(result, null, 2));
6831
+ }
6832
+ );
6718
6833
  var transport = new StdioServerTransport();
6719
6834
  await server.connect(transport);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilix-tech/mcp",
3
- "version": "0.39.0",
3
+ "version": "0.40.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",