it-tools-mcp 5.2.7 → 5.2.9
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
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);
|
|
@@ -61,37 +61,26 @@ export function registerFormatJson(server) {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
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'}
|
|
64
|
+
// Security: Do NOT use Function() constructor or eval() as they enable code injection
|
|
65
|
+
// Only JSON.parse() should be used - it's safe and sufficient for JSON formatting
|
|
66
|
+
return {
|
|
67
|
+
content: [
|
|
68
|
+
{
|
|
69
|
+
type: "text",
|
|
70
|
+
text: `Error parsing JSON: ${firstError instanceof Error ? firstError.message : 'Unknown error'}
|
|
71
|
+
|
|
72
|
+
Attempted normalization failed: ${secondError instanceof Error ? secondError.message : 'Unknown error'}
|
|
83
73
|
|
|
84
|
-
|
|
85
|
-
Please ensure your input is valid JSON or JavaScript object notation.
|
|
74
|
+
Please ensure your input is valid JSON.
|
|
86
75
|
|
|
87
|
-
|
|
76
|
+
Supported format:
|
|
88
77
|
- Valid JSON: {"name":"John","age":30}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
78
|
+
|
|
79
|
+
Note: For security reasons, JavaScript object literals and code evaluation are not supported.
|
|
80
|
+
Please convert your input to valid JSON format before formatting.`,
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
};
|
|
95
84
|
}
|
|
96
85
|
}
|
|
97
86
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "it-tools-mcp",
|
|
3
|
-
"version": "5.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "5.2.9",
|
|
4
|
+
"description": "MCP-compliant server access to over 100 IT tools and utilities commonly used by developers, system administrators, and IT professionals.",
|
|
5
|
+
"mcpName": "io.github.wrenchpilot/it-tools-mcp",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"main": "./build/index.js",
|
|
7
8
|
"bin": {
|