UNPKG

lmstudio-mcp-server

Version:

LM Studio MCP server with concurrent multi-agent support and memory safety

61 lines (48 loc) • 1.84 kB
#!/usr/bin/env node /** * Post-installation script for @samscarrow/lmstudio-mcp * Runs after npm install to set up the package */ const fs = require('fs'); const path = require('path'); const { execSync } = require('child_process'); async function postInstall() { console.log('šŸš€ Setting up LM Studio MCP...'); try { // Make the bin script executable const binPath = path.join(__dirname, 'bin', 'lmstudio-mcp.js'); if (fs.existsSync(binPath)) { fs.chmodSync(binPath, '755'); console.log('āœ… Made binary executable'); } // Check if Python 3 is available try { execSync('python3 --version', { stdio: 'pipe' }); console.log('āœ… Python 3 detected'); } catch (error) { console.log('āš ļø Python 3 not found. You may need to install it from https://python.org'); } // Show usage information console.log(` šŸ“¦ Installation complete! Usage: npx @samscarrow/lmstudio-mcp # Start the server npx @samscarrow/lmstudio-mcp --help # Show help Requirements: - Python 3.7+ (for the MCP server) - LM Studio running with a model loaded Configuration: Set LMSTUDIO_API_BASE environment variable if LM Studio runs on a different host/port Default: http://localhost:1234/v1 The server will automatically download and set up the Python components on first run. `); } catch (error) { console.error('āŒ Post-install setup failed:', error.message); console.log('You can still use the package, but some features may not work correctly.'); } } // Run post-install if this script is executed directly if (require.main === module) { postInstall().catch(console.error); } module.exports = postInstall;