@utilix-tech/mcp 0.14.0 → 0.16.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 +6 -0
- package/README.md +7 -3
- package/dist/index.js +279 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
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.16.0
|
|
6
|
+
- Added MIME Type Lookup (`lookup_mime`) and Tip / Bill Split Calculator (`calculate_tip_split`).
|
|
7
|
+
|
|
8
|
+
## 0.15.0
|
|
9
|
+
- Added Compound Interest Calculator (`calculate_compound_interest`) and ISBN Validator / Converter (`validate_isbn`).
|
|
10
|
+
|
|
5
11
|
## 0.14.0
|
|
6
12
|
- Added VAT / Sales Tax Calculator (`calculate_tax`).
|
|
7
13
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @utilix-tech/mcp
|
|
2
2
|
|
|
3
|
-
MCP server exposing
|
|
3
|
+
MCP server exposing 118 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
|
|
|
@@ -145,7 +145,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
|
|
|
145
145
|
| `date_diff` | Calculate the difference between two dates |
|
|
146
146
|
| `convert_timezone` | Convert a date/time between timezones |
|
|
147
147
|
|
|
148
|
-
### Units (
|
|
148
|
+
### Units (10 tools)
|
|
149
149
|
| Tool | Description |
|
|
150
150
|
|------|-------------|
|
|
151
151
|
| `convert_bytes` | Convert between B, KB, MB, GB, TB, KiB, MiB, GiB, TiB |
|
|
@@ -155,6 +155,9 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
|
|
|
155
155
|
| `calculate_loan` | Compute a loan's monthly payment, total interest, and amortization schedule |
|
|
156
156
|
| `validate_barcode` | Validate an EAN-13, EAN-8, or UPC-A barcode via its weighted mod-10 check digit |
|
|
157
157
|
| `calculate_tax` | Add or remove VAT/sales tax from a price, in either direction |
|
|
158
|
+
| `calculate_compound_interest` | Compute the future value of a principal plus an optional recurring contribution under compound interest |
|
|
159
|
+
| `validate_isbn` | Validate an ISBN-10 or ISBN-13 checksum and convert it to the other format where possible |
|
|
160
|
+
| `calculate_tip_split` | Compute a tip on a bill amount and split the bill, tip, and total evenly across N people |
|
|
158
161
|
|
|
159
162
|
### API / Network (8 tools)
|
|
160
163
|
| Tool | Description |
|
|
@@ -176,7 +179,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
|
|
|
176
179
|
| `color_palette` | Generate a color palette from a base color |
|
|
177
180
|
| `color_shades` | Generate shades or tints from a base color |
|
|
178
181
|
|
|
179
|
-
### Code (
|
|
182
|
+
### Code (8 tools)
|
|
180
183
|
| Tool | Description |
|
|
181
184
|
|------|-------------|
|
|
182
185
|
| `format_sql` | Format a SQL query with proper indentation |
|
|
@@ -186,6 +189,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
|
|
|
186
189
|
| `format_graphql` | Format or minify a GraphQL query or schema |
|
|
187
190
|
| `parse_env` | Parse a .env file and return all key-value pairs |
|
|
188
191
|
| `parse_docker_image` | Parse a Docker image reference into its components |
|
|
192
|
+
| `lookup_mime` | Look up the MIME type for a file extension, or the extension(s) for a MIME type |
|
|
189
193
|
|
|
190
194
|
### Data (6 tools)
|
|
191
195
|
| Tool | Description |
|
package/dist/index.js
CHANGED
|
@@ -1988,6 +1988,285 @@ server.tool(
|
|
|
1988
1988
|
return text(JSON.stringify(result, null, 2));
|
|
1989
1989
|
}
|
|
1990
1990
|
);
|
|
1991
|
+
function _calculateCompoundInterest(principal, annualRatePercent, years, compoundsPerYear, contributionPerPeriod) {
|
|
1992
|
+
if (!Number.isFinite(principal) || principal < 0) return { error: "Principal must be zero or a positive number" };
|
|
1993
|
+
if (!Number.isFinite(annualRatePercent) || annualRatePercent < 0) {
|
|
1994
|
+
return { error: "Annual interest rate must be zero or a positive number" };
|
|
1995
|
+
}
|
|
1996
|
+
if (!Number.isInteger(years) || years <= 0) return { error: "Years must be a positive whole number" };
|
|
1997
|
+
if (!Number.isInteger(compoundsPerYear) || compoundsPerYear <= 0) {
|
|
1998
|
+
return { error: "Compounding frequency must be a positive whole number of periods per year" };
|
|
1999
|
+
}
|
|
2000
|
+
if (!Number.isFinite(contributionPerPeriod) || contributionPerPeriod < 0) {
|
|
2001
|
+
return { error: "Contribution per period must be zero or a positive number" };
|
|
2002
|
+
}
|
|
2003
|
+
if (principal === 0 && contributionPerPeriod === 0) return { error: "Enter a principal or a recurring contribution" };
|
|
2004
|
+
const ratePerPeriod = annualRatePercent / 100 / compoundsPerYear;
|
|
2005
|
+
function futureValueAtPeriod(periods) {
|
|
2006
|
+
const growth = ratePerPeriod === 0 ? 1 : Math.pow(1 + ratePerPeriod, periods);
|
|
2007
|
+
const fvPrincipal = principal * growth;
|
|
2008
|
+
const fvContributions = contributionPerPeriod === 0 ? 0 : ratePerPeriod === 0 ? contributionPerPeriod * periods : contributionPerPeriod * ((growth - 1) / ratePerPeriod);
|
|
2009
|
+
return fvPrincipal + fvContributions;
|
|
2010
|
+
}
|
|
2011
|
+
const schedule = [];
|
|
2012
|
+
for (let year = 1; year <= years; year++) {
|
|
2013
|
+
const periods = year * compoundsPerYear;
|
|
2014
|
+
const balance = _roundMoneyMcp(futureValueAtPeriod(periods));
|
|
2015
|
+
const contributions = _roundMoneyMcp(contributionPerPeriod * periods);
|
|
2016
|
+
schedule.push({ year, balance, contributions, interest: _roundMoneyMcp(balance - principal - contributions) });
|
|
2017
|
+
}
|
|
2018
|
+
const totalPeriods = years * compoundsPerYear;
|
|
2019
|
+
const futureValue = _roundMoneyMcp(futureValueAtPeriod(totalPeriods));
|
|
2020
|
+
const totalContributions = _roundMoneyMcp(contributionPerPeriod * totalPeriods);
|
|
2021
|
+
const totalInterest = _roundMoneyMcp(futureValue - principal - totalContributions);
|
|
2022
|
+
return {
|
|
2023
|
+
futureValue,
|
|
2024
|
+
totalPrincipal: _roundMoneyMcp(principal),
|
|
2025
|
+
totalContributions,
|
|
2026
|
+
totalInterest,
|
|
2027
|
+
years,
|
|
2028
|
+
compoundsPerYear,
|
|
2029
|
+
schedule
|
|
2030
|
+
};
|
|
2031
|
+
}
|
|
2032
|
+
server.tool(
|
|
2033
|
+
"calculate_compound_interest",
|
|
2034
|
+
"Compute the future value of a principal plus an optional recurring contribution under compound interest, given an annual rate (as a percent), a term in years, and a compounding frequency (periods per year), plus a year-by-year balance breakdown.",
|
|
2035
|
+
{
|
|
2036
|
+
principal: z.number().describe("Starting principal amount"),
|
|
2037
|
+
annualRatePercent: z.number().describe("Annual interest rate as a percent, e.g. 5"),
|
|
2038
|
+
years: z.number().int().describe("Term in years"),
|
|
2039
|
+
compoundsPerYear: z.number().int().describe("Compounding periods per year, e.g. 1 = annually, 12 = monthly, 365 = daily"),
|
|
2040
|
+
contributionPerPeriod: z.number().default(0).describe("Optional recurring contribution made at the end of each compounding period")
|
|
2041
|
+
},
|
|
2042
|
+
async ({ principal, annualRatePercent, years, compoundsPerYear, contributionPerPeriod }) => {
|
|
2043
|
+
const result = _calculateCompoundInterest(principal, annualRatePercent, years, compoundsPerYear, contributionPerPeriod);
|
|
2044
|
+
if ("error" in result) return errText(result);
|
|
2045
|
+
return text(JSON.stringify(result, null, 2));
|
|
2046
|
+
}
|
|
2047
|
+
);
|
|
2048
|
+
function _computeIsbn10CheckDigitMcp(dataDigits) {
|
|
2049
|
+
let sum = 0;
|
|
2050
|
+
for (let i = 0; i < 9; i++) sum += dataDigits[i] * (10 - i);
|
|
2051
|
+
const check = (11 - sum % 11) % 11;
|
|
2052
|
+
return check === 10 ? "X" : String(check);
|
|
2053
|
+
}
|
|
2054
|
+
function _computeIsbn13CheckDigitMcp(dataDigits) {
|
|
2055
|
+
let sum = 0;
|
|
2056
|
+
const n = dataDigits.length;
|
|
2057
|
+
for (let i = 0; i < n; i++) {
|
|
2058
|
+
const distanceFromEnd = n - 1 - i;
|
|
2059
|
+
const weight = distanceFromEnd % 2 === 0 ? 3 : 1;
|
|
2060
|
+
sum += dataDigits[i] * weight;
|
|
2061
|
+
}
|
|
2062
|
+
return String((10 - sum % 10) % 10);
|
|
2063
|
+
}
|
|
2064
|
+
function _validateIsbn(input) {
|
|
2065
|
+
if (!input || !input.trim()) return { error: "Input is empty" };
|
|
2066
|
+
const cleaned = input.replace(/[\s-]/g, "").toUpperCase();
|
|
2067
|
+
if (cleaned.length === 10) {
|
|
2068
|
+
if (!/^\d{9}[\dX]$/.test(cleaned)) {
|
|
2069
|
+
return { error: 'ISBN-10 must be 9 digits followed by a digit or "X" check digit' };
|
|
2070
|
+
}
|
|
2071
|
+
const dataDigits = cleaned.slice(0, 9).split("").map(Number);
|
|
2072
|
+
const checkDigit = cleaned[9];
|
|
2073
|
+
const expectedCheckDigit = _computeIsbn10CheckDigitMcp(dataDigits);
|
|
2074
|
+
const valid = checkDigit === expectedCheckDigit;
|
|
2075
|
+
const isbn13Digits = [9, 7, 8, ...dataDigits];
|
|
2076
|
+
const converted = valid ? isbn13Digits.join("") + _computeIsbn13CheckDigitMcp(isbn13Digits) : null;
|
|
2077
|
+
return { valid, format: "ISBN-10", digits: cleaned, checkDigit, expectedCheckDigit, converted };
|
|
2078
|
+
}
|
|
2079
|
+
if (cleaned.length === 13) {
|
|
2080
|
+
if (!/^\d{13}$/.test(cleaned)) return { error: "ISBN-13 must contain only digits" };
|
|
2081
|
+
const dataDigits = cleaned.slice(0, 12).split("").map(Number);
|
|
2082
|
+
const checkDigit = cleaned[12];
|
|
2083
|
+
const expectedCheckDigit = _computeIsbn13CheckDigitMcp(dataDigits);
|
|
2084
|
+
const valid = checkDigit === expectedCheckDigit;
|
|
2085
|
+
let converted = null;
|
|
2086
|
+
if (valid && cleaned.startsWith("978")) {
|
|
2087
|
+
const isbn10Digits = dataDigits.slice(3);
|
|
2088
|
+
converted = isbn10Digits.join("") + _computeIsbn10CheckDigitMcp(isbn10Digits);
|
|
2089
|
+
}
|
|
2090
|
+
return { valid, format: "ISBN-13", digits: cleaned, checkDigit, expectedCheckDigit, converted };
|
|
2091
|
+
}
|
|
2092
|
+
return { error: `Unsupported length (${cleaned.length} characters); expected 10 (ISBN-10) or 13 (ISBN-13)` };
|
|
2093
|
+
}
|
|
2094
|
+
server.tool(
|
|
2095
|
+
"validate_isbn",
|
|
2096
|
+
"Validate an ISBN-10 or ISBN-13 number via its checksum (inferred from the character count) and convert it to the other format where possible.",
|
|
2097
|
+
{ isbn: z.string().describe("The ISBN-10 or ISBN-13, with or without hyphens/spaces") },
|
|
2098
|
+
async ({ isbn }) => {
|
|
2099
|
+
const result = _validateIsbn(isbn);
|
|
2100
|
+
if ("error" in result) return errText(result);
|
|
2101
|
+
return text(JSON.stringify(result, null, 2));
|
|
2102
|
+
}
|
|
2103
|
+
);
|
|
2104
|
+
var _MCP_MIME_TABLE = [
|
|
2105
|
+
{ extension: "txt", mimeType: "text/plain" },
|
|
2106
|
+
{ extension: "html", mimeType: "text/html" },
|
|
2107
|
+
{ extension: "htm", mimeType: "text/html" },
|
|
2108
|
+
{ extension: "css", mimeType: "text/css" },
|
|
2109
|
+
{ extension: "js", mimeType: "text/javascript" },
|
|
2110
|
+
{ extension: "mjs", mimeType: "text/javascript" },
|
|
2111
|
+
{ extension: "json", mimeType: "application/json" },
|
|
2112
|
+
{ extension: "jsonld", mimeType: "application/ld+json" },
|
|
2113
|
+
{ extension: "xml", mimeType: "application/xml" },
|
|
2114
|
+
{ extension: "csv", mimeType: "text/csv" },
|
|
2115
|
+
{ extension: "tsv", mimeType: "text/tab-separated-values" },
|
|
2116
|
+
{ extension: "md", mimeType: "text/markdown" },
|
|
2117
|
+
{ extension: "rtf", mimeType: "application/rtf" },
|
|
2118
|
+
{ extension: "yaml", mimeType: "application/x-yaml" },
|
|
2119
|
+
{ extension: "yml", mimeType: "application/x-yaml" },
|
|
2120
|
+
{ extension: "toml", mimeType: "application/toml" },
|
|
2121
|
+
{ extension: "ini", mimeType: "text/plain" },
|
|
2122
|
+
{ extension: "ics", mimeType: "text/calendar" },
|
|
2123
|
+
{ extension: "vcf", mimeType: "text/vcard" },
|
|
2124
|
+
{ extension: "atom", mimeType: "application/atom+xml" },
|
|
2125
|
+
{ extension: "rss", mimeType: "application/rss+xml" },
|
|
2126
|
+
{ extension: "png", mimeType: "image/png" },
|
|
2127
|
+
{ extension: "jpg", mimeType: "image/jpeg" },
|
|
2128
|
+
{ extension: "jpeg", mimeType: "image/jpeg" },
|
|
2129
|
+
{ extension: "gif", mimeType: "image/gif" },
|
|
2130
|
+
{ extension: "bmp", mimeType: "image/bmp" },
|
|
2131
|
+
{ extension: "webp", mimeType: "image/webp" },
|
|
2132
|
+
{ extension: "svg", mimeType: "image/svg+xml" },
|
|
2133
|
+
{ extension: "ico", mimeType: "image/x-icon" },
|
|
2134
|
+
{ extension: "tif", mimeType: "image/tiff" },
|
|
2135
|
+
{ extension: "tiff", mimeType: "image/tiff" },
|
|
2136
|
+
{ extension: "avif", mimeType: "image/avif" },
|
|
2137
|
+
{ extension: "heic", mimeType: "image/heic" },
|
|
2138
|
+
{ extension: "psd", mimeType: "image/vnd.adobe.photoshop" },
|
|
2139
|
+
{ extension: "ttf", mimeType: "font/ttf" },
|
|
2140
|
+
{ extension: "otf", mimeType: "font/otf" },
|
|
2141
|
+
{ extension: "woff", mimeType: "font/woff" },
|
|
2142
|
+
{ extension: "woff2", mimeType: "font/woff2" },
|
|
2143
|
+
{ extension: "eot", mimeType: "application/vnd.ms-fontobject" },
|
|
2144
|
+
{ extension: "pdf", mimeType: "application/pdf" },
|
|
2145
|
+
{ extension: "doc", mimeType: "application/msword" },
|
|
2146
|
+
{ extension: "docx", mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" },
|
|
2147
|
+
{ extension: "xls", mimeType: "application/vnd.ms-excel" },
|
|
2148
|
+
{ extension: "xlsx", mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" },
|
|
2149
|
+
{ extension: "ppt", mimeType: "application/vnd.ms-powerpoint" },
|
|
2150
|
+
{ extension: "pptx", mimeType: "application/vnd.openxmlformats-officedocument.presentationml.presentation" },
|
|
2151
|
+
{ extension: "odt", mimeType: "application/vnd.oasis.opendocument.text" },
|
|
2152
|
+
{ extension: "ods", mimeType: "application/vnd.oasis.opendocument.spreadsheet" },
|
|
2153
|
+
{ extension: "odp", mimeType: "application/vnd.oasis.opendocument.presentation" },
|
|
2154
|
+
{ extension: "epub", mimeType: "application/epub+zip" },
|
|
2155
|
+
{ extension: "zip", mimeType: "application/zip" },
|
|
2156
|
+
{ extension: "rar", mimeType: "application/vnd.rar" },
|
|
2157
|
+
{ extension: "7z", mimeType: "application/x-7z-compressed" },
|
|
2158
|
+
{ extension: "tar", mimeType: "application/x-tar" },
|
|
2159
|
+
{ extension: "gz", mimeType: "application/gzip" },
|
|
2160
|
+
{ extension: "bz2", mimeType: "application/x-bzip2" },
|
|
2161
|
+
{ extension: "jar", mimeType: "application/java-archive" },
|
|
2162
|
+
{ extension: "mp3", mimeType: "audio/mpeg" },
|
|
2163
|
+
{ extension: "wav", mimeType: "audio/wav" },
|
|
2164
|
+
{ extension: "ogg", mimeType: "audio/ogg" },
|
|
2165
|
+
{ extension: "oga", mimeType: "audio/ogg" },
|
|
2166
|
+
{ extension: "flac", mimeType: "audio/flac" },
|
|
2167
|
+
{ extension: "aac", mimeType: "audio/aac" },
|
|
2168
|
+
{ extension: "m4a", mimeType: "audio/mp4" },
|
|
2169
|
+
{ extension: "mid", mimeType: "audio/midi" },
|
|
2170
|
+
{ extension: "midi", mimeType: "audio/midi" },
|
|
2171
|
+
{ extension: "weba", mimeType: "audio/webm" },
|
|
2172
|
+
{ extension: "mp4", mimeType: "video/mp4" },
|
|
2173
|
+
{ extension: "m4v", mimeType: "video/mp4" },
|
|
2174
|
+
{ extension: "webm", mimeType: "video/webm" },
|
|
2175
|
+
{ extension: "mov", mimeType: "video/quicktime" },
|
|
2176
|
+
{ extension: "avi", mimeType: "video/x-msvideo" },
|
|
2177
|
+
{ extension: "mkv", mimeType: "video/x-matroska" },
|
|
2178
|
+
{ extension: "wmv", mimeType: "video/x-ms-wmv" },
|
|
2179
|
+
{ extension: "flv", mimeType: "video/x-flv" },
|
|
2180
|
+
{ extension: "mpeg", mimeType: "video/mpeg" },
|
|
2181
|
+
{ extension: "mpg", mimeType: "video/mpeg" },
|
|
2182
|
+
{ extension: "3gp", mimeType: "video/3gpp" },
|
|
2183
|
+
{ extension: "ts", mimeType: "video/mp2t" },
|
|
2184
|
+
{ extension: "bin", mimeType: "application/octet-stream" },
|
|
2185
|
+
{ extension: "exe", mimeType: "application/vnd.microsoft.portable-executable" },
|
|
2186
|
+
{ extension: "dmg", mimeType: "application/x-apple-diskimage" },
|
|
2187
|
+
{ extension: "apk", mimeType: "application/vnd.android.package-archive" },
|
|
2188
|
+
{ extension: "iso", mimeType: "application/x-iso9660-image" },
|
|
2189
|
+
{ extension: "deb", mimeType: "application/vnd.debian.binary-package" },
|
|
2190
|
+
{ extension: "rpm", mimeType: "application/x-rpm" },
|
|
2191
|
+
{ extension: "msi", mimeType: "application/x-msi" },
|
|
2192
|
+
{ extension: "dll", mimeType: "application/x-msdownload" },
|
|
2193
|
+
{ extension: "so", mimeType: "application/octet-stream" },
|
|
2194
|
+
{ extension: "wasm", mimeType: "application/wasm" },
|
|
2195
|
+
{ extension: "swf", mimeType: "application/x-shockwave-flash" },
|
|
2196
|
+
{ extension: "crx", mimeType: "application/x-chrome-extension" },
|
|
2197
|
+
{ extension: "torrent", mimeType: "application/x-bittorrent" },
|
|
2198
|
+
{ extension: "sh", mimeType: "application/x-sh" },
|
|
2199
|
+
{ extension: "bat", mimeType: "application/x-bat" },
|
|
2200
|
+
{ extension: "py", mimeType: "text/x-python" },
|
|
2201
|
+
{ extension: "java", mimeType: "text/x-java-source" },
|
|
2202
|
+
{ extension: "c", mimeType: "text/x-c" },
|
|
2203
|
+
{ extension: "h", mimeType: "text/x-c" },
|
|
2204
|
+
{ extension: "cpp", mimeType: "text/x-c++src" },
|
|
2205
|
+
{ extension: "rb", mimeType: "text/x-ruby" },
|
|
2206
|
+
{ extension: "php", mimeType: "application/x-httpd-php" },
|
|
2207
|
+
{ extension: "go", mimeType: "text/x-go" },
|
|
2208
|
+
{ extension: "rs", mimeType: "text/x-rust" },
|
|
2209
|
+
{ extension: "swift", mimeType: "text/x-swift" },
|
|
2210
|
+
{ extension: "sql", mimeType: "application/sql" },
|
|
2211
|
+
{ extension: "log", mimeType: "text/plain" }
|
|
2212
|
+
];
|
|
2213
|
+
function _lookupMimeMcp(query) {
|
|
2214
|
+
if (!query || !query.trim()) return { error: "Input is empty" };
|
|
2215
|
+
const trimmed = query.trim();
|
|
2216
|
+
if (trimmed.includes("/")) {
|
|
2217
|
+
const mime = trimmed.toLowerCase();
|
|
2218
|
+
const matches2 = _MCP_MIME_TABLE.filter((e) => e.mimeType.toLowerCase() === mime);
|
|
2219
|
+
if (matches2.length === 0) return { error: `No known file extension for MIME type "${trimmed}"` };
|
|
2220
|
+
return { query: trimmed, kind: "mime", matches: matches2 };
|
|
2221
|
+
}
|
|
2222
|
+
const ext = trimmed.replace(/^\./, "").toLowerCase();
|
|
2223
|
+
const matches = _MCP_MIME_TABLE.filter((e) => e.extension === ext);
|
|
2224
|
+
if (matches.length === 0) return { error: `No known MIME type for extension ".${ext}"` };
|
|
2225
|
+
return { query: trimmed, kind: "extension", matches };
|
|
2226
|
+
}
|
|
2227
|
+
server.tool(
|
|
2228
|
+
"lookup_mime",
|
|
2229
|
+
"Look up the MIME type for a file extension, or the file extension(s) registered for a MIME type, from a static table of well-known content types.",
|
|
2230
|
+
{ query: z.string().describe('A file extension (with or without a leading dot) or a MIME type (containing a "/")') },
|
|
2231
|
+
async ({ query }) => {
|
|
2232
|
+
const result = _lookupMimeMcp(query);
|
|
2233
|
+
if ("error" in result) return errText(result);
|
|
2234
|
+
return text(JSON.stringify(result, null, 2));
|
|
2235
|
+
}
|
|
2236
|
+
);
|
|
2237
|
+
function _calculateTipSplitMcp(billAmount, tipPercent, numPeople) {
|
|
2238
|
+
if (!Number.isFinite(billAmount) || billAmount < 0) return { error: "Bill amount must be zero or a positive number" };
|
|
2239
|
+
if (!Number.isFinite(tipPercent) || tipPercent < 0) return { error: "Tip percent must be zero or a positive number" };
|
|
2240
|
+
if (!Number.isInteger(numPeople) || numPeople < 1) return { error: "Number of people must be a positive whole number" };
|
|
2241
|
+
const round2 = (n) => Math.round(n * 100) / 100;
|
|
2242
|
+
const billRounded = round2(billAmount);
|
|
2243
|
+
const tipAmount = round2(billAmount * (tipPercent / 100));
|
|
2244
|
+
const totalAmount = round2(billRounded + tipAmount);
|
|
2245
|
+
return {
|
|
2246
|
+
billAmount: billRounded,
|
|
2247
|
+
tipPercent,
|
|
2248
|
+
tipAmount,
|
|
2249
|
+
totalAmount,
|
|
2250
|
+
numPeople,
|
|
2251
|
+
perPersonBill: round2(billRounded / numPeople),
|
|
2252
|
+
perPersonTip: round2(tipAmount / numPeople),
|
|
2253
|
+
perPersonTotal: round2(totalAmount / numPeople)
|
|
2254
|
+
};
|
|
2255
|
+
}
|
|
2256
|
+
server.tool(
|
|
2257
|
+
"calculate_tip_split",
|
|
2258
|
+
"Compute a tip on a bill amount and split the bill, tip, and total evenly across a number of people.",
|
|
2259
|
+
{
|
|
2260
|
+
billAmount: z.number().describe("The bill amount before tip"),
|
|
2261
|
+
tipPercent: z.number().describe("Tip percent, e.g. 18"),
|
|
2262
|
+
numPeople: z.number().int().default(1).describe("Number of people to split the bill between")
|
|
2263
|
+
},
|
|
2264
|
+
async ({ billAmount, tipPercent, numPeople }) => {
|
|
2265
|
+
const result = _calculateTipSplitMcp(billAmount, tipPercent, numPeople);
|
|
2266
|
+
if ("error" in result) return errText(result);
|
|
2267
|
+
return text(JSON.stringify(result, null, 2));
|
|
2268
|
+
}
|
|
2269
|
+
);
|
|
1991
2270
|
server.tool(
|
|
1992
2271
|
"format_ndjson",
|
|
1993
2272
|
"Validate newline-delimited JSON (NDJSON/JSON Lines), report per-line errors, and pretty-print each valid line.",
|
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.16.0",
|
|
4
|
+
"description": "MCP server exposing 116 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",
|