it-tools-mcp 3.2.12 → 3.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 (117) hide show
  1. package/build/index.js +60 -67
  2. package/build/tools/ansible/ansible-inventory-generator/index.js +5 -2
  3. package/build/tools/ansible/ansible-playbook-validator/index.js +5 -2
  4. package/build/tools/ansible/ansible-reference/index.js +4 -1
  5. package/build/tools/ansible/ansible-vault-decrypt/index.js +6 -3
  6. package/build/tools/ansible/ansible-vault-encrypt/index.js +7 -4
  7. package/build/tools/color/color-hex-to-rgb/index.js +5 -2
  8. package/build/tools/color/color-rgb-to-hex/index.js +7 -4
  9. package/build/tools/crypto/basic-auth-generator/index.js +6 -3
  10. package/build/tools/crypto/bcrypt-hash/index.js +7 -4
  11. package/build/tools/crypto/bip39-generate/index.js +5 -2
  12. package/build/tools/crypto/hash-md5/index.js +5 -2
  13. package/build/tools/crypto/hash-sha1/index.js +5 -2
  14. package/build/tools/crypto/hash-sha256/index.js +5 -2
  15. package/build/tools/crypto/hash-sha512/index.js +5 -2
  16. package/build/tools/crypto/hmac-generator/index.js +7 -4
  17. package/build/tools/crypto/jwt-decode/index.js +5 -2
  18. package/build/tools/crypto/otp-code-generator/index.js +7 -4
  19. package/build/tools/crypto/password-generate/index.js +9 -6
  20. package/build/tools/crypto/token-generator/index.js +7 -4
  21. package/build/tools/dataFormat/html-to-markdown/index.js +5 -2
  22. package/build/tools/dataFormat/json-diff/index.js +6 -3
  23. package/build/tools/dataFormat/json-format/index.js +7 -3
  24. package/build/tools/dataFormat/json-minify/index.js +5 -2
  25. package/build/tools/dataFormat/json-to-csv/index.js +6 -3
  26. package/build/tools/dataFormat/json-to-toml/index.js +5 -2
  27. package/build/tools/dataFormat/markdown-to-html/index.js +5 -2
  28. package/build/tools/dataFormat/phone-format/index.js +6 -3
  29. package/build/tools/dataFormat/sql-format/index.js +6 -3
  30. package/build/tools/dataFormat/toml-to-json/index.js +5 -2
  31. package/build/tools/dataFormat/xml-format/index.js +6 -3
  32. package/build/tools/dataFormat/yaml-format/index.js +5 -2
  33. package/build/tools/development/crontab-generate/index.js +9 -6
  34. package/build/tools/development/html-prettifier/index.js +6 -3
  35. package/build/tools/development/javascript-prettifier/index.js +7 -4
  36. package/build/tools/development/list-converter/index.js +8 -5
  37. package/build/tools/development/markdown-toc-generator/index.js +7 -4
  38. package/build/tools/development/regex-tester/index.js +7 -4
  39. package/build/tools/docker/docker-compose-to-docker-run/index.js +5 -2
  40. package/build/tools/docker/docker-compose-validator/index.js +5 -2
  41. package/build/tools/docker/docker-reference/index.js +4 -1
  42. package/build/tools/docker/docker-run-to-docker-compose/index.js +5 -2
  43. package/build/tools/docker/traefik-compose-generator/index.js +9 -6
  44. package/build/tools/encoding/base64-decode/index.js +6 -2
  45. package/build/tools/encoding/base64-encode/index.js +27 -11
  46. package/build/tools/encoding/html-decode/index.js +5 -2
  47. package/build/tools/encoding/html-encode/index.js +5 -2
  48. package/build/tools/encoding/html-entities-extended/index.js +6 -3
  49. package/build/tools/encoding/text-to-binary/index.js +6 -3
  50. package/build/tools/encoding/url-decode/index.js +5 -2
  51. package/build/tools/encoding/url-encode/index.js +5 -2
  52. package/build/tools/forensic/file-type-identifier/index.js +6 -3
  53. package/build/tools/forensic/safelink-decoder/index.js +5 -2
  54. package/build/tools/forensic/url-fanger/index.js +6 -3
  55. package/build/tools/idGenerators/qr-generate/index.js +6 -3
  56. package/build/tools/idGenerators/svg-placeholder-generator/index.js +9 -6
  57. package/build/tools/idGenerators/ulid-generate/index.js +4 -1
  58. package/build/tools/idGenerators/uuid-generate/index.js +4 -1
  59. package/build/tools/math/math-evaluate/index.js +5 -2
  60. package/build/tools/math/number-base-converter/index.js +7 -4
  61. package/build/tools/math/percentage-calculator/index.js +7 -4
  62. package/build/tools/math/roman-numeral-converter/index.js +5 -2
  63. package/build/tools/math/temperature-converter/index.js +7 -4
  64. package/build/tools/math/unix-timestamp-converter/index.js +5 -2
  65. package/build/tools/network/cat/index.js +5 -2
  66. package/build/tools/network/cidr-to-ip-range/index.js +5 -2
  67. package/build/tools/network/curl/index.js +11 -6
  68. package/build/tools/network/dig/index.js +6 -3
  69. package/build/tools/network/grep/index.js +6 -3
  70. package/build/tools/network/head/index.js +6 -3
  71. package/build/tools/network/iban-validate/index.js +5 -2
  72. package/build/tools/network/ip-range-to-cidr/index.js +6 -3
  73. package/build/tools/network/ip-subnet-calculator/index.js +6 -3
  74. package/build/tools/network/ipv4-subnet-calc/index.js +5 -2
  75. package/build/tools/network/ipv6-subnet-calculator/index.js +6 -3
  76. package/build/tools/network/ipv6-ula-generator/index.js +5 -2
  77. package/build/tools/network/mac-address-generate/index.js +6 -3
  78. package/build/tools/network/nslookup/index.js +5 -2
  79. package/build/tools/network/ping/index.js +9 -4
  80. package/build/tools/network/ps/index.js +4 -1
  81. package/build/tools/network/random-port/index.js +8 -5
  82. package/build/tools/network/scp/index.js +10 -7
  83. package/build/tools/network/ssh/index.js +8 -5
  84. package/build/tools/network/tail/index.js +6 -3
  85. package/build/tools/network/telnet/index.js +6 -3
  86. package/build/tools/network/top/index.js +4 -1
  87. package/build/tools/network/url-parse/index.js +5 -2
  88. package/build/tools/physics/angle-converter/index.js +11 -8
  89. package/build/tools/physics/energy-converter/index.js +13 -10
  90. package/build/tools/physics/power-converter/index.js +13 -10
  91. package/build/tools/text/ascii-art-text/index.js +6 -3
  92. package/build/tools/text/distinct-words/index.js +5 -2
  93. package/build/tools/text/emoji-search/index.js +5 -2
  94. package/build/tools/text/lorem-ipsum-generator/index.js +6 -3
  95. package/build/tools/text/numeronym-generator/index.js +5 -2
  96. package/build/tools/text/slugify-string/index.js +7 -4
  97. package/build/tools/text/string-obfuscator/index.js +6 -3
  98. package/build/tools/text/text-camelcase/index.js +5 -2
  99. package/build/tools/text/text-capitalize/index.js +5 -2
  100. package/build/tools/text/text-diff/index.js +6 -3
  101. package/build/tools/text/text-kebabcase/index.js +5 -2
  102. package/build/tools/text/text-lowercase/index.js +5 -2
  103. package/build/tools/text/text-pascalcase/index.js +5 -2
  104. package/build/tools/text/text-snakecase/index.js +5 -2
  105. package/build/tools/text/text-stats/index.js +5 -2
  106. package/build/tools/text/text-to-nato-alphabet/index.js +6 -3
  107. package/build/tools/text/text-to-unicode/index.js +6 -3
  108. package/build/tools/text/text-to-unicode-names/index.js +5 -2
  109. package/build/tools/text/text-uppercase/index.js +5 -2
  110. package/build/tools/utility/css-prettifier/index.js +6 -3
  111. package/build/tools/utility/device-info/index.js +4 -1
  112. package/build/tools/utility/email-normalizer/index.js +5 -2
  113. package/build/tools/utility/http-status-codes/index.js +5 -2
  114. package/build/tools/utility/mime-types/index.js +6 -3
  115. package/build/tools/utility/port-numbers/index.js +5 -2
  116. package/build/tools/utility/rem-px-converter/index.js +8 -4
  117. package/package.json +1 -1
