@utilix-tech/mcp 0.18.0 → 0.19.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,9 @@
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.19.0
6
+ - Added `calculate_time_value` (present/future value) and `vector_similarity` tools.
7
+
5
8
  ## 0.18.0
6
9
  - Added `parse_user_agent` and `parse_github_url` tools.
7
10
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @utilix-tech/mcp
2
2
 
3
- MCP server exposing 125 developer utility tools to Claude, Cursor, VS Code Copilot, and any [Model Context Protocol](https://modelcontextprotocol.io) compatible AI assistant.
3
+ MCP server exposing 127 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
 
@@ -149,7 +149,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
149
149
  | `date_diff` | Calculate the difference between two dates |
150
150
  | `convert_timezone` | Convert a date/time between timezones |
151
151
 
152
- ### Units (11 tools)
152
+ ### Units (12 tools)
153
153
  | Tool | Description |
154
154
  |------|-------------|
155
155
  | `convert_bytes` | Convert between B, KB, MB, GB, TB, KiB, MiB, GiB, TiB |
@@ -163,6 +163,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
163
163
  | `validate_isbn` | Validate an ISBN-10 or ISBN-13 checksum and convert it to the other format where possible |
164
164
  | `calculate_tip_split` | Compute a tip on a bill amount and split the bill, tip, and total evenly across N people |
165
165
  | `calculate_simple_interest` | Compute simple (non-compounding) interest as principal x rate x time, plus the total payoff |
166
+ | `calculate_time_value` | Convert between present and future value (time value of money) in either direction |
166
167
 
167
168
  ### API / Network (9 tools)
168
169
  | Tool | Description |
@@ -221,7 +222,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
221
222
  | `unicode_inspect` | Inspect Unicode code points of a string |
222
223
  | `optimize_svg` | Optimize and minify an SVG string |
223
224
 
224
- ### AI / Agent (25 tools)
225
+ ### AI / Agent (26 tools)
225
226
  | Tool | Description |
226
227
  |------|-------------|
227
228
  | `estimate_tokens` | Estimate token count and cost for an LLM prompt |
@@ -249,6 +250,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
249
250
  | `compress_markdown` | Compress Markdown for LLM context budgets |
250
251
  | `compress_json` | Compress JSON for LLM context budgets |
251
252
  | `diff_json_detailed` | Diff two parsed JSON values, returning every path with its op and unchanged paths |
253
+ | `vector_similarity` | Cosine similarity, dot product, and Euclidean / Manhattan distance between two numeric vectors |
252
254
 
253
255
  ### Image (3 tools)
254
256
  | Tool | Description |
package/dist/index.js CHANGED
@@ -74,7 +74,7 @@ import { formatSql, formatHtml, testRegex, minifyJs, formatGql, parseDockerImage
74
74
  import { validateYaml, tomlToJson, xmlToJson, parseCsv } from "@utilix-tech/sdk/data";
75
75
  import { generateGradient, minifyCss } from "@utilix-tech/sdk/css";
76
76
  import { optimizeSvg, charToCodePoint, numberToWords } from "@utilix-tech/sdk/misc";
77
- import { estimateTokens, estimateCost, detectPii, redactPii, detectSecrets, detectPromptInjection, repairJson, trimToTokens, chunkText, extractUrls, sanitizeHtml, flattenJson, unflattenJson, mergeJson, extractJson, deduplicateLines, extractKeywords, validateJsonSchema, diffJson as diffJsonDetailed, extractTables, extractEntities, compressHtml, compressMarkdown, compressJson, rerankChunks, scoreRelevance, expandQuery, summarizeForLlm } from "@utilix-tech/sdk/ai_agent";
77
+ import { estimateTokens, estimateCost, detectPii, redactPii, detectSecrets, detectPromptInjection, repairJson, trimToTokens, chunkText, extractUrls, sanitizeHtml, flattenJson, unflattenJson, mergeJson, extractJson, deduplicateLines, extractKeywords, validateJsonSchema, diffJson as diffJsonDetailed, extractTables, extractEntities, compressHtml, compressMarkdown, compressJson, rerankChunks, scoreRelevance, expandQuery, summarizeForLlm, vectorSimilarity } from "@utilix-tech/sdk/ai_agent";
78
78
  var CRON_DAY_MAP = {
79
79
  SUN: "0",
80
80
  MON: "1",
@@ -1140,6 +1140,11 @@ server.tool("score_relevance", "Score a passage relevance to a query (0-1 score
1140
1140
  server.tool("expand_query", "Expand a search query with synonyms and stemmed variants for better retrieval.", { query: z.string(), max_synonyms: z.number().int().min(1).max(5).default(2) }, async ({ query, max_synonyms }) => {
1141
1141
  return { content: [{ type: "text", text: JSON.stringify(expandQuery(query, max_synonyms), null, 2) }] };
1142
1142
  });
1143
+ server.tool("vector_similarity", "Compute cosine similarity, dot product, Euclidean distance, and Manhattan distance between two equal-length numeric vectors (e.g. embeddings from an external model).", { a: z.array(z.number()), b: z.array(z.number()) }, async ({ a, b }) => {
1144
+ const result = vectorSimilarity(a, b);
1145
+ if ("error" in result) return errText(result);
1146
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
1147
+ });
1143
1148
  server.tool("summarize_for_llm", "Extractive summarization: pick key sentences to fit a token budget.", { text: z.string(), max_tokens: z.number().int().min(10).default(200), strategy: z.enum(["extractive", "first", "last"]).default("extractive") }, async ({ text: text2, max_tokens, strategy }) => {
1144
1149
  return { content: [{ type: "text", text: JSON.stringify(summarizeForLlm(text2, max_tokens, strategy), null, 2) }] };
1145
1150
  });
@@ -2295,6 +2300,55 @@ server.tool(
2295
2300
  return text(JSON.stringify(result, null, 2));
2296
2301
  }
2297
2302
  );
2303
+ function _calculateTimeValueMcp(amount, annualRatePercent, years, direction, compoundsPerYear = 1) {
2304
+ if (!Number.isFinite(amount) || amount < 0) return { error: "Amount must be zero or a positive number" };
2305
+ if (!Number.isFinite(annualRatePercent) || annualRatePercent < 0) return { error: "Annual interest rate must be zero or a positive number" };
2306
+ if (!Number.isFinite(years) || years <= 0) return { error: "Years must be a positive number" };
2307
+ if (!Number.isInteger(compoundsPerYear) || compoundsPerYear <= 0) return { error: "Compounding frequency must be a positive whole number of periods per year" };
2308
+ if (direction !== "future" && direction !== "present") return { error: 'Direction must be "future" or "present"' };
2309
+ const round2 = (n) => Math.round(n * 100) / 100;
2310
+ const round6 = (n) => Math.round(n * 1e6) / 1e6;
2311
+ const ratePerPeriod = annualRatePercent / 100 / compoundsPerYear;
2312
+ const totalPeriods = years * compoundsPerYear;
2313
+ const growthFactor = Math.pow(1 + ratePerPeriod, totalPeriods);
2314
+ let presentValue;
2315
+ let futureValue;
2316
+ if (direction === "future") {
2317
+ presentValue = amount;
2318
+ futureValue = amount * growthFactor;
2319
+ } else {
2320
+ futureValue = amount;
2321
+ presentValue = amount / growthFactor;
2322
+ }
2323
+ return {
2324
+ direction,
2325
+ annualRatePercent,
2326
+ years,
2327
+ compoundsPerYear,
2328
+ totalPeriods,
2329
+ ratePerPeriodPercent: round6(ratePerPeriod * 100),
2330
+ growthFactor: round6(growthFactor),
2331
+ presentValue: round2(presentValue),
2332
+ futureValue: round2(futureValue),
2333
+ interest: round2(futureValue - presentValue)
2334
+ };
2335
+ }
2336
+ server.tool(
2337
+ "calculate_time_value",
2338
+ 'Convert between present and future value (time value of money). With direction "future" the amount is a present value grown to its future value at the given annual rate; with direction "present" it is a future value discounted back to present value. Compounds compoundsPerYear times per year (1 = annually).',
2339
+ {
2340
+ amount: z.number().describe('The known value: a present value when direction is "future", or a future value when direction is "present"'),
2341
+ annualRatePercent: z.number().describe("Annual interest / discount rate as a percent, e.g. 5"),
2342
+ years: z.number().describe("Number of years, may be fractional"),
2343
+ direction: z.enum(["future", "present"]).describe("Whether to grow the amount to a future value or discount it to a present value"),
2344
+ compoundsPerYear: z.number().int().default(1).describe("Compounding periods per year (1 = annually)")
2345
+ },
2346
+ async ({ amount, annualRatePercent, years, direction, compoundsPerYear }) => {
2347
+ const result = _calculateTimeValueMcp(amount, annualRatePercent, years, direction, compoundsPerYear);
2348
+ if ("error" in result) return errText(result);
2349
+ return text(JSON.stringify(result, null, 2));
2350
+ }
2351
+ );
2298
2352
  var _BASE58_ALPHABET_MCP = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
2299
2353
  var _BASE62_ALPHABET_MCP = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
2300
2354
  function _encodeBytesToBaseMcp(bytes, alphabet) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilix-tech/mcp",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "description": "MCP server exposing 125 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",