mcp-devutils 1.5.0 → 1.6.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.
Files changed (3) hide show
  1. package/README.md +7 -2
  2. package/index.js +170 -1
  3. package/package.json +9 -3
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # mcp-devutils
2
2
 
3
- MCP server with **35 developer utilities** for Claude Desktop, Cursor, and any MCP-compatible AI assistant.
3
+ MCP server with **39 developer utilities** for Claude Desktop, Cursor, and any MCP-compatible AI assistant.
4
4
 
5
5
  ## Install
6
6
 
@@ -15,7 +15,7 @@ MCP server with **35 developer utilities** for Claude Desktop, Cursor, and any M
15
15
  }
16
16
  ```
17
17
 
18
- ## Tools (35)
18
+ ## Tools (39)
19
19
 
20
20
  | Tool | Description |
21
21
  |------|-------------|
@@ -53,6 +53,11 @@ MCP server with **35 developer utilities** for Claude Desktop, Cursor, and any M
53
53
  | `hex_encode` | Hex encode/decode text |
54
54
  | `char_info` | Unicode character info (codepoint, UTF-8 bytes, HTML entity) |
55
55
  | `byte_count` | Count string bytes in UTF-8/UTF-16/ASCII |
56
+ | `json_diff` | Compare two JSON objects — show added/removed/changed |
57
+ | `jwt_create` | Create HS256 JWT tokens for API testing |
58
+ | `sql_format` | Format SQL queries with proper indentation |
59
+ | `json_query` | Extract values from JSON using dot-notation paths |
60
+ | `epoch_convert` | Convert epoch timestamps across multiple timezones |
56
61
 
57
62
  ## Zero dependencies
58
63
 
package/index.js CHANGED
@@ -5,7 +5,7 @@ import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprot
5
5
  import crypto from "crypto";
6
6
 
7
7
  const server = new Server(
8
- { name: "mcp-devutils", version: "1.5.0" },
8
+ { name: "mcp-devutils", version: "1.6.0" },
9
9
  { capabilities: { tools: {} } }
10
10
  );
11
11
 
@@ -464,6 +464,66 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
464
464
  },
465
465
  required: ["text"]
466
466
  }
467
+ },
468
+ {
469
+ name: "json_diff",
470
+ description: "Compare two JSON objects and show the differences — added, removed, and changed keys. Useful for debugging API responses, config changes, and state diffs.",
471
+ inputSchema: {
472
+ type: "object",
473
+ properties: {
474
+ a: { type: "string", description: "First JSON string" },
475
+ b: { type: "string", description: "Second JSON string" }
476
+ },
477
+ required: ["a", "b"]
478
+ }
479
+ },
480
+ {
481
+ name: "jwt_create",
482
+ description: "Create a JWT token signed with HS256. Useful for testing APIs, mocking auth, and generating test tokens.",
483
+ inputSchema: {
484
+ type: "object",
485
+ properties: {
486
+ payload: { type: "string", description: "JSON string for the JWT payload (e.g. {\"sub\":\"1234\",\"name\":\"Test\"})" },
487
+ secret: { type: "string", description: "Secret key for HS256 signing (default: 'secret')" },
488
+ expiresIn: { type: "number", description: "Expiration in seconds from now (default: 3600)" }
489
+ },
490
+ required: ["payload"]
491
+ }
492
+ },
493
+ {
494
+ name: "sql_format",
495
+ description: "Format a SQL query with proper indentation and keyword capitalization. Supports SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, and JOIN queries.",
496
+ inputSchema: {
497
+ type: "object",
498
+ properties: {
499
+ sql: { type: "string", description: "SQL query to format" },
500
+ uppercase: { type: "boolean", description: "Uppercase SQL keywords (default: true)" }
501
+ },
502
+ required: ["sql"]
503
+ }
504
+ },
505
+ {
506
+ name: "json_query",
507
+ description: "Extract values from a JSON object using dot-notation paths (e.g. 'user.address.city', 'items[0].name', 'data[*].id'). Useful for quickly inspecting nested API responses.",
508
+ inputSchema: {
509
+ type: "object",
510
+ properties: {
511
+ json: { type: "string", description: "JSON string to query" },
512
+ path: { type: "string", description: "Dot-notation path (e.g. 'user.name', 'items[0]', 'data[*].id')" }
513
+ },
514
+ required: ["json", "path"]
515
+ }
516
+ },
517
+ {
518
+ name: "epoch_convert",
519
+ description: "Convert between epoch milliseconds, seconds, and human-readable dates across multiple timezones. Shows UTC, US Eastern, US Pacific, Europe/London, and Asia/Singapore.",
520
+ inputSchema: {
521
+ type: "object",
522
+ properties: {
523
+ value: { type: "string", description: "Epoch seconds, epoch milliseconds, or ISO date string. Leave empty for current time." },
524
+ timezone: { type: "string", description: "Additional IANA timezone to show (e.g. 'Asia/Tokyo')" }
525
+ }
526
+ }
467
527
  }
468
528
  ]
469
529
  };
@@ -1449,6 +1509,115 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1449
1509
  };
1450
1510
  }
1451
1511
 
1512
+ case "json_diff": {
1513
+ const objA = JSON.parse(args.a);
1514
+ const objB = JSON.parse(args.b);
1515
+ const diffs = [];
1516
+ const diffObj = (a, b, prefix = "") => {
1517
+ const allKeys = new Set([...Object.keys(a || {}), ...Object.keys(b || {})]);
1518
+ for (const key of allKeys) {
1519
+ const path = prefix ? `${prefix}.${key}` : key;
1520
+ if (!(key in (a || {}))) {
1521
+ diffs.push({ path, type: "added", value: b[key] });
1522
+ } else if (!(key in (b || {}))) {
1523
+ diffs.push({ path, type: "removed", value: a[key] });
1524
+ } else if (typeof a[key] === "object" && typeof b[key] === "object" && a[key] !== null && b[key] !== null && !Array.isArray(a[key]) && !Array.isArray(b[key])) {
1525
+ diffObj(a[key], b[key], path);
1526
+ } else if (JSON.stringify(a[key]) !== JSON.stringify(b[key])) {
1527
+ diffs.push({ path, type: "changed", from: a[key], to: b[key] });
1528
+ }
1529
+ }
1530
+ };
1531
+ diffObj(objA, objB);
1532
+ if (diffs.length === 0) {
1533
+ return { content: [{ type: "text", text: "No differences found." }] };
1534
+ }
1535
+ return { content: [{ type: "text", text: JSON.stringify(diffs, null, 2) }] };
1536
+ }
1537
+
1538
+ case "jwt_create": {
1539
+ const payload = JSON.parse(args.payload);
1540
+ const secret = args.secret || "secret";
1541
+ const expiresIn = args.expiresIn || 3600;
1542
+ const header = { alg: "HS256", typ: "JWT" };
1543
+ const now = Math.floor(Date.now() / 1000);
1544
+ payload.iat = payload.iat || now;
1545
+ payload.exp = payload.exp || now + expiresIn;
1546
+ const b64url = (obj) => Buffer.from(JSON.stringify(obj)).toString("base64url");
1547
+ const headerB64 = b64url(header);
1548
+ const payloadB64 = b64url(payload);
1549
+ const signature = crypto.createHmac("sha256", secret).update(`${headerB64}.${payloadB64}`).digest("base64url");
1550
+ const token = `${headerB64}.${payloadB64}.${signature}`;
1551
+ return { content: [{ type: "text", text: `Token: ${token}\n\nHeader: ${JSON.stringify(header, null, 2)}\nPayload: ${JSON.stringify(payload, null, 2)}\n\nSigned with: HS256\nExpires: ${new Date(payload.exp * 1000).toISOString()}` }] };
1552
+ }
1553
+
1554
+ case "sql_format": {
1555
+ const { sql, uppercase = true } = args;
1556
+ const keywords = ["SELECT", "FROM", "WHERE", "AND", "OR", "ORDER BY", "GROUP BY", "HAVING", "LIMIT", "OFFSET", "JOIN", "LEFT JOIN", "RIGHT JOIN", "INNER JOIN", "OUTER JOIN", "FULL JOIN", "CROSS JOIN", "ON", "INSERT INTO", "VALUES", "UPDATE", "SET", "DELETE FROM", "CREATE TABLE", "ALTER TABLE", "DROP TABLE", "AS", "IN", "NOT", "NULL", "IS", "BETWEEN", "LIKE", "EXISTS", "UNION", "UNION ALL", "DISTINCT", "CASE", "WHEN", "THEN", "ELSE", "END"];
1557
+ let formatted = sql.replace(/\s+/g, " ").trim();
1558
+ const newlineBefore = ["SELECT", "FROM", "WHERE", "ORDER BY", "GROUP BY", "HAVING", "LIMIT", "JOIN", "LEFT JOIN", "RIGHT JOIN", "INNER JOIN", "OUTER JOIN", "FULL JOIN", "CROSS JOIN", "INSERT INTO", "VALUES", "UPDATE", "SET", "DELETE FROM", "CREATE TABLE", "UNION", "UNION ALL"];
1559
+ for (const kw of newlineBefore) {
1560
+ const regex = new RegExp(`\\b${kw}\\b`, "gi");
1561
+ const replacement = uppercase ? kw : kw.toLowerCase();
1562
+ formatted = formatted.replace(regex, `\n${replacement}`);
1563
+ }
1564
+ const indentAfter = ["AND", "OR"];
1565
+ for (const kw of indentAfter) {
1566
+ const regex = new RegExp(`\\b${kw}\\b`, "gi");
1567
+ const replacement = uppercase ? kw : kw.toLowerCase();
1568
+ formatted = formatted.replace(regex, `\n ${replacement}`);
1569
+ }
1570
+ if (uppercase) {
1571
+ for (const kw of ["ON", "AS", "IN", "NOT", "NULL", "IS", "BETWEEN", "LIKE", "EXISTS", "DISTINCT", "CASE", "WHEN", "THEN", "ELSE", "END"]) {
1572
+ const regex = new RegExp(`\\b${kw}\\b`, "gi");
1573
+ formatted = formatted.replace(regex, kw);
1574
+ }
1575
+ }
1576
+ formatted = formatted.trim();
1577
+ return { content: [{ type: "text", text: formatted }] };
1578
+ }
1579
+
1580
+ case "json_query": {
1581
+ const obj = JSON.parse(args.json);
1582
+ const { path } = args;
1583
+ const parts = path.replace(/\[(\d+)\]/g, ".$1").replace(/\[\*\]/g, ".*").split(".");
1584
+ const resolve = (current, parts) => {
1585
+ if (parts.length === 0) return current;
1586
+ const [head, ...rest] = parts;
1587
+ if (head === "*" && Array.isArray(current)) {
1588
+ return current.map(item => resolve(item, rest));
1589
+ }
1590
+ if (current === null || current === undefined) return undefined;
1591
+ const next = Array.isArray(current) ? current[parseInt(head)] : current[head];
1592
+ return resolve(next, rest);
1593
+ };
1594
+ const result = resolve(obj, parts);
1595
+ return { content: [{ type: "text", text: result === undefined ? "undefined (path not found)" : JSON.stringify(result, null, 2) }] };
1596
+ }
1597
+
1598
+ case "epoch_convert": {
1599
+ const { value, timezone } = args || {};
1600
+ const zones = ["UTC", "America/New_York", "America/Los_Angeles", "Europe/London", "Asia/Singapore"];
1601
+ if (timezone && !zones.includes(timezone)) zones.push(timezone);
1602
+ let date;
1603
+ if (!value) {
1604
+ date = new Date();
1605
+ } else if (/^\d+$/.test(value.trim())) {
1606
+ const num = parseInt(value.trim());
1607
+ date = new Date(num > 1e12 ? num : num * 1000);
1608
+ } else {
1609
+ date = new Date(value);
1610
+ }
1611
+ if (isNaN(date.getTime())) throw new Error(`Invalid date/time: ${value}`);
1612
+ const lines = [`Epoch seconds: ${Math.floor(date.getTime() / 1000)}`, `Epoch milliseconds: ${date.getTime()}`, `ISO 8601: ${date.toISOString()}`, ""];
1613
+ for (const tz of zones) {
1614
+ try {
1615
+ lines.push(`${tz}: ${date.toLocaleString("en-US", { timeZone: tz, dateStyle: "full", timeStyle: "long" })}`);
1616
+ } catch { lines.push(`${tz}: (unsupported timezone)`); }
1617
+ }
1618
+ return { content: [{ type: "text", text: lines.join("\n") }] };
1619
+ }
1620
+
1452
1621
  default:
1453
1622
  throw new Error(`Unknown tool: ${name}`);
1454
1623
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mcp-devutils",
3
- "version": "1.5.0",
4
- "description": "MCP server with 35 developer utilities - UUID, nanoid, hash, HMAC, base64, hex encode, timestamps, JWT decode, random strings, URL encode/decode, JSON format, CSV/JSON convert, regex test, cron explain, color convert, semver compare, HTTP status codes, slugify, HTML escape, chmod calculator, text diff, number base converter, lorem ipsum, word count, byte count, CIDR calculator, case converter, markdown TOC, env parser, IP info, password strength, data size converter, string escape, char info",
3
+ "version": "1.6.0",
4
+ "description": "MCP server with 39 developer utilities - UUID, nanoid, hash, HMAC, base64, hex encode, timestamps, JWT decode/create, random strings, URL encode/decode, JSON format/diff/query, CSV/JSON convert, regex test, cron explain, color convert, semver compare, HTTP status codes, slugify, HTML escape, chmod calculator, text diff, number base converter, lorem ipsum, word count, byte count, CIDR calculator, case converter, markdown TOC, env parser, IP info, password strength, data size converter, string escape, char info, SQL format, epoch convert",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "bin": {
@@ -46,7 +46,13 @@
46
46
  "csv-json",
47
47
  "hex-encode",
48
48
  "unicode",
49
- "byte-count"
49
+ "byte-count",
50
+ "json-diff",
51
+ "jwt-create",
52
+ "sql-format",
53
+ "json-query",
54
+ "epoch-convert",
55
+ "timezone"
50
56
  ],
51
57
  "author": "Hong Teoh",
52
58
  "license": "MIT",