it-tools-mcp 4.1.2 → 4.1.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 +38 -7
- package/package.json +3 -1
package/build/index.js
CHANGED
|
@@ -483,7 +483,9 @@ function getAnalysisPrompt(analysisType, content) {
|
|
|
483
483
|
async function loadModularTools(server, category) {
|
|
484
484
|
const toolsDir = path.join(__dirname, 'tools', category);
|
|
485
485
|
if (!fs.existsSync(toolsDir)) {
|
|
486
|
-
|
|
486
|
+
if (isDevelopment) {
|
|
487
|
+
console.warn(`Category directory does not exist: ${toolsDir}`);
|
|
488
|
+
}
|
|
487
489
|
return;
|
|
488
490
|
}
|
|
489
491
|
const toolDirs = fs.readdirSync(toolsDir, { withFileTypes: true })
|
|
@@ -497,19 +499,35 @@ async function loadModularTools(server, category) {
|
|
|
497
499
|
// Find the register function in the module
|
|
498
500
|
const registerFunction = Object.values(toolModule).find((fn) => typeof fn === 'function' && fn.name.startsWith('register'));
|
|
499
501
|
if (registerFunction) {
|
|
500
|
-
|
|
501
|
-
|
|
502
|
+
try {
|
|
503
|
+
registerFunction(server);
|
|
504
|
+
// Only log tool loading in development mode
|
|
505
|
+
if (isDevelopment) {
|
|
506
|
+
console.error(`Loaded tool: ${category}/${toolDir}`);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
catch (regError) {
|
|
510
|
+
// Always log errors
|
|
511
|
+
console.error(`Failed to register tool ${category}/${toolDir}:`, regError instanceof Error ? regError.message : 'Unknown registration error');
|
|
512
|
+
}
|
|
502
513
|
}
|
|
503
514
|
else {
|
|
504
|
-
|
|
515
|
+
// Only warn in development mode
|
|
516
|
+
if (isDevelopment) {
|
|
517
|
+
console.warn(`No register function found in ${toolPath}`);
|
|
518
|
+
}
|
|
505
519
|
}
|
|
506
520
|
}
|
|
507
521
|
catch (error) {
|
|
522
|
+
// Always log errors
|
|
508
523
|
console.error(`Failed to load tool ${category}/${toolDir}:`, error instanceof Error ? error.message : 'Unknown error');
|
|
509
524
|
}
|
|
510
525
|
}
|
|
511
526
|
else {
|
|
512
|
-
|
|
527
|
+
// Only warn in development mode
|
|
528
|
+
if (isDevelopment) {
|
|
529
|
+
console.warn(`Tool index file does not exist: ${toolPath}`);
|
|
530
|
+
}
|
|
513
531
|
}
|
|
514
532
|
}
|
|
515
533
|
}
|
|
@@ -603,7 +621,9 @@ async function getCategoryDescription(category, toolNames) {
|
|
|
603
621
|
async function registerAllTools(server) {
|
|
604
622
|
const toolsBaseDir = path.join(__dirname, 'tools');
|
|
605
623
|
if (!fs.existsSync(toolsBaseDir)) {
|
|
606
|
-
|
|
624
|
+
if (isDevelopment) {
|
|
625
|
+
console.warn('Tools directory does not exist:', toolsBaseDir);
|
|
626
|
+
}
|
|
607
627
|
return;
|
|
608
628
|
}
|
|
609
629
|
// Discover categories dynamically from the filesystem
|
|
@@ -784,7 +804,6 @@ server.registerResource("readme", new ResourceTemplate("readme://{section}", {
|
|
|
784
804
|
async function main() {
|
|
785
805
|
try {
|
|
786
806
|
// VS Code MCP Compliance: Dev Mode Support
|
|
787
|
-
const isDevelopment = process.env.NODE_ENV === 'development' || process.env.MCP_DEV_MODE === 'true';
|
|
788
807
|
const isTest = process.env.NODE_ENV === 'test' && process.env.MCP_TEST_MODE === 'true';
|
|
789
808
|
if (isDevelopment) {
|
|
790
809
|
console.error("🔧 IT Tools MCP Server starting in DEVELOPMENT mode");
|
|
@@ -792,6 +811,14 @@ async function main() {
|
|
|
792
811
|
console.error(" - Hot reload capabilities active");
|
|
793
812
|
console.error(" - Debug information available");
|
|
794
813
|
}
|
|
814
|
+
// Add error handling for unhandled rejections
|
|
815
|
+
process.on('unhandledRejection', (reason, promise) => {
|
|
816
|
+
console.error('Unhandled Rejection at:', promise, 'reason:', reason);
|
|
817
|
+
});
|
|
818
|
+
process.on('uncaughtException', (error) => {
|
|
819
|
+
console.error('Uncaught Exception:', error);
|
|
820
|
+
process.exit(1);
|
|
821
|
+
});
|
|
795
822
|
await registerAllTools(server);
|
|
796
823
|
const transport = new StdioServerTransport();
|
|
797
824
|
await server.connect(transport);
|
|
@@ -809,6 +836,10 @@ async function main() {
|
|
|
809
836
|
console.error(`🔗 Protocol: Model Context Protocol (MCP) via stdio`);
|
|
810
837
|
console.error(`📦 Version: ${packageInfo.version}`);
|
|
811
838
|
}
|
|
839
|
+
else {
|
|
840
|
+
// Production mode - simple ready message
|
|
841
|
+
console.error(`IT Tools MCP Server v${packageInfo.version} ready - ${await getToolCount()} tools loaded`);
|
|
842
|
+
}
|
|
812
843
|
// Enhanced monitoring in development mode
|
|
813
844
|
if (isDevelopment && !isTest) {
|
|
814
845
|
// More frequent monitoring in dev mode (every minute)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "it-tools-mcp",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.9",
|
|
4
4
|
"description": "VS Code MCP-compliant server providing 116+ IT tools and utilities for developers - encoding, crypto, network tools, and more",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/index.js",
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
"dev:build": "NODE_ENV=development tsc",
|
|
16
16
|
"test": "clear;node tests/test-server.mjs",
|
|
17
17
|
"test:all": "clear;node tests/all-tools-test.mjs",
|
|
18
|
+
"sync:manifest": "node scripts/sync-manifest.cjs",
|
|
19
|
+
"setup:hooks": "chmod +x .git/hooks/pre-commit",
|
|
18
20
|
"docker:build": "docker buildx build --platform linux/amd64,linux/arm64 --provenance=true --sbom=true -t it-tools-mcp .",
|
|
19
21
|
"docker:build:local": "docker build -t it-tools-mcp .",
|
|
20
22
|
"docker:run": "docker-compose up --build",
|