UNPKG

url-builder-mcp

Version:

URL Builder MCP Server - Professional URL construction with intelligent parameter handling for Claude Desktop

161 lines (137 loc) 4.94 kB
#!/usr/bin/env node /** * URL Builder MCP Server - Post-Installation Guide * * Provides setup guidance and configuration instructions after installation. */ import os from 'os'; import path from 'path'; import fs from 'fs'; // ANSI color codes const colors = { reset: '\x1b[0m', bright: '\x1b[1m', red: '\x1b[31m', green: '\x1b[32m', yellow: '\x1b[33m', blue: '\x1b[34m', magenta: '\x1b[35m', 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': // macOS return path.join(homeDir, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'); case 'win32': // Windows return path.join(homeDir, 'AppData', 'Roaming', 'Claude', 'claude_desktop_config.json'); case 'linux': // Linux return path.join(homeDir, '.config', 'Claude', 'claude_desktop_config.json'); default: return null; } } function displayWelcome() { log('', 'reset'); log('🎉 URL Builder MCP Server Installation Complete!', 'green'); log('═'.repeat(60), 'cyan'); log('', 'reset'); log('🔗 Professional URL construction with intelligent parameter handling', 'cyan'); log(' Developed by DAOTOMATA FZE - Commercial Private Software', 'blue'); log('', 'reset'); } function displayQuickStart() { log('🚀 Quick Start:', 'yellow'); log('', 'reset'); log('1. Test the installation:', 'bright'); log(' npx url-builder-mcp --help', 'green'); log('', 'reset'); log('2. Run the server:', 'bright'); log(' npx url-builder-mcp', 'green'); log('', 'reset'); } function displayClaudeIntegration() { log('🤖 Claude Desktop Integration:', 'yellow'); log('', 'reset'); const configPath = getClaudeConfigPath(); if (configPath) { log(`📁 Configuration file location:`, 'bright'); log(` ${configPath}`, 'blue'); log('', 'reset'); } log('📝 Add this configuration to your Claude Desktop config:', 'bright'); log('', 'reset'); const config = { mcpServers: { "url-builder-mcp": { command: "npx", args: ["url-builder-mcp"], env: { // Add any environment variables here if needed } } } }; log(JSON.stringify(config, null, 2), 'green'); log('', 'reset'); } function displayFeatures() { log('✨ Available Features:', 'yellow'); log('', 'reset'); log(' 🔧 build_url - Construct URLs with intelligent parameter handling', 'cyan'); log(' 🔍 parse_url - Parse and analyze URL components', 'cyan'); log(' ✅ validate_url - Validate URL format and accessibility', 'cyan'); log(' 🔄 transform_url - Transform URLs between different formats', 'cyan'); log(' 📊 analyze_url - Analyze URL structure and parameters', 'cyan'); log('', 'reset'); } function displaySupport() { log('🆘 Support & Documentation:', 'yellow'); log('', 'reset'); log(' 📚 Documentation: https://github.com/enpetrache/url_builder_mcp#readme', 'blue'); log(' 🐛 Issues: https://github.com/enpetrache/url_builder_mcp/issues', 'blue'); log(' 📧 Commercial Support: contact@daotomata.com', 'blue'); log('', 'reset'); } function displayLicense() { log('📄 License Information:', 'yellow'); log('', 'reset'); log(' This software is proprietary to DAOTOMATA FZE', 'magenta'); log(' Licensed for commercial use only', 'magenta'); log(' See LICENSE file for complete terms and conditions', 'magenta'); log('', 'reset'); } function displayTroubleshooting() { log('🔧 Troubleshooting:', 'yellow'); log('', 'reset'); log(' • Ensure Node.js 18+ is installed', 'reset'); log(' • Run "npm run build" if using from source', 'reset'); log(' • Check Claude Desktop configuration syntax', 'reset'); log(' • Restart Claude Desktop after configuration changes', 'reset'); log('', 'reset'); } function main() { try { displayWelcome(); displayQuickStart(); displayClaudeIntegration(); displayFeatures(); displaySupport(); displayLicense(); displayTroubleshooting(); log('🎯 Ready to enhance your URL building workflow!', 'green'); log('', 'reset'); } catch (error) { log(`❌ Post-installation error: ${error.message}`, 'red'); log(' Please check the documentation for manual setup instructions.', 'yellow'); } } // Run if called directly if (import.meta.url === `file://${process.argv[1]}`) { main(); } export { main };