UNPKG

@endlessblink/like-i-said-v2

Version:

Task Management & Memory for Claude - Track tasks, remember context, and maintain continuity across sessions with 27 powerful tools. Works with Claude Desktop and Claude Code.

159 lines (142 loc) โ€ข 5.43 kB
#!/usr/bin/env node // Debug script to help troubleshoot MCP installation issues import fs from 'fs'; import path from 'path'; import { execSync } from 'child_process'; import os from 'os'; console.log('๐Ÿ” Like-I-Said MCP Server Installation Debugger'); console.log('==============================================\n'); // Check Node.js version console.log('๐Ÿ“‹ Environment Information:'); console.log(`Node.js version: ${process.version}`); console.log(`Platform: ${process.platform}`); console.log(`Architecture: ${process.arch}`); console.log(`Current directory: ${process.cwd()}\n`); // Check if package.json exists const packagePath = path.join(process.cwd(), 'package.json'); if (fs.existsSync(packagePath)) { try { const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf8')); console.log('๐Ÿ“ฆ Package Information:'); console.log(`Name: ${pkg.name}`); console.log(`Version: ${pkg.version}`); console.log(`Main: ${pkg.main}\n`); } catch (e) { console.log('โŒ Error reading package.json\n'); } } else { console.log('โš ๏ธ No package.json found in current directory\n'); } // Check for essential files console.log('๐Ÿ“ File Check:'); const essentialFiles = [ 'mcp-server-wrapper.js', 'server-markdown.js', 'lib', 'memories', 'tasks' ]; essentialFiles.forEach(file => { const exists = fs.existsSync(file); console.log(`${exists ? 'โœ…' : 'โŒ'} ${file}`); }); console.log(); // Check lib directory contents if (fs.existsSync('lib')) { console.log('๐Ÿ“š Lib Directory Contents:'); try { const libFiles = fs.readdirSync('lib'); console.log(`Found ${libFiles.length} files in lib/`); if (libFiles.length < 20) { console.log('โŒ Too few files in lib/ directory - installation may be incomplete'); } else { console.log('โœ… Lib directory appears complete'); } } catch (e) { console.log('โŒ Error reading lib directory'); } console.log(); } // Test server startup console.log('๐Ÿงช Testing Server Startup:'); try { const serverPath = path.join(process.cwd(), 'mcp-server-wrapper.js'); if (fs.existsSync(serverPath)) { console.log('โœ… mcp-server-wrapper.js found'); // Try to run tools/list command console.log('๐Ÿ”ง Testing tools/list command...'); try { const testCommand = `echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}' | node "${serverPath}"`; const result = execSync(testCommand, { timeout: 5000, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }); if (result.includes('add_memory')) { console.log('โœ… Server responds correctly with memory tools'); } else { console.log('โŒ Server response does not include expected tools'); console.log('Response:', result.substring(0, 200) + '...'); } } catch (testError) { console.log('โŒ Server test failed:', testError.message.substring(0, 100)); } } else { console.log('โŒ mcp-server-wrapper.js not found'); } } catch (e) { console.log('โŒ Error testing server:', e.message); } console.log(); // Check Claude Desktop config console.log('๐Ÿ–ฅ๏ธ Claude Desktop Configuration:'); const homeDir = os.homedir(); const configPaths = [ path.join(process.env.APPDATA || '', 'Claude', 'claude_desktop_config.json'), path.join(homeDir, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'), path.join(homeDir, '.config', 'Claude', 'claude_desktop_config.json') ]; let configFound = false; for (const configPath of configPaths) { if (fs.existsSync(configPath)) { configFound = true; console.log(`โœ… Config found: ${configPath}`); try { const config = JSON.parse(fs.readFileSync(configPath, 'utf8')); if (config.mcpServers) { const serverNames = Object.keys(config.mcpServers); console.log(` Configured servers: ${serverNames.join(', ')}`); if (config.mcpServers['like-i-said-memory-v2']) { const serverConfig = config.mcpServers['like-i-said-memory-v2']; console.log(` Server command: ${serverConfig.command}`); console.log(` Server args: ${JSON.stringify(serverConfig.args)}`); // Check if the server file exists const serverFile = serverConfig.args[0]; if (serverFile && fs.existsSync(serverFile)) { console.log(` โœ… Server file exists: ${serverFile}`); } else { console.log(` โŒ Server file missing: ${serverFile}`); } } else { console.log(' โŒ like-i-said-memory-v2 not found in config'); } } else { console.log(' โŒ No mcpServers section in config'); } } catch (e) { console.log(' โŒ Error parsing config file'); } break; } } if (!configFound) { console.log('โŒ No Claude Desktop config file found'); } console.log(); // Recommendations console.log('๐Ÿ’ก Troubleshooting Recommendations:'); console.log('1. Ensure you ran: npx -p @endlessblink/like-i-said-v2@2.6.1 like-i-said-v2 install'); console.log('2. Check that all essential files exist (especially lib/ directory)'); console.log('3. Verify Claude Desktop config points to correct server file'); console.log('4. Restart Claude Desktop completely after installation'); console.log('5. If issues persist, try a clean installation in a new directory');