@utilix-tech/mcp 0.68.0 → 0.70.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,14 @@
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.70.0
6
+ - Add `generate_hotp`, `generate_totp` tools: generate an HOTP code (RFC 4226) for a counter value, or the current TOTP code (RFC 6238) plus seconds until rotation, from a base32-encoded shared secret, supporting SHA-1/SHA-256/SHA-512 and 6-8 digit codes.
7
+ - Add `calculate_tax_equivalent_yield` tool: convert between a tax-free municipal bond yield and its taxable equivalent given a marginal federal (plus optional state) tax rate, in both directions.
8
+
9
+ ## 0.69.0
10
+ - Add `parse_commit_trailers` tool: parse a commit message's trailer block (Co-authored-by, Signed-off-by, Fixes, Reviewed-by, etc.) per git's RFC 822-style trailer convention, returning each trailer's key and value plus the body with the trailer block removed.
11
+ - Add `extract_markdown_footnotes` tool: extract every Markdown-Extra-style footnote reference and definition from a document, flagging references with no matching definition and definitions that are never referenced.
12
+
5
13
  ## 0.68.0
6
14
  - Add `build_robots_meta_tag`, `parse_robots_meta_tag` tools: build a `<meta name="robots" content="...">` tag from the same directive vocabulary as X-Robots-Tag, optionally scoped to a crawler via the name attribute, or parse an existing tag into the same shape.
7
15
  - Add `extract_svg_sprite_symbols` tool: parse an SVG sprite sheet's `<symbol>` definitions and list each one's id, viewBox, width, and height, alongside a ready-to-paste `<use href="#id"></use>` usage snippet.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @utilix-tech/mcp
2
2
 
