it-tools-mcp 5.2.8 → 5.8.2
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/build/index.js +3 -7
- package/build/tools/ansible/decrypt_ansible_vault/index.js +0 -2
- package/build/tools/ansible/encrypt_ansible_vault/index.js +0 -2
- package/build/tools/ansible/generate_ansible_inventory/index.js +0 -2
- package/build/tools/ansible/parse_ansible_inventory/index.js +0 -2
- package/build/tools/ansible/show_ansible_reference/index.js +0 -2
- package/build/tools/ansible/validate_ansible_playbook/index.js +0 -2
- package/build/tools/color/convert_hex_to_rgb/index.js +0 -2
- package/build/tools/color/convert_rgb_to_hex/index.js +0 -2
- package/build/tools/crypto/decode_jwt/index.js +0 -2
- package/build/tools/crypto/generate_basic_auth/index.js +0 -2
- package/build/tools/crypto/generate_bip39/index.js +0 -2
- package/build/tools/crypto/generate_hmac/index.js +0 -2
- package/build/tools/crypto/generate_otp/index.js +0 -2
- package/build/tools/crypto/generate_password/index.js +0 -2
- package/build/tools/crypto/generate_token/index.js +0 -2
- package/build/tools/crypto/hash_bcrypt/index.js +0 -2
- package/build/tools/crypto/hash_md5/index.js +0 -2
- package/build/tools/crypto/hash_sha1/index.js +0 -2
- package/build/tools/crypto/hash_sha256/index.js +0 -2
- package/build/tools/crypto/hash_sha512/index.js +0 -2
- package/build/tools/data_format/compare_json/index.js +0 -2
- package/build/tools/data_format/convert_html_to_markdown/index.js +0 -2
- package/build/tools/data_format/convert_json_to_csv/index.js +0 -2
- package/build/tools/data_format/convert_json_to_toml/index.js +0 -2
- package/build/tools/data_format/convert_markdown_to_html/index.js +0 -2
- package/build/tools/data_format/convert_toml_to_json/index.js +0 -2
- package/build/tools/data_format/format_json/index.js +17 -30
- package/build/tools/data_format/format_phone/index.js +0 -2
- package/build/tools/data_format/format_sql/index.js +0 -2
- package/build/tools/data_format/format_xml/index.js +0 -2
- package/build/tools/data_format/format_yaml/index.js +0 -2
- package/build/tools/data_format/minify_json/index.js +0 -2
- package/build/tools/development/convert_list/index.js +0 -2
- package/build/tools/development/format_html/index.js +0 -2
- package/build/tools/development/format_javascript/index.js +0 -2
- package/build/tools/development/generate_crontab/index.js +0 -2
- package/build/tools/development/generate_markdown_toc/index.js +0 -2
- package/build/tools/development/test_regex/index.js +0 -2
- package/build/tools/docker/convert_docker_compose_to_run/index.js +0 -2
- package/build/tools/docker/convert_docker_run_to_compose/index.js +0 -2
- package/build/tools/docker/generate_traefik_compose/index.js +0 -2
- package/build/tools/docker/show_docker_reference/index.js +0 -2
- package/build/tools/docker/validate_docker_compose/index.js +0 -2
- package/build/tools/encoding/convert_text_to_binary/index.js +0 -2
- package/build/tools/encoding/decode_base64/index.js +0 -2
- package/build/tools/encoding/decode_html/index.js +0 -2
- package/build/tools/encoding/decode_url/index.js +0 -2
- package/build/tools/encoding/encode_base64/index.js +0 -2
- package/build/tools/encoding/encode_html/index.js +0 -2
- package/build/tools/encoding/encode_html_entities/index.js +0 -2
- package/build/tools/encoding/encode_url/index.js +0 -2
- package/build/tools/forensic/decode_safelink/index.js +0 -2
- package/build/tools/forensic/fang_url/index.js +0 -2
- package/build/tools/forensic/identify_file_type/index.js +0 -2
- package/build/tools/id_generators/generate_qr_code/index.js +0 -2
- package/build/tools/id_generators/generate_svg_placeholder/index.js +0 -2
- package/build/tools/id_generators/generate_ulid/index.js +0 -2
- package/build/tools/id_generators/generate_uuid/index.js +0 -2
- package/build/tools/math/calculate_percentage/index.js +0 -2
- package/build/tools/math/convert_number_base/index.js +0 -2
- package/build/tools/math/convert_roman_numerals/index.js +0 -2
- package/build/tools/math/convert_temperature/index.js +0 -2
- package/build/tools/math/convert_unix_timestamp/index.js +0 -2
- package/build/tools/math/evaluate_math/index.js +0 -2
- package/build/tools/network/calculate_ip_subnet/index.js +0 -2
- package/build/tools/network/calculate_ipv4_subnet/index.js +0 -2
- package/build/tools/network/calculate_ipv6_subnet/index.js +0 -2
- package/build/tools/network/cat/index.js +0 -2
- package/build/tools/network/convert_cidr_to_ip_range/index.js +0 -2
- package/build/tools/network/convert_ip_range_to_cidr/index.js +0 -2
- package/build/tools/network/curl/index.js +0 -2
- package/build/tools/network/dig/index.js +0 -2
- package/build/tools/network/generate_ipv6_ula/index.js +0 -2
- package/build/tools/network/generate_mac_address/index.js +0 -2
- package/build/tools/network/generate_random_port/index.js +0 -2
- package/build/tools/network/grep/index.js +0 -2
- package/build/tools/network/head/index.js +0 -2
- package/build/tools/network/nslookup/index.js +0 -2
- package/build/tools/network/parse_url/index.js +0 -2
- package/build/tools/network/ping/index.js +0 -2
- package/build/tools/network/ps/index.js +0 -2
- package/build/tools/network/scp/index.js +0 -2
- package/build/tools/network/ssh/index.js +0 -2
- package/build/tools/network/tail/index.js +0 -2
- package/build/tools/network/telnet/index.js +0 -2
- package/build/tools/network/top/index.js +0 -2
- package/build/tools/network/validate_iban/index.js +0 -2
- package/build/tools/physics/convert_angle/index.js +0 -2
- package/build/tools/physics/convert_energy/index.js +0 -2
- package/build/tools/physics/convert_power/index.js +0 -2
- package/build/tools/text/analyze_distinct_words/index.js +0 -2
- package/build/tools/text/analyze_text_stats/index.js +0 -2
- package/build/tools/text/capitalize_text/index.js +0 -2
- package/build/tools/text/compare_text/index.js +0 -2
- package/build/tools/text/convert_text_to_camelcase/index.js +0 -2
- package/build/tools/text/convert_text_to_kebabcase/index.js +0 -2
- package/build/tools/text/convert_text_to_lowercase/index.js +0 -2
- package/build/tools/text/convert_text_to_nato/index.js +0 -2
- package/build/tools/text/convert_text_to_pascalcase/index.js +0 -2
- package/build/tools/text/convert_text_to_unicode/index.js +0 -2
- package/build/tools/text/convert_text_to_uppercase/index.js +0 -2
- package/build/tools/text/generate_ascii_art/index.js +0 -2
- package/build/tools/text/generate_lorem_ipsum/index.js +0 -2
- package/build/tools/text/generate_numeronym/index.js +0 -2
- package/build/tools/text/obfuscate_string/index.js +0 -2
- package/build/tools/text/search_emoji/index.js +0 -2
- package/build/tools/text/show_unicode_names/index.js +0 -2
- package/build/tools/text/slugify_text/index.js +0 -2
- package/build/tools/text/text_snakecase/index.js +0 -2
- package/build/tools/utility/convert_rem_px/index.js +0 -2
- package/build/tools/utility/format_css/index.js +0 -2
- package/build/tools/utility/lookup_http_status/index.js +0 -2
- package/build/tools/utility/lookup_mime_types/index.js +0 -2
- package/build/tools/utility/lookup_port_numbers/index.js +0 -2
- package/build/tools/utility/normalize_email/index.js +0 -2
- package/build/tools/utility/show_device_info/index.js +0 -2
- package/package.json +4 -4
package/build/index.js
CHANGED
|
@@ -204,7 +204,7 @@ export function getResourceUsage() {
|
|
|
204
204
|
*/
|
|
205
205
|
// Get package metadata for enhanced server info
|
|
206
206
|
function getPackageMetadata() {
|
|
207
|
-
|
|
207
|
+
// Use module-level __dirname (correctly handles Windows paths via fileURLToPath)
|
|
208
208
|
const pkgPath = path.resolve(__dirname, '../package.json');
|
|
209
209
|
const pkgRaw = fs.readFileSync(pkgPath, 'utf-8');
|
|
210
210
|
const pkg = JSON.parse(pkgRaw);
|
|
@@ -245,11 +245,8 @@ const activeRequests = new Map();
|
|
|
245
245
|
const server = new McpServer({
|
|
246
246
|
name: "it-tools-mcp",
|
|
247
247
|
version: packageInfo.version,
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
homepage: packageInfo.homepage,
|
|
251
|
-
repository: packageInfo.repository,
|
|
252
|
-
license: packageInfo.license,
|
|
248
|
+
title: "IT Tools MCP Server - a comprehensive collection of IT utilities",
|
|
249
|
+
websiteUrl: packageInfo.homepage
|
|
253
250
|
}, {
|
|
254
251
|
capabilities: {
|
|
255
252
|
tools: {
|
|
@@ -1029,7 +1026,6 @@ server.registerTool("system_info", {
|
|
|
1029
1026
|
// VS Code compliance annotations
|
|
1030
1027
|
annotations: {
|
|
1031
1028
|
title: "System Information",
|
|
1032
|
-
description: "Comprehensive system and server information including tool categories and resource usage",
|
|
1033
1029
|
readOnlyHint: true
|
|
1034
1030
|
}
|
|
1035
1031
|
}, async (args) => {
|
|
@@ -2,7 +2,6 @@ import { z } from "zod";
|
|
|
2
2
|
import { pbkdf2Sync } from "crypto";
|
|
3
3
|
export function registerDecryptAnsibleVault(server) {
|
|
4
4
|
server.registerTool("decrypt_ansible_vault", {
|
|
5
|
-
description: "Decrypt Ansible Vault encrypted text",
|
|
6
5
|
inputSchema: {
|
|
7
6
|
encryptedText: z.string().describe("Ansible Vault encrypted text to decrypt"),
|
|
8
7
|
password: z.string().describe("Password for decryption"),
|
|
@@ -10,7 +9,6 @@ export function registerDecryptAnsibleVault(server) {
|
|
|
10
9
|
// VS Code compliance annotations
|
|
11
10
|
annotations: {
|
|
12
11
|
title: "Decrypt Ansible Vault",
|
|
13
|
-
description: "Decrypt Ansible Vault encrypted text",
|
|
14
12
|
readOnlyHint: false
|
|
15
13
|
}
|
|
16
14
|
}, async ({ encryptedText, password }) => {
|
|
@@ -2,7 +2,6 @@ import { z } from "zod";
|
|
|
2
2
|
import { pbkdf2Sync, randomBytes } from "crypto";
|
|
3
3
|
export function registerEncryptAnsibleVault(server) {
|
|
4
4
|
server.registerTool("encrypt_ansible_vault", {
|
|
5
|
-
description: "Encrypt text using Ansible Vault format",
|
|
6
5
|
inputSchema: {
|
|
7
6
|
text: z.string().describe("Text to encrypt"),
|
|
8
7
|
password: z.string().describe("Password for encryption"),
|
|
@@ -11,7 +10,6 @@ export function registerEncryptAnsibleVault(server) {
|
|
|
11
10
|
// VS Code compliance annotations
|
|
12
11
|
annotations: {
|
|
13
12
|
title: "Encrypt Ansible Vault",
|
|
14
|
-
description: "Encrypt text using Ansible Vault format",
|
|
15
13
|
readOnlyHint: false
|
|
16
14
|
}
|
|
17
15
|
}, async ({ text, password, vaultId }) => {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerAnsibleInventoryParser(server) {
|
|
3
3
|
server.registerTool("generate_ansible_inventory", {
|
|
4
|
-
description: "Parse and validate Ansible inventory files",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
inventory: z.string().describe("Ansible inventory content (INI or YAML format)"),
|
|
7
6
|
},
|
|
8
7
|
// VS Code compliance annotations
|
|
9
8
|
annotations: {
|
|
10
9
|
title: "Generate Ansible Inventory",
|
|
11
|
-
description: "Parse and validate Ansible inventory files",
|
|
12
10
|
readOnlyHint: false
|
|
13
11
|
}
|
|
14
12
|
}, async ({ inventory }) => {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerAnsibleInventoryParser(server) {
|
|
3
3
|
server.registerTool("parse_ansible_inventory", {
|
|
4
|
-
description: "Parse and validate Ansible inventory files",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
inventory: z.string().describe("Ansible inventory content (INI or YAML format)"),
|
|
7
6
|
},
|
|
8
7
|
// VS Code compliance annotations
|
|
9
8
|
annotations: {
|
|
10
9
|
title: "Generate Ansible Inventory",
|
|
11
|
-
description: "Parse and validate Ansible inventory files",
|
|
12
10
|
readOnlyHint: false
|
|
13
11
|
}
|
|
14
12
|
}, async ({ inventory }) => {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export function registerReferenceAnsible(server) {
|
|
2
2
|
server.registerTool("show_ansible_reference", {
|
|
3
|
-
description: "Get Ansible commands reference and cheatsheet",
|
|
4
3
|
inputSchema: {},
|
|
5
4
|
// VS Code compliance annotations
|
|
6
5
|
annotations: {
|
|
7
6
|
title: "Show Ansible Reference",
|
|
8
|
-
description: "Get Ansible commands reference and cheatsheet",
|
|
9
7
|
readOnlyHint: true
|
|
10
8
|
}
|
|
11
9
|
}, async () => {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerValidateAnsiblePlaybook(server) {
|
|
3
3
|
server.registerTool("validate_ansible_playbook", {
|
|
4
|
-
description: "Validate Ansible playbook syntax and structure",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
playbook: z.string().describe("Ansible playbook YAML content"),
|
|
7
6
|
},
|
|
8
7
|
// VS Code compliance annotations
|
|
9
8
|
annotations: {
|
|
10
9
|
title: "Validate Ansible Playbook",
|
|
11
|
-
description: "Validate Ansible playbook syntax and structure",
|
|
12
10
|
readOnlyHint: false
|
|
13
11
|
}
|
|
14
12
|
}, async ({ playbook }) => {
|
|
@@ -2,14 +2,12 @@ import Color from "color";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export function registerConvertHexRgb(server) {
|
|
4
4
|
server.registerTool("convert_hex_to_rgb", {
|
|
5
|
-
description: "Convert HEX color to RGB",
|
|
6
5
|
inputSchema: {
|
|
7
6
|
hex: z.string().describe("HEX color code (e.g., #FF5733 or FF5733)"),
|
|
8
7
|
},
|
|
9
8
|
// VS Code compliance annotations
|
|
10
9
|
annotations: {
|
|
11
10
|
title: "Convert Hex To Rgb",
|
|
12
|
-
description: "Convert HEX color to RGB",
|
|
13
11
|
readOnlyHint: false
|
|
14
12
|
}
|
|
15
13
|
}, async ({ hex }) => {
|
|
@@ -2,7 +2,6 @@ import Color from "color";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export function registerConvertRgbHex(server) {
|
|
4
4
|
server.registerTool("convert_rgb_to_hex", {
|
|
5
|
-
description: "Convert RGB color to HEX",
|
|
6
5
|
inputSchema: {
|
|
7
6
|
r: z.number().describe("Red value (0-255)"),
|
|
8
7
|
g: z.number().describe("Green value (0-255)"),
|
|
@@ -11,7 +10,6 @@ export function registerConvertRgbHex(server) {
|
|
|
11
10
|
// VS Code compliance annotations
|
|
12
11
|
annotations: {
|
|
13
12
|
title: "Convert Rgb To Hex",
|
|
14
|
-
description: "Convert RGB color to HEX",
|
|
15
13
|
readOnlyHint: false
|
|
16
14
|
}
|
|
17
15
|
}, async ({ r, g, b }) => {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerDecodeJwt(server) {
|
|
3
3
|
server.registerTool("decode_jwt", {
|
|
4
|
-
description: "Decode JWT token (header and payload only)",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
token: z.string().describe("JWT token to decode"),
|
|
7
6
|
},
|
|
8
7
|
// VS Code compliance annotations
|
|
9
8
|
annotations: {
|
|
10
9
|
title: "Decode Jwt",
|
|
11
|
-
description: "Decode JWT token (header and payload only)",
|
|
12
10
|
readOnlyHint: false
|
|
13
11
|
}
|
|
14
12
|
}, async ({ token }) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerGenerateAuth(server) {
|
|
3
3
|
server.registerTool("generate_basic_auth", {
|
|
4
|
-
description: "Generate HTTP Basic Authentication header",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
username: z.string().describe("Username"),
|
|
7
6
|
password: z.string().describe("Password"),
|
|
@@ -9,7 +8,6 @@ export function registerGenerateAuth(server) {
|
|
|
9
8
|
// VS Code compliance annotations
|
|
10
9
|
annotations: {
|
|
11
10
|
title: "Generate Basic Auth",
|
|
12
|
-
description: "Generate HTTP Basic Authentication header",
|
|
13
11
|
readOnlyHint: false
|
|
14
12
|
}
|
|
15
13
|
}, async ({ username, password }) => {
|
|
@@ -2,14 +2,12 @@ import * as bip39 from "bip39";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export function registerGenerateBip39(server) {
|
|
4
4
|
server.registerTool("generate_bip39", {
|
|
5
|
-
description: "Generate BIP39 mnemonic phrases",
|
|
6
5
|
inputSchema: {
|
|
7
6
|
wordCount: z.enum(["12", "15", "18", "21", "24"]).describe("Number of words in the mnemonic").optional(),
|
|
8
7
|
},
|
|
9
8
|
// VS Code compliance annotations
|
|
10
9
|
annotations: {
|
|
11
10
|
title: "Generate Bip39",
|
|
12
|
-
description: "Generate BIP39 mnemonic phrases",
|
|
13
11
|
readOnlyHint: false
|
|
14
12
|
}
|
|
15
13
|
}, async ({ wordCount = "12" }) => {
|
|
@@ -2,7 +2,6 @@ import { createHmac } from "crypto";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export function registerGenerateHmac(server) {
|
|
4
4
|
server.registerTool("generate_hmac", {
|
|
5
|
-
description: "Generate HMAC (Hash-based Message Authentication Code)",
|
|
6
5
|
inputSchema: {
|
|
7
6
|
message: z.string().describe("Message to authenticate"),
|
|
8
7
|
key: z.string().describe("Secret key for HMAC"),
|
|
@@ -11,7 +10,6 @@ export function registerGenerateHmac(server) {
|
|
|
11
10
|
// VS Code compliance annotations
|
|
12
11
|
annotations: {
|
|
13
12
|
title: "Generate Hmac",
|
|
14
|
-
description: "Generate HMAC (Hash-based Message Authentication Code)",
|
|
15
13
|
readOnlyHint: false
|
|
16
14
|
}
|
|
17
15
|
}, async ({ message, key, algorithm = "sha256" }) => {
|
|
@@ -2,7 +2,6 @@ import speakeasy from "speakeasy";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export function registerGenerateOtp(server) {
|
|
4
4
|
server.registerTool("generate_otp", {
|
|
5
|
-
description: "Generate Time-based One-Time Password (TOTP) codes",
|
|
6
5
|
inputSchema: {
|
|
7
6
|
secret: z.string().describe("Base32 encoded secret key"),
|
|
8
7
|
digits: z.number().describe("Number of digits in the code").optional(),
|
|
@@ -11,7 +10,6 @@ export function registerGenerateOtp(server) {
|
|
|
11
10
|
// VS Code compliance annotations
|
|
12
11
|
annotations: {
|
|
13
12
|
title: "Generate Otp",
|
|
14
|
-
description: "Generate Time-based One-Time Password (TOTP) codes",
|
|
15
13
|
readOnlyHint: false
|
|
16
14
|
}
|
|
17
15
|
}, async ({ secret, digits = 6, period = 30 }) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerGeneratePassword(server) {
|
|
3
3
|
server.registerTool("generate_password", {
|
|
4
|
-
description: "Generate a secure password",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
length: z.number().describe("Password length").optional(),
|
|
7
6
|
includeUppercase: z.boolean().describe("Include uppercase letters").optional(),
|
|
@@ -12,7 +11,6 @@ export function registerGeneratePassword(server) {
|
|
|
12
11
|
// VS Code compliance annotations
|
|
13
12
|
annotations: {
|
|
14
13
|
title: "Generate Password",
|
|
15
|
-
description: "Generate a secure password",
|
|
16
14
|
readOnlyHint: false
|
|
17
15
|
}
|
|
18
16
|
}, async ({ length = 16, includeUppercase = true, includeLowercase = true, includeNumbers = true, includeSymbols = true }) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerGenerateToken(server) {
|
|
3
3
|
server.registerTool("generate_token", {
|
|
4
|
-
description: "Generate secure random tokens",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
length: z.number().describe("Token length").optional(),
|
|
7
6
|
charset: z.enum(["alphanumeric", "hex", "base64", "custom"]).describe("Character set to use").optional(),
|
|
@@ -10,7 +9,6 @@ export function registerGenerateToken(server) {
|
|
|
10
9
|
// VS Code compliance annotations
|
|
11
10
|
annotations: {
|
|
12
11
|
title: "Generate Token",
|
|
13
|
-
description: "Generate secure random tokens",
|
|
14
12
|
readOnlyHint: false
|
|
15
13
|
}
|
|
16
14
|
}, async ({ length = 32, charset = "alphanumeric", customChars }) => {
|
|
@@ -2,7 +2,6 @@ import bcryptjs from "bcryptjs";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export function registerHashBcrypt(server) {
|
|
4
4
|
server.registerTool("hash_bcrypt", {
|
|
5
|
-
description: "Generate bcrypt hash or verify password against hash",
|
|
6
5
|
inputSchema: {
|
|
7
6
|
password: z.string().describe("Password to hash or verify"),
|
|
8
7
|
rounds: z.number().describe("Number of salt rounds (4-12, default 10)").optional(),
|
|
@@ -11,7 +10,6 @@ export function registerHashBcrypt(server) {
|
|
|
11
10
|
// VS Code compliance annotations
|
|
12
11
|
annotations: {
|
|
13
12
|
title: "Hash Bcrypt",
|
|
14
|
-
description: "Generate bcrypt hash or verify password against hash",
|
|
15
13
|
readOnlyHint: false
|
|
16
14
|
}
|
|
17
15
|
}, async ({ password, rounds = 10, hash }) => {
|
|
@@ -2,14 +2,12 @@ import { createHash } from "crypto";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export function registerHashMd5(server) {
|
|
4
4
|
server.registerTool("hash_md5", {
|
|
5
|
-
description: "Generate MD5 hash",
|
|
6
5
|
inputSchema: {
|
|
7
6
|
text: z.string().describe("Text to hash with MD5"),
|
|
8
7
|
},
|
|
9
8
|
// VS Code compliance annotations
|
|
10
9
|
annotations: {
|
|
11
10
|
title: "Hash Md5",
|
|
12
|
-
description: "Generate MD5 hash",
|
|
13
11
|
readOnlyHint: false
|
|
14
12
|
}
|
|
15
13
|
}, async ({ text }) => {
|
|
@@ -2,14 +2,12 @@ import { createHash } from "crypto";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export function registerHashSha1(server) {
|
|
4
4
|
server.registerTool("hash_sha1", {
|
|
5
|
-
description: "Generate SHA1 hash",
|
|
6
5
|
inputSchema: {
|
|
7
6
|
text: z.string().describe("Text to hash with SHA1"),
|
|
8
7
|
},
|
|
9
8
|
// VS Code compliance annotations
|
|
10
9
|
annotations: {
|
|
11
10
|
title: "Hash Sha1",
|
|
12
|
-
description: "Generate SHA1 hash",
|
|
13
11
|
readOnlyHint: false
|
|
14
12
|
}
|
|
15
13
|
}, async ({ text }) => {
|
|
@@ -2,14 +2,12 @@ import { createHash } from "crypto";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export function registerHashSha256(server) {
|
|
4
4
|
server.registerTool("hash_sha256", {
|
|
5
|
-
description: 'Generate SHA256 hash of input text. Example: "hello" → "2cf24dba4f21d..."',
|
|
6
5
|
inputSchema: {
|
|
7
6
|
text: z.string().describe("Text to hash with SHA256"),
|
|
8
7
|
},
|
|
9
8
|
// VS Code compliance annotations
|
|
10
9
|
annotations: {
|
|
11
10
|
title: "Hash Sha256",
|
|
12
|
-
description: "Generate SHA256 hash of input text",
|
|
13
11
|
readOnlyHint: false
|
|
14
12
|
}
|
|
15
13
|
}, async ({ text }) => {
|
|
@@ -2,14 +2,12 @@ import { createHash } from "crypto";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export function registerHashSha512(server) {
|
|
4
4
|
server.registerTool("hash_sha512", {
|
|
5
|
-
description: "Generate SHA512 hash",
|
|
6
5
|
inputSchema: {
|
|
7
6
|
text: z.string().describe("Text to hash with SHA512"),
|
|
8
7
|
},
|
|
9
8
|
// VS Code compliance annotations
|
|
10
9
|
annotations: {
|
|
11
10
|
title: "Hash Sha512",
|
|
12
|
-
description: "Generate SHA512 hash",
|
|
13
11
|
readOnlyHint: false
|
|
14
12
|
}
|
|
15
13
|
}, async ({ text }) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerDiffJson(server) {
|
|
3
3
|
server.registerTool("compare_json", {
|
|
4
|
-
description: "Compare two JSON objects and show differences",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
json1: z.string().describe("First JSON object"),
|
|
7
6
|
json2: z.string().describe("Second JSON object"),
|
|
@@ -9,7 +8,6 @@ export function registerDiffJson(server) {
|
|
|
9
8
|
// VS Code compliance annotations
|
|
10
9
|
annotations: {
|
|
11
10
|
title: "Compare Json",
|
|
12
|
-
description: "Compare two JSON objects and show differences",
|
|
13
11
|
readOnlyHint: false
|
|
14
12
|
}
|
|
15
13
|
}, async ({ json1, json2 }) => {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerConvertHtmlMarkdown(server) {
|
|
3
3
|
server.registerTool("convert_html_to_markdown", {
|
|
4
|
-
description: "Convert HTML to Markdown",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
html: z.string().describe("HTML content to convert to Markdown"),
|
|
7
6
|
},
|
|
8
7
|
// VS Code compliance annotations
|
|
9
8
|
annotations: {
|
|
10
9
|
title: "Convert Html To Markdown",
|
|
11
|
-
description: "Convert HTML to Markdown",
|
|
12
10
|
readOnlyHint: false
|
|
13
11
|
}
|
|
14
12
|
}, async ({ html }) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerConvertJsonCsv(server) {
|
|
3
3
|
server.registerTool("convert_json_to_csv", {
|
|
4
|
-
description: "Convert JSON to CSV format",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
json: z.string().describe("JSON string to convert to CSV"),
|
|
7
6
|
delimiter: z.string().describe("CSV delimiter").optional(),
|
|
@@ -9,7 +8,6 @@ export function registerConvertJsonCsv(server) {
|
|
|
9
8
|
// VS Code compliance annotations
|
|
10
9
|
annotations: {
|
|
11
10
|
title: "Convert Json To Csv",
|
|
12
|
-
description: "Convert JSON to CSV format",
|
|
13
11
|
readOnlyHint: false
|
|
14
12
|
}
|
|
15
13
|
}, async ({ json, delimiter = "," }) => {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerConvertJsonToml(server) {
|
|
3
3
|
server.registerTool("convert_json_to_toml", {
|
|
4
|
-
description: "Convert JSON to TOML format",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
json: z.string().describe("JSON string to convert"),
|
|
7
6
|
},
|
|
8
7
|
// VS Code compliance annotations
|
|
9
8
|
annotations: {
|
|
10
9
|
title: "Convert Json To Toml",
|
|
11
|
-
description: "Convert JSON to TOML format",
|
|
12
10
|
readOnlyHint: false
|
|
13
11
|
}
|
|
14
12
|
}, async ({ json }) => {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerConvertMarkdownHtml(server) {
|
|
3
3
|
server.registerTool("convert_markdown_to_html", {
|
|
4
|
-
description: "Convert Markdown to HTML",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
markdown: z.string().describe("Markdown content to convert to HTML"),
|
|
7
6
|
},
|
|
8
7
|
// VS Code compliance annotations
|
|
9
8
|
annotations: {
|
|
10
9
|
title: "Convert Markdown To Html",
|
|
11
|
-
description: "Convert Markdown to HTML",
|
|
12
10
|
readOnlyHint: false
|
|
13
11
|
}
|
|
14
12
|
}, async ({ markdown }) => {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerConvertTomlJson(server) {
|
|
3
3
|
server.registerTool("convert_toml_to_json", {
|
|
4
|
-
description: "Convert TOML to JSON format",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
toml: z.string().describe("TOML string to convert"),
|
|
7
6
|
},
|
|
8
7
|
// VS Code compliance annotations
|
|
9
8
|
annotations: {
|
|
10
9
|
title: "Convert Toml To Json",
|
|
11
|
-
description: "Convert TOML to JSON format",
|
|
12
10
|
readOnlyHint: false
|
|
13
11
|
}
|
|
14
12
|
}, async ({ toml: tomlString }) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerFormatJson(server) {
|
|
3
3
|
server.registerTool("format_json", {
|
|
4
|
-
description: 'Format and prettify JSON with proper indentation. Example: {"a":1,"b":2} → formatted JSON with customizable spacing',
|
|
5
4
|
inputSchema: {
|
|
6
5
|
json: z.string().describe("JSON string to format"),
|
|
7
6
|
indent: z.number().describe("Number of spaces for indentation").optional(),
|
|
@@ -9,7 +8,6 @@ export function registerFormatJson(server) {
|
|
|
9
8
|
// VS Code compliance annotations
|
|
10
9
|
annotations: {
|
|
11
10
|
title: "Format JSON",
|
|
12
|
-
description: "Format and prettify JSON with proper indentation and customizable spacing",
|
|
13
11
|
readOnlyHint: false
|
|
14
12
|
}
|
|
15
13
|
}, async ({ json, indent = 2 }) => {
|
|
@@ -61,37 +59,26 @@ export function registerFormatJson(server) {
|
|
|
61
59
|
};
|
|
62
60
|
}
|
|
63
61
|
catch (secondError) {
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
catch (evalError) {
|
|
78
|
-
return {
|
|
79
|
-
content: [
|
|
80
|
-
{
|
|
81
|
-
type: "text",
|
|
82
|
-
text: `Error parsing JSON: ${firstError instanceof Error ? firstError.message : 'Unknown error'}
|
|
62
|
+
// Security: Do NOT use Function() constructor or eval() as they enable code injection
|
|
63
|
+
// Only JSON.parse() should be used - it's safe and sufficient for JSON formatting
|
|
64
|
+
return {
|
|
65
|
+
content: [
|
|
66
|
+
{
|
|
67
|
+
type: "text",
|
|
68
|
+
text: `Error parsing JSON: ${firstError instanceof Error ? firstError.message : 'Unknown error'}
|
|
69
|
+
|
|
70
|
+
Attempted normalization failed: ${secondError instanceof Error ? secondError.message : 'Unknown error'}
|
|
83
71
|
|
|
84
|
-
|
|
85
|
-
Please ensure your input is valid JSON or JavaScript object notation.
|
|
72
|
+
Please ensure your input is valid JSON.
|
|
86
73
|
|
|
87
|
-
|
|
74
|
+
Supported format:
|
|
88
75
|
- Valid JSON: {"name":"John","age":30}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
76
|
+
|
|
77
|
+
Note: For security reasons, JavaScript object literals and code evaluation are not supported.
|
|
78
|
+
Please convert your input to valid JSON format before formatting.`,
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
};
|
|
95
82
|
}
|
|
96
83
|
}
|
|
97
84
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerFormatPhone(server) {
|
|
3
3
|
server.registerTool("format_phone", {
|
|
4
|
-
description: "Parse and format phone numbers",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
phoneNumber: z.string().describe("Phone number to parse and format"),
|
|
7
6
|
countryCode: z.string().optional().describe("Country code (e.g., 'US', 'GB', 'FR')"),
|
|
@@ -9,7 +8,6 @@ export function registerFormatPhone(server) {
|
|
|
9
8
|
// VS Code compliance annotations
|
|
10
9
|
annotations: {
|
|
11
10
|
title: "Format Phone",
|
|
12
|
-
description: "Parse and format phone numbers",
|
|
13
11
|
readOnlyHint: false
|
|
14
12
|
}
|
|
15
13
|
}, async ({ phoneNumber, countryCode }) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerFormatSql(server) {
|
|
3
3
|
server.registerTool("format_sql", {
|
|
4
|
-
description: "Format and prettify SQL queries",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
sql: z.string().describe("SQL query to format"),
|
|
7
6
|
dialect: z.string().optional().describe("SQL dialect to use for formatting (e.g., 'sql', 'mysql', 'postgresql', 'sqlite', 'mariadb', 'db2', 'plsql', 'n1ql', 'redshift', 'spark', 'tsql', 'trino', 'bigquery'). Default is 'sql'."),
|
|
@@ -9,7 +8,6 @@ export function registerFormatSql(server) {
|
|
|
9
8
|
// VS Code compliance annotations
|
|
10
9
|
annotations: {
|
|
11
10
|
title: "Format Sql",
|
|
12
|
-
description: "Format and prettify SQL queries",
|
|
13
11
|
readOnlyHint: false
|
|
14
12
|
}
|
|
15
13
|
}, async ({ sql, dialect = "sql" }) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerFormatXml(server) {
|
|
3
3
|
server.registerTool("format_xml", {
|
|
4
|
-
description: "Format and prettify XML",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
xml: z.string().describe("XML string to format"),
|
|
7
6
|
indent: z.number().describe("Number of spaces for indentation").optional(),
|
|
@@ -9,7 +8,6 @@ export function registerFormatXml(server) {
|
|
|
9
8
|
// VS Code compliance annotations
|
|
10
9
|
annotations: {
|
|
11
10
|
title: "Format Xml",
|
|
12
|
-
description: "Format and prettify XML",
|
|
13
11
|
readOnlyHint: false
|
|
14
12
|
}
|
|
15
13
|
}, async ({ xml, indent = 2 }) => {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerFormatYaml(server) {
|
|
3
3
|
server.registerTool("format_yaml", {
|
|
4
|
-
description: "Format and prettify YAML",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
yaml: z.string().describe("YAML string to format"),
|
|
7
6
|
},
|
|
8
7
|
// VS Code compliance annotations
|
|
9
8
|
annotations: {
|
|
10
9
|
title: "Format Yaml",
|
|
11
|
-
description: "Format and prettify YAML",
|
|
12
10
|
readOnlyHint: false
|
|
13
11
|
}
|
|
14
12
|
}, async ({ yaml }) => {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerMinifyJson(server) {
|
|
3
3
|
server.registerTool("minify_json", {
|
|
4
|
-
description: "Minify JSON by removing whitespace and unnecessary characters. Example: formatted JSON → compact single-line JSON",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
json: z.string().describe("JSON string to minify"),
|
|
7
6
|
},
|
|
8
7
|
// VS Code compliance annotations
|
|
9
8
|
annotations: {
|
|
10
9
|
title: "Minify JSON",
|
|
11
|
-
description: "Remove whitespace and minify JSON to compact format",
|
|
12
10
|
readOnlyHint: false
|
|
13
11
|
}
|
|
14
12
|
}, async ({ json }) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerConvertList(server) {
|
|
3
3
|
server.registerTool("convert_list", {
|
|
4
|
-
description: "Convert between different list formats (comma-separated, line-separated, etc.)",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
list: z.string().describe("Input list to convert"),
|
|
7
6
|
inputFormat: z.enum(["comma", "semicolon", "newline", "space", "pipe"]).describe("Input format"),
|
|
@@ -11,7 +10,6 @@ export function registerConvertList(server) {
|
|
|
11
10
|
// VS Code compliance annotations
|
|
12
11
|
annotations: {
|
|
13
12
|
title: "Convert List",
|
|
14
|
-
description: "Convert between different list formats (comma-separated, line-separated, etc",
|
|
15
13
|
readOnlyHint: false
|
|
16
14
|
}
|
|
17
15
|
}, async ({ list, inputFormat, outputFormat, trim = true }) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerPrettifyHtml(server) {
|
|
3
3
|
server.registerTool("format_html", {
|
|
4
|
-
description: "Format and beautify HTML code",
|
|
5
4
|
inputSchema: {
|
|
6
5
|
html: z.string().describe("HTML code to prettify"),
|
|
7
6
|
indentSize: z.number().optional().default(2).describe("Number of spaces for indentation")
|
|
@@ -9,7 +8,6 @@ export function registerPrettifyHtml(server) {
|
|
|
9
8
|
// VS Code compliance annotations
|
|
10
9
|
annotations: {
|
|
11
10
|
title: "Format Html",
|
|
12
|
-
description: "Format and beautify HTML code",
|
|
13
11
|
readOnlyHint: false
|
|
14
12
|
}
|
|
15
13
|
}, async ({ html, indentSize }) => {
|