hotel-mcp
Version:
Hotel MCP Server - Read-only hotel information with rich media support for Claude Desktop
129 lines (111 loc) • 3.88 kB
JavaScript
/**
* Hotel MCP - Post-install script
*
* Intelligent post-installation setup that guides users through
* configuration and Claude Desktop integration.
*/
const fs = require('fs');
const path = require('path');
const os = require('os');
// ANSI color codes
const colors = {
reset: '\x1b[0m',
bright: '\x1b[1m',
red: '\x1b[31m',
green: '\x1b[32m',
yellow: '\x1b[33m',
blue: '\x1b[34m',
cyan: '\x1b[36m'
};
function log(message, color = 'reset') {
console.log(`${colors[color]}${message}${colors.reset}`);
}
function getClaudeConfigPath() {
const platform = os.platform();
const homeDir = os.homedir();
switch (platform) {
case 'darwin':
return path.join(homeDir, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
case 'win32':
return path.join(process.env.APPDATA || '', 'Claude', 'claude_desktop_config.json');
case 'linux':
return path.join(homeDir, '.config', 'Claude', 'claude_desktop_config.json');
default:
return null;
}
}
function displayWelcome() {
log('', 'reset');
log('🏨 Hotel MCP Server - Post-Install Setup', 'cyan');
log('═'.repeat(50), 'blue');
log('✅ Hotel MCP has been installed successfully!', 'green');
log('', 'reset');
}
function displayNextSteps() {
log('📋 Next Steps:', 'yellow');
log('', 'reset');
log('1️⃣ Configure Environment:', 'bright');
log(' Create a .env file with your Supabase credentials:', 'reset');
log(' ', 'reset');
log(' SUPABASE_URL=https://your-project.supabase.co', 'cyan');
log(' SUPABASE_ANON_KEY=your_anon_key', 'cyan');
log(' DEFAULT_SITE_ID=your_hotel_uuid', 'cyan');
log(' DEFAULT_LANGUAGE=es', 'cyan');
log('', 'reset');
log('2️⃣ Test the Server:', 'bright');
log(' npx hotel-mcp', 'cyan');
log('', 'reset');
log('3️⃣ Configure Claude Desktop:', 'bright');
const configPath = getClaudeConfigPath();
if (configPath) {
log(` Edit: ${configPath}`, 'reset');
log('', 'reset');
log(' Add this configuration:', 'reset');
log(' {', 'cyan');
log(' "mcpServers": {', 'cyan');
log(' "hotel-mcp": {', 'cyan');
log(' "command": "npx",', 'cyan');
log(' "args": ["hotel-mcp"],', 'cyan');
log(' "env": {', 'cyan');
log(' "SUPABASE_URL": "your_url",', 'cyan');
log(' "SUPABASE_ANON_KEY": "your_key",', 'cyan');
log(' "DEFAULT_SITE_ID": "your_site_id"', 'cyan');
log(' }', 'cyan');
log(' }', 'cyan');
log(' }', 'cyan');
log(' }', 'cyan');
} else {
log(' Platform not detected. Please check documentation.', 'yellow');
}
log('', 'reset');
log('4️⃣ Restart Claude Desktop', 'bright');
log(' Close and reopen Claude Desktop to load the MCP server', 'reset');
log('', 'reset');
}
function displayResources() {
log('📚 Resources:', 'yellow');
log(' 📖 Documentation: https://github.com/hotel-mcp/hotel-mcp#readme', 'reset');
log(' 🐛 Issues: https://github.com/hotel-mcp/hotel-mcp/issues', 'reset');
log(' 💬 Discussions: https://github.com/hotel-mcp/hotel-mcp/discussions', 'reset');
log('', 'reset');
}
function displayFooter() {
log('🎉 Happy hotel management with Claude!', 'green');
log('', 'reset');
}
function main() {
try {
displayWelcome();
displayNextSteps();
displayResources();
displayFooter();
} catch (error) {
log(`❌ Post-install error: ${error.message}`, 'red');
process.exit(1);
}
}
if (require.main === module) {
main();
}
module.exports = { main };