3
- MCP server exposing 231 developer utility tools to Claude, Cursor, VS Code Copilot, and any [Model Context Protocol](https://modelcontextprotocol.io) compatible AI assistant.
3
+ MCP server exposing 236 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
 
@@ -179,6 +179,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
179
179
  | `calculate_time_value` | Convert between present and future value (time value of money) in either direction |
180
180
  | `calculate_percentage_change` | Compute the percentage change between two numbers, with absolute change, direction, and multiplier |
181
181
  | `convert_apr_apy` | Convert between a nominal APR and effective APY for a given compounding frequency, in both directions |
182
+ | `calculate_tax_equivalent_yield` | Convert between a tax-free municipal bond yield and its taxable equivalent given a marginal federal (plus optional state) tax rate, in both directions |
182
183
  | `calculate_margin_markup` | Given any two of cost, price, margin percent, and markup percent, solve for the other two plus gross profit |
183
184
  | `calculate_discount` | Solve a sale price, amount saved, or discount percent from any one of them, or stack successive discounts in order |
184
185
  | `convert_subtitles` | Convert subtitles between SubRip (.srt) and WebVTT (.vtt), with an optional time shift to resync every cue |
@@ -211,6 +212,8 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
211
212
  | `decode_jwt` | Decode a JWT: header, payload, and expiry |
212
213
  | `parse_jwks` | Parse a JWKS (or a single bare JWK): type, use, algorithm, key ID, and size per key |
213
214
  | `compute_jwk_thumbprint` | Compute the RFC 7638 canonical thumbprint of a single JWK (SHA-256/384/512) |
215
+ | `generate_hotp` | Generate an HOTP code (RFC 4226) for a counter value from a base32-encoded shared secret |
216
+ | `generate_totp` | Generate the current TOTP code (RFC 6238) from a base32-encoded shared secret, plus seconds until rotation |
214
217
  | `build_curl` | Build a cURL command from method, URL, headers, and body |
215
218
  | `curl_to_code` | Convert a cURL command to fetch, axios, Python, Go, PHP, or Ruby |
216
219
  | `cors_headers` | Generate CORS response headers for a configuration |
@@ -265,7 +268,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
265
268
  | `color_palette` | Generate a color palette from a base color |
266
269
  | `color_shades` | Generate shades or tints from a base color |
267
270
 
268
- ### Code (18 tools)
271
+ ### Code (20 tools)
269
272
  | Tool | Description |
270
273
  |------|-------------|
271
274
  | `format_sql` | Format a SQL query with proper indentation |
@@ -286,6 +289,8 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
286
289
  | `validate_package_exports` | Validate a package.json "exports" field: dual-package (ESM/CJS) misconfigurations like a missing default fallback or a require/import pointing at the wrong extension |
287
290
  | `audit_dependency_ranges` | Classify each package.json dependency's version range type and flag wildcard ranges, the "latest" tag, git/URL/file/link dependencies, and packages listed with conflicting or redundant ranges across sections |
288
291
  | `extract_svg_sprite_symbols` | Parse an SVG sprite sheet's `<symbol>` definitions and list each one's id, viewBox, width, and height, alongside a ready-to-paste `<use href="#id"></use>` usage snippet |
292
+ | `parse_commit_trailers` | Parse a commit message's trailer block (Co-authored-by, Signed-off-by, Fixes, Reviewed-by, etc.) per git's RFC 822-style trailer convention, returning each trailer's key/value plus the body with the trailer block removed |
293
+ | `extract_markdown_footnotes` | Extract every Markdown-Extra-style footnote reference and definition from a document, flagging references with no matching definition and definitions that are never referenced |
289
294
 
290
295
  ### Data (16 tools)
291
296
  | Tool | Description |
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
5
5
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
6
  import { z } from "zod";
7
- import { createHash, randomBytes } from "crypto";
7
+ import { createHash, createHmac, randomBytes } from "crypto";
8
8
  import * as yaml from "js-yaml";
9
9
  import {
10
10
  parseJson,
@@ -11010,5 +11010,259 @@ server.tool(
11010
11010
  return text(JSON.stringify(result, null, 2));
11011
11011
  }
11012
11012
  );
11013
+ var _TRAILER_LINE_REGEX_MCP = /^([A-Za-z][A-Za-z0-9-]*): (.+)$/;
11014
+ var _TRAILER_CONTINUATION_REGEX_MCP = /^[ \t]+\S/;
11015
+ function _parseCommitTrailersMcp(message) {
11016
+ const lines = message.replace(/\r\n/g, "\n").split("\n");
11017
+ while (lines.length > 0 && lines[lines.length - 1].trim() === "") lines.pop();
11018
+ if (lines.length === 0) return { error: "Empty input" };
11019
+ let start = 0;
11020
+ for (let i = lines.length - 1; i >= 0; i--) {
11021
+ if (lines[i].trim() === "") {
11022
+ start = i + 1;
11023
+ break;
11024
+ }
11025
+ }
11026
+ const paragraph = lines.slice(start);
11027
+ const trailers = [];
11028
+ let valid = true;
11029
+ for (const line of paragraph) {
11030
+ const m = line.match(_TRAILER_LINE_REGEX_MCP);
11031
+ if (m) {
11032
+ trailers.push({ key: m[1], value: m[2].trim() });
11033
+ } else if (_TRAILER_CONTINUATION_REGEX_MCP.test(line) && trailers.length > 0) {
11034
+ trailers[trailers.length - 1].value += " " + line.trim();
11035
+ } else {
11036
+ valid = false;
11037
+ break;
11038
+ }
11039
+ }
11040
+ if (!valid || trailers.length === 0) {
11041
+ return { trailers: [], body: lines.join("\n").trim(), hasTrailers: false };
11042
+ }
11043
+ const body = lines.slice(0, start).join("\n").trim();
11044
+ return { trailers, body, hasTrailers: true };
11045
+ }
11046
+ server.tool(
11047
+ "parse_commit_trailers",
11048
+ `Parse a commit message's trailer block (Co-authored-by, Signed-off-by, Fixes, Reviewed-by, etc.) per git's RFC 822-style trailer convention (git-interpret-trailers): the last paragraph of the message, where every line is either a "Key: value" pair or an indented continuation of the previous trailer's value. Returns the trailers plus the message body with the trailer block removed.`,
11049
+ {
11050
+ message: z.string().min(1).describe("The full commit message")
11051
+ },
11052
+ async ({ message }) => {
11053
+ const result = _parseCommitTrailersMcp(message);
11054
+ return text(JSON.stringify(result, null, 2));
11055
+ }
11056
+ );
11057
+ var _FOOTNOTE_DEFINITION_LINE_REGEX_MCP = /^\[\^([^\]]+)\]:\s?(.*)$/;
11058
+ var _FOOTNOTE_CONTINUATION_REGEX_MCP = /^(?: {4}|\t)/;
11059
+ var _FOOTNOTE_REFERENCE_REGEX_MCP = /\[\^([^\]]+)\]/g;
11060
+ function _extractMarkdownFootnotesMcp(markdown) {
11061
+ const trimmed = markdown.trim();
11062
+ if (!trimmed) return { error: "Empty input" };
11063
+ if (!trimmed.includes("[^")) return { error: "No footnote references or definitions found" };
11064
+ const lines = markdown.replace(/\r\n/g, "\n").split("\n");
11065
+ const definitions = [];
11066
+ const definedLabels = /* @__PURE__ */ new Set();
11067
+ const consumed = new Array(lines.length).fill(false);
11068
+ let i = 0;
11069
+ while (i < lines.length) {
11070
+ const match = lines[i].match(_FOOTNOTE_DEFINITION_LINE_REGEX_MCP);
11071
+ if (!match) {
11072
+ i++;
11073
+ continue;
11074
+ }
11075
+ const label = match[1];
11076
+ const textLines = [match[2]];
11077
+ consumed[i] = true;
11078
+ let j = i + 1;
11079
+ while (j < lines.length && (_FOOTNOTE_CONTINUATION_REGEX_MCP.test(lines[j]) || lines[j].trim() === "" && j + 1 < lines.length && _FOOTNOTE_CONTINUATION_REGEX_MCP.test(lines[j + 1]))) {
11080
+ textLines.push(lines[j].trim() === "" ? "" : lines[j].replace(_FOOTNOTE_CONTINUATION_REGEX_MCP, ""));
11081
+ consumed[j] = true;
11082
+ j++;
11083
+ }
11084
+ if (!definedLabels.has(label)) {
11085
+ definedLabels.add(label);
11086
+ definitions.push({ label, text: textLines.join("\n").trim() });
11087
+ }
11088
+ i = j;
11089
+ }
11090
+ const referenceScanText = lines.filter((_, idx) => !consumed[idx]).join("\n");
11091
+ const refOrder = [];
11092
+ const refCounts = /* @__PURE__ */ new Map();
11093
+ for (const m of referenceScanText.matchAll(_FOOTNOTE_REFERENCE_REGEX_MCP)) {
11094
+ const label = m[1];
11095
+ if (!refCounts.has(label)) {
11096
+ refCounts.set(label, 0);
11097
+ refOrder.push(label);
11098
+ }
11099
+ refCounts.set(label, (refCounts.get(label) ?? 0) + 1);
11100
+ }
11101
+ const references = refOrder.map((label) => ({ label, count: refCounts.get(label) ?? 0 }));
11102
+ const referencedSet = new Set(refOrder);
11103
+ const unresolvedReferences = refOrder.filter((label) => !definedLabels.has(label));
11104
+ const unusedDefinitions = definitions.filter((d) => !referencedSet.has(d.label)).map((d) => d.label);
11105
+ const referenceCount = refOrder.reduce((sum, label) => sum + (refCounts.get(label) ?? 0), 0);
11106
+ if (definitions.length === 0 && references.length === 0) {
11107
+ return { error: "No footnote references or definitions found" };
11108
+ }
11109
+ return { definitionCount: definitions.length, referenceCount, definitions, references, unresolvedReferences, unusedDefinitions };
11110
+ }
11111
+ server.tool(
11112
+ "extract_markdown_footnotes",
11113
+ "Extract every Markdown-Extra-style footnote reference ([^label]) and definition ([^label]: text, with 4-space/tab-indented continuation lines) from a document, then flag references with no matching definition and definitions that are never referenced.",
11114
+ {
11115
+ markdown: z.string().min(1).describe("The Markdown document text")
11116
+ },
11117
+ async ({ markdown }) => {
11118
+ const result = _extractMarkdownFootnotesMcp(markdown);
11119
+ if ("error" in result) return errText(result);
11120
+ return text(JSON.stringify(result, null, 2));
11121
+ }
11122
+ );
11123
+ function _calculateTaxEquivalentYieldMcp(inputYieldPercent, federalTaxRatePercent, stateTaxRatePercent, direction) {
11124
+ if (typeof inputYieldPercent !== "number" || !Number.isFinite(inputYieldPercent) || inputYieldPercent < 0) {
11125
+ return { error: "Yield must be zero or a positive number" };
11126
+ }
11127
+ if (typeof federalTaxRatePercent !== "number" || !Number.isFinite(federalTaxRatePercent) || federalTaxRatePercent < 0 || federalTaxRatePercent >= 100) {
11128
+ return { error: "Federal tax rate must be a percentage between 0 and 100 (exclusive of 100)" };
11129
+ }
11130
+ const stateRate = stateTaxRatePercent ?? 0;
11131
+ if (typeof stateRate !== "number" || !Number.isFinite(stateRate) || stateRate < 0 || stateRate >= 100) {
11132
+ return { error: "State tax rate must be a percentage between 0 and 100 (exclusive of 100)" };
11133
+ }
11134
+ if (direction !== "tax-free-to-taxable" && direction !== "taxable-to-tax-free") {
11135
+ return { error: 'Direction must be "tax-free-to-taxable" or "taxable-to-tax-free"' };
11136
+ }
11137
+ const combinedTaxRatePercent = federalTaxRatePercent + stateRate;
11138
+ if (combinedTaxRatePercent >= 100) {
11139
+ return { error: "Combined federal and state tax rate must be less than 100%" };
11140
+ }
11141
+ const round6 = (n) => Math.round(n * 1e6) / 1e6;
11142
+ const combinedRateDecimal = combinedTaxRatePercent / 100;
11143
+ let taxFreeYield;
11144
+ let taxableYield;
11145
+ if (direction === "tax-free-to-taxable") {
11146
+ taxFreeYield = inputYieldPercent;
11147
+ taxableYield = taxFreeYield / (1 - combinedRateDecimal);
11148
+ } else {
11149
+ taxableYield = inputYieldPercent;
11150
+ taxFreeYield = taxableYield * (1 - combinedRateDecimal);
11151
+ }
11152
+ return {
11153
+ direction,
11154
+ inputYield: round6(inputYieldPercent),
11155
+ federalTaxRatePercent: round6(federalTaxRatePercent),
11156
+ stateTaxRatePercent: round6(stateRate),
11157
+ combinedTaxRatePercent: round6(combinedTaxRatePercent),
11158
+ taxFreeYield: round6(taxFreeYield),
11159
+ taxableYield: round6(taxableYield),
11160
+ yieldDifference: round6(taxableYield - taxFreeYield)
11161
+ };
11162
+ }
11163
+ server.tool(
11164
+ "calculate_tax_equivalent_yield",
11165
+ 'Convert between a tax-free municipal bond yield and the equivalent taxable-bond yield given a marginal federal tax rate (plus an optional state rate, summed into a combined rate). With direction "tax-free-to-taxable", taxableYield = taxFreeYield / (1 - combinedRate); with "taxable-to-tax-free", taxFreeYield = taxableYield * (1 - combinedRate). Pure formula, no live bond pricing.',
11166
+ {
11167
+ inputYield: z.number().min(0).describe('The known yield as a percent: the tax-free yield when direction is "tax-free-to-taxable", or the taxable yield when direction is "taxable-to-tax-free"'),
11168
+ federalTaxRatePercent: z.number().min(0).max(99.999).describe("Marginal federal tax rate as a percent"),
11169
+ stateTaxRatePercent: z.number().min(0).max(99.999).optional().describe("Optional marginal state tax rate as a percent, summed with the federal rate"),
11170
+ direction: z.enum(["tax-free-to-taxable", "taxable-to-tax-free"]).describe("Which yield the input represents and which to compute")
11171
+ },
11172
+ async ({ inputYield, federalTaxRatePercent, stateTaxRatePercent, direction }) => {
11173
+ const result = _calculateTaxEquivalentYieldMcp(inputYield, federalTaxRatePercent, stateTaxRatePercent ?? 0, direction);
11174
+ if ("error" in result) return errText(result);
11175
+ return text(JSON.stringify(result, null, 2));
11176
+ }
11177
+ );
11178
+ var _OTP_ALG_TO_NODE_HASH_MCP = { SHA1: "sha1", SHA256: "sha256", SHA512: "sha512" };
11179
+ function _decodeBase32SecretMcp(secret) {
11180
+ const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
11181
+ const cleaned = (secret ?? "").toUpperCase().replace(/[\s=]/g, "");
11182
+ if (!cleaned) return { error: "Secret must not be empty" };
11183
+ const bytes = [];
11184
+ let buffer = 0;
11185
+ let bitsLeft = 0;
11186
+ for (const char of cleaned) {
11187
+ const val = alphabet.indexOf(char);
11188
+ if (val === -1) return { error: `Invalid base32 character '${char}' in secret` };
11189
+ buffer = buffer << 5 | val;
11190
+ bitsLeft += 5;
11191
+ if (bitsLeft >= 8) {
11192
+ bitsLeft -= 8;
11193
+ bytes.push(buffer >> bitsLeft & 255);
11194
+ }
11195
+ }
11196
+ return Buffer.from(bytes);
11197
+ }
11198
+ function _hotpFromCounterMcp(keyBytes, counter, digits, algorithm) {
11199
+ const counterBuffer = Buffer.alloc(8);
11200
+ counterBuffer.writeUInt32BE(Math.floor(counter / 4294967296), 0);
11201
+ counterBuffer.writeUInt32BE(counter % 4294967296, 4);
11202
+ const hmac = createHmac(_OTP_ALG_TO_NODE_HASH_MCP[algorithm], keyBytes).update(counterBuffer).digest();
11203
+ const offset = hmac[hmac.length - 1] & 15;
11204
+ const binCode = (hmac[offset] & 127) << 24 | (hmac[offset + 1] & 255) << 16 | (hmac[offset + 2] & 255) << 8 | hmac[offset + 3] & 255;
11205
+ return (binCode % 10 ** digits).toString().padStart(digits, "0");
11206
+ }
11207
+ function _generateHotpMcp(secret, counter, digits, algorithm) {
11208
+ if (!Number.isInteger(counter) || counter < 0) {
11209
+ return { error: "Counter must be a non-negative whole number" };
11210
+ }
11211
+ if (!Number.isInteger(digits) || digits < 6 || digits > 8) {
11212
+ return { error: "Digits must be an integer between 6 and 8" };
11213
+ }
11214
+ if (!(algorithm in _OTP_ALG_TO_NODE_HASH_MCP)) {
11215
+ return { error: "Algorithm must be one of SHA1, SHA256, SHA512" };
11216
+ }
11217
+ const keyBytes = _decodeBase32SecretMcp(secret);
11218
+ if ("error" in keyBytes) return keyBytes;
11219
+ return { code: _hotpFromCounterMcp(keyBytes, counter, digits, algorithm), counter, digits, algorithm };
11220
+ }
11221
+ function _generateTotpMcp(secret, digits, algorithm, periodSeconds, timestamp) {
11222
+ const period = periodSeconds ?? 30;
11223
+ const ts = timestamp ?? Math.floor(Date.now() / 1e3);
11224
+ if (!Number.isFinite(period) || period <= 0) {
11225
+ return { error: "Period must be a positive number of seconds" };
11226
+ }
11227
+ if (!Number.isFinite(ts) || ts < 0) {
11228
+ return { error: "Timestamp must be a non-negative number of seconds" };
11229
+ }
11230
+ const counter = Math.floor(ts / period);
11231
+ const hotp = _generateHotpMcp(secret, counter, digits, algorithm);
11232
+ if ("error" in hotp) return hotp;
11233
+ const secondsRemaining = period - ts % period;
11234
+ return { ...hotp, periodSeconds: period, secondsRemaining };
11235
+ }
11236
+ server.tool(
11237
+ "generate_hotp",
11238
+ "Generate an HOTP code (RFC 4226) for a given counter value from a base32-encoded shared secret. Supports 6-8 digit codes and SHA-1/SHA-256/SHA-512 (SHA-1 is the default per the RFC). The secret is never stored, only used for this one HMAC computation.",
11239
+ {
11240
+ secret: z.string().min(1).describe("The base32-encoded shared secret (RFC 4648, case-insensitive, padding optional)"),
11241
+ counter: z.number().int().min(0).describe("The HOTP counter value"),
11242
+ digits: z.number().int().min(6).max(8).optional().describe("Code length, default 6"),
11243
+ algorithm: z.enum(["SHA1", "SHA256", "SHA512"]).optional().describe("HMAC algorithm, default SHA1")
11244
+ },
11245
+ async ({ secret, counter, digits, algorithm }) => {
11246
+ const result = _generateHotpMcp(secret, counter, digits ?? 6, algorithm ?? "SHA1");
11247
+ if ("error" in result) return errText(result);
11248
+ return text(JSON.stringify(result, null, 2));
11249
+ }
11250
+ );
11251
+ server.tool(
11252
+ "generate_totp",
11253
+ "Generate the current TOTP code (RFC 6238) from a base32-encoded shared secret, plus how many seconds remain before it rotates. Defaults (30s period, 6 digits, SHA-1) match what Google Authenticator and most other authenticator apps use. Pass an explicit timestamp for deterministic/testable output.",
11254
+ {
11255
+ secret: z.string().min(1).describe("The base32-encoded shared secret (RFC 4648, case-insensitive, padding optional)"),
11256
+ digits: z.number().int().min(6).max(8).optional().describe("Code length, default 6"),
11257
+ algorithm: z.enum(["SHA1", "SHA256", "SHA512"]).optional().describe("HMAC algorithm, default SHA1"),
11258
+ periodSeconds: z.number().int().min(1).optional().describe("Time-step window in seconds, default 30"),
11259
+ timestamp: z.number().int().min(0).optional().describe("Unix timestamp in seconds to compute the code for; defaults to the current time")
11260
+ },
11261
+ async ({ secret, digits, algorithm, periodSeconds, timestamp }) => {
11262
+ const result = _generateTotpMcp(secret, digits ?? 6, algorithm ?? "SHA1", periodSeconds ?? 30, timestamp);
11263
+ if ("error" in result) return errText(result);
11264
+ return text(JSON.stringify(result, null, 2));
11265
+ }
11266
+ );
11013
11267
  var transport = new StdioServerTransport();
11014
11268
  await server.connect(transport);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilix-tech/mcp",
3
- "version": "0.68.0",
3
+ "version": "0.70.0",
4
4
  "description": "MCP server exposing 198 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",