Skip to main content
Glama

Visum Thinker MCP Server

MIT License
test-integration.jsโ€ข7.69 kB
// Test the corrected Visum MCP server const fs = require('fs'); const { spawn } = require('child_process'); console.log('๐Ÿงช Testing Visum MCP Server Integration...\n'); // Test 1: Check if MCP server is running and responsive function testMCPConnection() { return new Promise((resolve) => { console.log('๐Ÿ“ก Test 1: MCP Server Connection'); const mcp = spawn('node', ['build/index.js'], { stdio: ['pipe', 'pipe', 'pipe'], cwd: process.cwd() }); let output = ''; let serverReady = false; mcp.stdout.on('data', (data) => { output += data.toString(); if (output.includes('Visum Thinker MCP Server running')) { serverReady = true; console.log('โœ… MCP server started successfully'); // Send a test request to get Visum status const testRequest = { jsonrpc: "2.0", id: 1, method: "tools/call", params: { name: "get_visum_status", arguments: {} } }; mcp.stdin.write(JSON.stringify(testRequest) + '\n'); } }); mcp.stderr.on('data', (data) => { const errorMsg = data.toString(); console.log('๐Ÿ“‹ Server log:', errorMsg.trim()); }); // Wait for response or timeout setTimeout(() => { if (serverReady) { console.log('โœ… Test 1 PASSED: MCP server is responsive\n'); mcp.kill(); resolve(true); } else { console.log('โŒ Test 1 FAILED: MCP server not responsive\n'); mcp.kill(); resolve(false); } }, 5000); }); } // Test 2: Check Visum path learning function testVisumPathLearning() { console.log('๐Ÿ“‚ Test 2: Visum Path Learning System'); try { const configPath = './visum-config.json'; if (fs.existsSync(configPath)) { const config = JSON.parse(fs.readFileSync(configPath, 'utf8')); console.log('โœ… Configuration file exists'); console.log(`๐Ÿ“ Known installations: ${config.knownInstallations.length}`); console.log(`๐ŸŽฏ Preferred path: ${config.preferredPath || 'None set'}`); if (config.knownInstallations.length > 0) { const installation = config.knownInstallations[0]; console.log(`๐Ÿ“‹ First installation: ${installation.path}`); console.log(`๐Ÿท๏ธ Version: ${installation.version}`); console.log(`๐Ÿ“… Last verified: ${installation.lastVerified}`); // Verify the path still exists if (fs.existsSync(installation.path)) { console.log('โœ… Installation path is valid'); console.log('โœ… Test 2 PASSED: Learning system is functional\n'); return true; } else { console.log('โŒ Installation path no longer exists'); console.log('โŒ Test 2 FAILED: Path verification failed\n'); return false; } } else { console.log('โš ๏ธ No learned installations found'); console.log('โœ… Test 2 PASSED: Config system ready for learning\n'); return true; } } else { console.log('โš ๏ธ Configuration file not found (will be created on first use)'); console.log('โœ… Test 2 PASSED: System ready for initial learning\n'); return true; } } catch (error) { console.log(`โŒ Test 2 FAILED: ${error.message}\n`); return false; } } // Test 3: Verify COM method corrections function testCOMMethodCorrections() { console.log('๐Ÿ”ง Test 3: COM Method Corrections'); try { const controllerPath = './src/visum-controller.ts'; const controllerContent = fs.readFileSync(controllerPath, 'utf8'); // Check that old methods are replaced const hasOldMethods = controllerContent.includes('GetAttValue(\'VersionStr\')'); const hasNewMethods = controllerContent.includes('VersionNumber'); const hasHDrivePaths = controllerContent.includes('H:\\\\Program Files\\\\PTV Vision'); if (hasOldMethods) { console.log('โŒ Still contains old GetAttValue method calls'); return false; } if (!hasNewMethods) { console.log('โŒ Missing new VersionNumber property usage'); return false; } if (!hasHDrivePaths) { console.log('โŒ Missing H: drive paths in search list'); return false; } console.log('โœ… Old GetAttValue methods removed'); console.log('โœ… New VersionNumber property implemented'); console.log('โœ… H: drive paths added to search list'); console.log('โœ… Test 3 PASSED: COM methods corrected\n'); return true; } catch (error) { console.log(`โŒ Test 3 FAILED: ${error.message}\n`); return false; } } // Test 4: Direct COM test to verify functionality function testDirectCOM() { return new Promise((resolve) => { console.log('โšก Test 4: Direct COM Functionality'); const powershell = spawn('powershell', [ '-ExecutionPolicy', 'Bypass', '-Command', ` try { Write-Host "Testing Visum COM with corrected methods..." $visum = New-Object -ComObject "Visum.Visum" $version = $visum.VersionNumber $net = $visum.Net Write-Host "SUCCESS: Version=$version, Net=$($net -ne $null)" exit 0 } catch { Write-Host "FAILED: $($_.Exception.Message)" exit 1 } ` ], { stdio: ['pipe', 'pipe', 'pipe'] }); let output = ''; let errorOutput = ''; powershell.stdout.on('data', (data) => { output += data.toString(); }); powershell.stderr.on('data', (data) => { errorOutput += data.toString(); }); powershell.on('close', (code) => { if (code === 0 && output.includes('SUCCESS')) { console.log('โœ… Direct COM test successful'); console.log(`๐Ÿ“‹ ${output.trim()}`); console.log('โœ… Test 4 PASSED: COM interface working correctly\n'); resolve(true); } else { console.log('โŒ Direct COM test failed'); console.log(`๐Ÿ“‹ Output: ${output.trim()}`); console.log(`๐Ÿ“‹ Error: ${errorOutput.trim()}`); console.log('โŒ Test 4 FAILED: COM interface issues\n'); resolve(false); } }); }); } // Run all tests async function runAllTests() { console.log('๐Ÿš€ Starting Visum MCP Server Integration Tests\n'); console.log('=' .repeat(60) + '\n'); const results = []; // Run tests sequentially results.push(await testMCPConnection()); results.push(testVisumPathLearning()); results.push(testCOMMethodCorrections()); results.push(await testDirectCOM()); // Summary console.log('=' .repeat(60)); console.log('๐Ÿ“Š TEST SUMMARY'); console.log('=' .repeat(60)); const passed = results.filter(r => r).length; const total = results.length; console.log(`โœ… Passed: ${passed}/${total}`); console.log(`โŒ Failed: ${total - passed}/${total}`); if (passed === total) { console.log('\n๐ŸŽ‰ ALL TESTS PASSED! MCP server is ready for use.'); console.log('๐Ÿ”ฅ The Visum COM integration issue has been resolved!'); console.log('\n๐Ÿ’ก Key fixes applied:'); console.log(' โ€ข Replaced GetAttValue("VersionStr") with VersionNumber property'); console.log(' โ€ข Added H: drive paths to installation search'); console.log(' โ€ข Updated all COM method calls to use correct interface'); console.log(' โ€ข Verified learning system maintains correct paths'); } else { console.log('\nโš ๏ธ Some tests failed. Check the output above for details.'); } console.log('\n๐Ÿš€ MCP Server Status: Ready for Claude integration'); } // Start the tests runAllTests().catch(console.error);

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/multiluca2020/visum-thinker-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server