package/build/index.js CHANGED
@@ -199,15 +199,8 @@ export function getResourceUsage() {
199
199
  };
200
200
  }
201
201
  /**
202
- * Security headers for responses (if applicable)
202
+ * Input validation and security utilities
203
203
  */
204
- export const SECURITY_HEADERS = {
205
- 'X-Content-Type-Options': 'nosniff',
206
- 'X-Frame-Options': 'DENY',
207
- 'X-XSS-Protection': '1; mode=block',
208
- 'Referrer-Policy': 'strict-origin-when-cross-origin',
209
- };
210
- // Helper to read version from package.json at runtime (ESM compatible)
211
204
  // Get package metadata for enhanced server info
212
205
  function getPackageMetadata() {
213
206
  const __dirname = path.dirname(new URL(import.meta.url).pathname);
@@ -232,6 +225,8 @@ const server = new McpServer({
232
225
  capabilities: {
233
226
  resources: {},
234
227
  tools: {},
228
+ prompts: {},
229
+ logging: {}
235
230
  },
236
231
  });
237
232
  // Helper function to dynamically load modular tools from a category directory
@@ -253,13 +248,14 @@ async function loadModularTools(server, category) {
253
248
  const registerFunction = Object.values(toolModule).find((fn) => typeof fn === 'function' && fn.name.startsWith('register'));
254
249
  if (registerFunction) {
255
250
  registerFunction(server);
251
+ console.error(`Loaded tool: ${category}/${toolDir}`);
256
252
  }
257
253
  else {
258
254
  console.warn(`No register function found in ${toolPath}`);
259
255
  }
260
256
  }
261
257
  catch (error) {
262
- console.error(`Failed to load tool ${category}/${toolDir}:`, error);
258
+ console.error(`Failed to load tool ${category}/${toolDir}:`, error instanceof Error ? error.message : 'Unknown error');
263
259
  }
264
260
  }
265
261
  else {
@@ -353,9 +349,25 @@ async function getCategoryDescription(category, toolNames) {
353
349
  const categoryTitle = category.charAt(0).toUpperCase() + category.slice(1);
354
350
  return `${categoryTitle} tools and utilities (${toolNames.length} tools available)`;
355
351
  }
356
- // Register server info tool with dynamic metadata
357
- server.registerTool("server-info", {
358
- description: "Get comprehensive information about the IT Tools MCP server, including available tool categories, version, and capabilities",
352
+ // Register all tools dynamically by discovering categories from filesystem
353
+ async function registerAllTools(server) {
354
+ const toolsBaseDir = path.join(__dirname, 'tools');
355
+ if (!fs.existsSync(toolsBaseDir)) {
356
+ console.warn('Tools directory does not exist:', toolsBaseDir);
357
+ return;
358
+ }
359
+ // Discover categories dynamically from the filesystem
360
+ const categories = fs.readdirSync(toolsBaseDir, { withFileTypes: true })
361
+ .filter(dirent => dirent.isDirectory())
362
+ .map(dirent => dirent.name)
363
+ .sort(); // Sort for consistent ordering
364
+ for (const category of categories) {
365
+ await loadModularTools(server, category);
366
+ }
367
+ }
368
+ // Add comprehensive system and server information tool
369
+ server.registerTool("system-info", {
370
+ description: "Get comprehensive system information, server details, available tool categories, and resource usage",
359
371
  inputSchema: {
360
372
  include_tools: z.boolean().optional().describe("Include detailed information about all available tools"),
361
373
  category: z.string().optional().describe("Get information about a specific category (dynamically discovered)")
@@ -364,13 +376,15 @@ server.registerTool("server-info", {
364
376
  const { include_tools = false, category } = args;
365
377
  // Discover tools dynamically
366
378
  const { toolCategories, totalToolCount } = await discoverTools();
367
- // Get system info
379
+ // Get comprehensive system info
380
+ const usage = getResourceUsage();
368
381
  const systemInfo = {
369
382
  timestamp: new Date().toISOString(),
370
383
  platform: process.platform,
371
384
  nodeVersion: process.version,
372
385
  memoryUsage: process.memoryUsage(),
373
- uptime: process.uptime()
386
+ uptime: process.uptime(),
387
+ resourceUsage: usage
374
388
  };
375
389
  // Server metadata from package.json
376
390
  const serverMetadata = {
@@ -430,62 +444,41 @@ server.registerTool("server-info", {
430
444
  }]
431
445
  };
432
446
  });
433
- // Register all tools dynamically by discovering categories from filesystem
434
- async function registerAllTools(server) {
435
- const toolsBaseDir = path.join(__dirname, 'tools');
436
- if (!fs.existsSync(toolsBaseDir)) {
437
- console.warn('Tools directory does not exist:', toolsBaseDir);
438
- return;
439
- }
440
- // Discover categories dynamically from the filesystem
441
- const categories = fs.readdirSync(toolsBaseDir, { withFileTypes: true })
442
- .filter(dirent => dirent.isDirectory())
443
- .map(dirent => dirent.name)
444
- .sort(); // Sort for consistent ordering
445
- for (const category of categories) {
446
- await loadModularTools(server, category);
447
- }
448
- }
449
- // Add resource monitoring tool
450
- server.tool("system-info", "Get system resource usage and server information", {}, async () => {
451
- const usage = getResourceUsage();
452
- return {
453
- content: [
454
- {
455
- type: "text",
456
- text: JSON.stringify({
457
- server: "IT Tools MCP Server",
458
- version: packageInfo.version,
459
- uptime: `${Math.floor(usage.uptimeSeconds)} seconds`,
460
- memory: usage.memory,
461
- timestamp: new Date().toISOString(),
462
- }, null, 2),
463
- },
464
- ],
465
- };
466
- });
467
447
  // Run the server
468
448
  async function main() {
469
- await registerAllTools(server);
470
- const transport = new StdioServerTransport();
471
- await server.connect(transport);
472
- // Log startup (stderr only, no resource usage)
473
- if (process.env.NODE_ENV === 'test' && process.env.MCP_TEST_MODE === 'true') {
474
- console.error("IT Tools MCP Server running on stdio");
475
- // Exit after stdin closes (for test automation)
476
- process.stdin.on('end', () => {
477
- setTimeout(() => process.exit(0), 100);
478
- });
449
+ try {
450
+ await registerAllTools(server);
451
+ const transport = new StdioServerTransport();
452
+ await server.connect(transport);
453
+ // Log startup (stderr only, no resource usage)
454
+ if (process.env.NODE_ENV === 'test' && process.env.MCP_TEST_MODE === 'true') {
455
+ console.error("IT Tools MCP Server running on stdio");
456
+ // Exit after stdin closes (for test automation)
457
+ process.stdin.on('end', () => {
458
+ setTimeout(() => process.exit(0), 100);
459
+ });
460
+ }
461
+ // Only start periodic monitoring in production, not in tests
462
+ if (process.env.NODE_ENV !== 'test') {
463
+ // Periodic resource monitoring (every 5 minutes)
464
+ setInterval(() => {
465
+ const usage = getResourceUsage();
466
+ if (usage.memory.heapUsedBytes > 200 * 1024 * 1024) { // Alert if using more than 200MB
467
+ console.error("High memory usage detected:", usage.memory);
468
+ }
469
+ }, 5 * 60 * 1000);
470
+ }
471
+ // Handle graceful shutdown
472
+ const shutdown = () => {
473
+ console.error("Shutting down IT Tools MCP Server...");
474
+ process.exit(0);
475
+ };
476
+ process.on('SIGINT', shutdown);
477
+ process.on('SIGTERM', shutdown);
479
478
  }
480
- // Only start periodic monitoring in production, not in tests
481
- if (process.env.NODE_ENV !== 'test') {
482
- // Periodic resource monitoring (every 5 minutes)
483
- setInterval(() => {
484
- const usage = getResourceUsage();
485
- if (usage.memory.heapUsedBytes > 200 * 1024 * 1024) { // Alert if using more than 200MB
486
- console.error("High memory usage detected:", usage.memory);
487
- }
488
- }, 5 * 60 * 1000);
479
+ catch (error) {
480
+ console.error("Failed to start MCP server:", error);
481
+ process.exit(1);
489
482
  }
490
483
  }
491
484
  main().catch((error) => {
@@ -1,7 +1,10 @@
1
1
  import { z } from "zod";
2
2
  export function registerAnsibleInventoryParser(server) {
3
- server.tool("ansible-inventory-parser", "Parse and validate Ansible inventory files", {
4
- inventory: z.string().describe("Ansible inventory content (INI or YAML format)"),
3
+ server.registerTool("ansible-inventory-parser", {
4
+ description: "Parse and validate Ansible inventory files",
5
+ inputSchema: {
6
+ inventory: z.string().describe("Ansible inventory content (INI or YAML format)"),
7
+ }
5
8
  }, async ({ inventory }) => {
6
9
  if (!inventory?.trim()) {
7
10
  return {
@@ -1,7 +1,10 @@
1
1
  import { z } from "zod";
2
2
  export function registerAnsiblePlaybookValidator(server) {
3
- server.tool("ansible-playbook-validator", "Validate Ansible playbook syntax and structure", {
4
- playbook: z.string().describe("Ansible playbook YAML content"),
3
+ server.registerTool("ansible-playbook-validator", {
4
+ description: "Validate Ansible playbook syntax and structure",
5
+ inputSchema: {
6
+ playbook: z.string().describe("Ansible playbook YAML content"),
7
+ }
5
8
  }, async ({ playbook }) => {
6
9
  if (!playbook?.trim()) {
7
10
  return {
@@ -1,5 +1,8 @@
1
1
  export function registerAnsibleReference(server) {
2
- server.tool("ansible-reference", "Get Ansible commands reference and cheatsheet", {}, async () => {
2
+ server.registerTool("ansible-reference", {
3
+ description: "Get Ansible commands reference and cheatsheet",
4
+ inputSchema: {}
5
+ }, async () => {
3
6
  const reference = `# Ansible Quick Reference
4
7
 
5
8
  ## Installation
@@ -1,9 +1,12 @@
1
1
  import { z } from "zod";
2
2
  import { pbkdf2Sync } from "crypto";
3
3
  export function registerAnsibleVaultDecrypt(server) {
4
- server.tool("ansible-vault-decrypt", "Decrypt Ansible Vault encrypted text", {
5
- encryptedText: z.string().describe("Ansible Vault encrypted text to decrypt"),
6
- password: z.string().describe("Password for decryption"),
4
+ server.registerTool("ansible-vault-decrypt", {
5
+ description: "Decrypt Ansible Vault encrypted text",
6
+ inputSchema: {
7
+ encryptedText: z.string().describe("Ansible Vault encrypted text to decrypt"),
8
+ password: z.string().describe("Password for decryption"),
9
+ }
7
10
  }, async ({ encryptedText, password }) => {
8
11
  if (!encryptedText?.trim()) {
9
12
  return {
@@ -1,10 +1,13 @@
1
1
  import { z } from "zod";
2
2
  import { pbkdf2Sync, randomBytes } from "crypto";
3
3
  export function registerAnsibleVaultEncrypt(server) {
4
- server.tool("ansible-vault-encrypt", "Encrypt text using Ansible Vault format", {
5
- text: z.string().describe("Text to encrypt"),
6
- password: z.string().describe("Password for encryption"),
7
- vaultId: z.string().optional().describe("Vault ID for the encrypted content (optional)"),
4
+ server.registerTool("ansible-vault-encrypt", {
5
+ description: "Encrypt text using Ansible Vault format",
6
+ inputSchema: {
7
+ text: z.string().describe("Text to encrypt"),
8
+ password: z.string().describe("Password for encryption"),
9
+ vaultId: z.string().optional().describe("Vault ID for the encrypted content (optional)"),
10
+ }
8
11
  }, async ({ text, password, vaultId }) => {
9
12
  if (!text?.trim()) {
10
13
  return {
@@ -1,8 +1,11 @@
1
1
  import Color from "color";
2
2
  import { z } from "zod";
3
3
  export function registerColorHexToRgb(server) {
4
- server.tool("color-hex-to-rgb", "Convert HEX color to RGB", {
5
- hex: z.string().describe("HEX color code (e.g., #FF5733 or FF5733)"),
4
+ server.registerTool("color-hex-to-rgb", {
5
+ description: "Convert HEX color to RGB",
6
+ inputSchema: {
7
+ hex: z.string().describe("HEX color code (e.g., #FF5733 or FF5733)"),
8
+ }
6
9
  }, async ({ hex }) => {
7
10
  try {
8
11
  const rgb = Color(hex).rgb().array();
@@ -1,10 +1,13 @@
1
1
  import Color from "color";
2
2
  import { z } from "zod";
3
3
  export function registerColorRgbToHex(server) {
4
- server.tool("color-rgb-to-hex", "Convert RGB color to HEX", {
5
- r: z.number().describe("Red value (0-255)"),
6
- g: z.number().describe("Green value (0-255)"),
7
- b: z.number().describe("Blue value (0-255)"),
4
+ server.registerTool("color-rgb-to-hex", {
5
+ description: "Convert RGB color to HEX",
6
+ inputSchema: {
7
+ r: z.number().describe("Red value (0-255)"),
8
+ g: z.number().describe("Green value (0-255)"),
9
+ b: z.number().describe("Blue value (0-255)"),
10
+ }
8
11
  }, async ({ r, g, b }) => {
9
12
  try {
10
13
  if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255) {
@@ -1,8 +1,11 @@
1
1
  import { z } from "zod";
2
2
  export function registerBasicAuthGenerator(server) {
3
- server.tool("basic-auth-generator", "Generate HTTP Basic Authentication header", {
4
- username: z.string().describe("Username"),
5
- password: z.string().describe("Password"),
3
+ server.registerTool("basic-auth-generator", {
4
+ description: "Generate HTTP Basic Authentication header",
5
+ inputSchema: {
6
+ username: z.string().describe("Username"),
7
+ password: z.string().describe("Password"),
8
+ }
6
9
  }, async ({ username, password }) => {
7
10
  try {
8
11
  const credentials = `${username}:${password}`;
@@ -1,10 +1,13 @@
1
1
  import bcryptjs from "bcryptjs";
2
2
  import { z } from "zod";
3
3
  export function registerBcryptHash(server) {
4
- server.tool("bcrypt-hash", "Generate bcrypt hash or verify password against hash", {
5
- password: z.string().describe("Password to hash or verify"),
6
- rounds: z.number().describe("Number of salt rounds (4-12, default 10)").optional(),
7
- hash: z.string().optional().describe("Existing hash to verify against (for verification)"),
4
+ server.registerTool("bcrypt-hash", {
5
+ description: "Generate bcrypt hash or verify password against hash",
6
+ inputSchema: {
7
+ password: z.string().describe("Password to hash or verify"),
8
+ rounds: z.number().describe("Number of salt rounds (4-12, default 10)").optional(),
9
+ hash: z.string().optional().describe("Existing hash to verify against (for verification)"),
10
+ }
8
11
  }, async ({ password, rounds = 10, hash }) => {
9
12
  try {
10
13
  if (rounds < 4 || rounds > 12) {
@@ -1,8 +1,11 @@
1
1
  import * as bip39 from "bip39";
2
2
  import { z } from "zod";
3
3
  export function registerBip39Generate(server) {
4
- server.tool("bip39-generate", "Generate BIP39 mnemonic phrases", {
5
- wordCount: z.enum(["12", "15", "18", "21", "24"]).describe("Number of words in the mnemonic").optional(),
4
+ server.registerTool("bip39-generate", {
5
+ description: "Generate BIP39 mnemonic phrases",
6
+ inputSchema: {
7
+ wordCount: z.enum(["12", "15", "18", "21", "24"]).describe("Number of words in the mnemonic").optional(),
8
+ }
6
9
  }, async ({ wordCount = "12" }) => {
7
10
  try {
8
11
  const count = parseInt(wordCount);
@@ -1,8 +1,11 @@
1
1
  import { createHash } from "crypto";
2
2
  import { z } from "zod";
3
3
  export function registerHashMd5(server) {
4
- server.tool("hash-md5", "Generate MD5 hash", {
5
- text: z.string().describe("Text to hash with MD5"),
4
+ server.registerTool("hash-md5", {
5
+ description: "Generate MD5 hash",
6
+ inputSchema: {
7
+ text: z.string().describe("Text to hash with MD5"),
8
+ }
6
9
  }, async ({ text }) => {
7
10
  const hash = createHash('md5');
8
11
  hash.update(text);
@@ -1,8 +1,11 @@
1
1
  import { createHash } from "crypto";
2
2
  import { z } from "zod";
3
3
  export function registerHashSha1(server) {
4
- server.tool("hash-sha1", "Generate SHA1 hash", {
5
- text: z.string().describe("Text to hash with SHA1"),
4
+ server.registerTool("hash-sha1", {
5
+ description: "Generate SHA1 hash",
6
+ inputSchema: {
7
+ text: z.string().describe("Text to hash with SHA1"),
8
+ }
6
9
  }, async ({ text }) => {
7
10
  const hash = createHash('sha1');
8
11
  hash.update(text);
@@ -1,8 +1,11 @@
1
1
  import { createHash } from "crypto";
2
2
  import { z } from "zod";
3
3
  export function registerHashSha256(server) {
4
- server.tool("hash-sha256", "Generate SHA256 hash", {
5
- text: z.string().describe("Text to hash with SHA256"),
4
+ server.registerTool("hash-sha256", {
5
+ description: 'Generate SHA256 hash of input text. Example: "hello" → "2cf24dba4f21d..."',
6
+ inputSchema: {
7
+ text: z.string().describe("Text to hash with SHA256"),
8
+ }
6
9
  }, async ({ text }) => {
7
10
  const hash = createHash('sha256');
8
11
  hash.update(text);
@@ -1,8 +1,11 @@
1
1
  import { createHash } from "crypto";
2
2
  import { z } from "zod";
3
3
  export function registerHashSha512(server) {
4
- server.tool("hash-sha512", "Generate SHA512 hash", {
5
- text: z.string().describe("Text to hash with SHA512"),
4
+ server.registerTool("hash-sha512", {
5
+ description: "Generate SHA512 hash",
6
+ inputSchema: {
7
+ text: z.string().describe("Text to hash with SHA512"),
8
+ }
6
9
  }, async ({ text }) => {
7
10
  const hash = createHash('sha512');
8
11
  hash.update(text);
@@ -1,10 +1,13 @@
1
1
  import { createHmac } from "crypto";
2
2
  import { z } from "zod";
3
3
  export function registerHmacGenerator(server) {
4
- server.tool("hmac-generator", "Generate HMAC (Hash-based Message Authentication Code)", {
5
- message: z.string().describe("Message to authenticate"),
6
- key: z.string().describe("Secret key for HMAC"),
7
- algorithm: z.enum(["sha1", "sha256", "sha512"]).describe("Hash algorithm").optional(),
4
+ server.registerTool("hmac-generator", {
5
+ description: "Generate HMAC (Hash-based Message Authentication Code)",
6
+ inputSchema: {
7
+ message: z.string().describe("Message to authenticate"),
8
+ key: z.string().describe("Secret key for HMAC"),
9
+ algorithm: z.enum(["sha1", "sha256", "sha512"]).describe("Hash algorithm").optional(),
10
+ }
8
11
  }, async ({ message, key, algorithm = "sha256" }) => {
9
12
  try {
10
13
  const hmac = createHmac(algorithm, key);
@@ -1,7 +1,10 @@
1
1
  import { z } from "zod";
2
2
  export function registerJwtDecode(server) {
3
- server.tool("jwt-decode", "Decode JWT token (header and payload only)", {
4
- token: z.string().describe("JWT token to decode"),
3
+ server.registerTool("jwt-decode", {
4
+ description: "Decode JWT token (header and payload only)",
5
+ inputSchema: {
6
+ token: z.string().describe("JWT token to decode"),
7
+ }
5
8
  }, async ({ token }) => {
6
9
  try {
7
10
  const parts = token.split('.');
@@ -1,10 +1,13 @@
1
1
  import speakeasy from "speakeasy";
2
2
  import { z } from "zod";
3
3
  export function registerOtpCodeGenerator(server) {
4
- server.tool("otp-code-generator", "Generate Time-based One-Time Password (TOTP) codes", {
5
- secret: z.string().describe("Base32 encoded secret key"),
6
- digits: z.number().describe("Number of digits in the code").optional(),
7
- period: z.number().describe("Time period in seconds").optional(),
4
+ server.registerTool("otp-code-generator", {
5
+ description: "Generate Time-based One-Time Password (TOTP) codes",
6
+ inputSchema: {
7
+ secret: z.string().describe("Base32 encoded secret key"),
8
+ digits: z.number().describe("Number of digits in the code").optional(),
9
+ period: z.number().describe("Time period in seconds").optional(),
10
+ }
8
11
  }, async ({ secret, digits = 6, period = 30 }) => {
9
12
  try {
10
13
  if (digits < 4 || digits > 10) {
@@ -1,11 +1,14 @@
1
1
  import { z } from "zod";
2
2
  export function registerPasswordGenerate(server) {
3
- server.tool("password-generate", "Generate a secure password", {
4
- length: z.number().describe("Password length").optional(),
5
- includeUppercase: z.boolean().describe("Include uppercase letters").optional(),
6
- includeLowercase: z.boolean().describe("Include lowercase letters").optional(),
7
- includeNumbers: z.boolean().describe("Include numbers").optional(),
8
- includeSymbols: z.boolean().describe("Include symbols").optional(),
3
+ server.registerTool("password-generate", {
4
+ description: "Generate a secure password",
5
+ inputSchema: {
6
+ length: z.number().describe("Password length").optional(),
7
+ includeUppercase: z.boolean().describe("Include uppercase letters").optional(),
8
+ includeLowercase: z.boolean().describe("Include lowercase letters").optional(),
9
+ includeNumbers: z.boolean().describe("Include numbers").optional(),
10
+ includeSymbols: z.boolean().describe("Include symbols").optional(),
11
+ }
9
12
  }, async ({ length = 16, includeUppercase = true, includeLowercase = true, includeNumbers = true, includeSymbols = true }) => {
10
13
  if (length < 4 || length > 128) {
11
14
  return {
@@ -1,9 +1,12 @@
1
1
  import { z } from "zod";
2
2
  export function registerTokenGenerator(server) {
3
- server.tool("token-generator", "Generate secure random tokens", {
4
- length: z.number().describe("Token length").optional(),
5
- charset: z.enum(["alphanumeric", "hex", "base64", "custom"]).describe("Character set to use").optional(),
6
- customChars: z.string().optional().describe("Custom characters (required if charset is 'custom')"),
3
+ server.registerTool("token-generator", {
4
+ description: "Generate secure random tokens",
5
+ inputSchema: {
6
+ length: z.number().describe("Token length").optional(),
7
+ charset: z.enum(["alphanumeric", "hex", "base64", "custom"]).describe("Character set to use").optional(),
8
+ customChars: z.string().optional().describe("Custom characters (required if charset is 'custom')"),
9
+ }
7
10
  }, async ({ length = 32, charset = "alphanumeric", customChars }) => {
8
11
  try {
9
12
  if (length < 8 || length > 256) {
@@ -1,7 +1,10 @@
1
1
  import { z } from "zod";
2
2
  export function registerHtmlToMarkdown(server) {
3
- server.tool("html-to-markdown", "Convert HTML to Markdown", {
4
- html: z.string().describe("HTML content to convert to Markdown"),
3
+ server.registerTool("html-to-markdown", {
4
+ description: "Convert HTML to Markdown",
5
+ inputSchema: {
6
+ html: z.string().describe("HTML content to convert to Markdown"),
7
+ }
5
8
  }, async ({ html }) => {
6
9
  try {
7
10
  const TurndownService = (await import("turndown")).default;
@@ -1,8 +1,11 @@
1
1
  import { z } from "zod";
2
2
  export function registerJsonDiff(server) {
3
- server.tool("json-diff", "Compare two JSON objects and show differences", {
4
- json1: z.string().describe("First JSON object"),
5
- json2: z.string().describe("Second JSON object"),
3
+ server.registerTool("json-diff", {
4
+ description: "Compare two JSON objects and show differences",
5
+ inputSchema: {
6
+ json1: z.string().describe("First JSON object"),
7
+ json2: z.string().describe("Second JSON object"),
8
+ }
6
9
  }, async ({ json1, json2 }) => {
7
10
  try {
8
11
  const obj1 = JSON.parse(json1);
@@ -1,8 +1,11 @@
1
1
  import { z } from "zod";
2
2
  export function registerJsonFormat(server) {
3
- server.tool("json-format", "Format and validate JSON", {
4
- json: z.string().describe("JSON string to format"),
5
- indent: z.number().describe("Number of spaces for indentation").optional(),
3
+ server.registerTool("json-format", {
4
+ description: 'Format and prettify JSON with proper indentation. Example: {"a":1,"b":2} → formatted JSON',
5
+ inputSchema: {
6
+ json: z.string().describe("JSON string to format"),
7
+ indent: z.number().describe("Number of spaces for indentation").optional(),
8
+ }
6
9
  }, async ({ json, indent = 2 }) => {
7
10
  try {
8
11
  if (indent < 0 || indent > 10) {
@@ -88,6 +91,7 @@ Examples of supported formats:
88
91
  }
89
92
  catch (error) {
90
93
  return {
94
+ isError: true,
91
95
  content: [
92
96
  {
93
97
  type: "text",
@@ -1,7 +1,10 @@
1
1
  import { z } from "zod";
2
2
  export function registerJsonMinify(server) {
3
- server.tool("json-minify", "Minify JSON by removing whitespace", {
4
- json: z.string().describe("JSON string to minify"),
3
+ server.registerTool("json-minify", {
4
+ description: "Minify JSON by removing whitespace",
5
+ inputSchema: {
6
+ json: z.string().describe("JSON string to minify"),
7
+ }
5
8
  }, async ({ json }) => {
6
9
  try {
7
10
  const parsed = JSON.parse(json);
@@ -1,8 +1,11 @@
1
1
  import { z } from "zod";
2
2
  export function registerJsonToCsv(server) {
3
- server.tool("json-to-csv", "Convert JSON to CSV format", {
4
- json: z.string().describe("JSON string to convert to CSV"),
5
- delimiter: z.string().describe("CSV delimiter").optional(),
3
+ server.registerTool("json-to-csv", {
4
+ description: "Convert JSON to CSV format",
5
+ inputSchema: {
6
+ json: z.string().describe("JSON string to convert to CSV"),
7
+ delimiter: z.string().describe("CSV delimiter").optional(),
8
+ }
6
9
  }, async ({ json, delimiter = "," }) => {
7
10
  try {
8
11
  const Papa = (await import("papaparse")).default;
@@ -1,7 +1,10 @@
1
1
  import { z } from "zod";
2
2
  export function registerJsonToToml(server) {
3
- server.tool("json-to-toml", "Convert JSON to TOML format", {
4
- json: z.string().describe("JSON string to convert"),
3
+ server.registerTool("json-to-toml", {
4
+ description: "Convert JSON to TOML format",
5
+ inputSchema: {
6
+ json: z.string().describe("JSON string to convert"),
7
+ }
5
8
  }, async ({ json }) => {
6
9
  try {
7
10
  const toml = await import("@iarna/toml");
@@ -1,7 +1,10 @@
1
1
  import { z } from "zod";
2
2
  export function registerMarkdownToHtml(server) {
3
- server.tool("markdown-to-html", "Convert Markdown to HTML", {
4
- markdown: z.string().describe("Markdown content to convert to HTML"),
3
+ server.registerTool("markdown-to-html", {
4
+ description: "Convert Markdown to HTML",
5
+ inputSchema: {
6
+ markdown: z.string().describe("Markdown content to convert to HTML"),
7
+ }
5
8
  }, async ({ markdown }) => {
6
9
  try {
7
10
  const { marked } = await import("marked");
@@ -1,8 +1,11 @@
1
1
  import { z } from "zod";
2
2
  export function registerPhoneFormat(server) {
3
- server.tool("phone-format", "Parse and format phone numbers", {
4
- phoneNumber: z.string().describe("Phone number to parse and format"),
5
- countryCode: z.string().optional().describe("Country code (e.g., 'US', 'GB', 'FR')"),
3
+ server.registerTool("phone-format", {
4
+ description: "Parse and format phone numbers",
5
+ inputSchema: {
6
+ phoneNumber: z.string().describe("Phone number to parse and format"),
7
+ countryCode: z.string().optional().describe("Country code (e.g., 'US', 'GB', 'FR')"),
8
+ }
6
9
  }, async ({ phoneNumber, countryCode }) => {
7
10
  try {
8
11
  const { isValidPhoneNumber, parsePhoneNumber } = await import("libphonenumber-js");