url-builder-mcp
Version:
URL Builder MCP Server - Professional URL construction with intelligent parameter handling for Claude Desktop
135 lines (114 loc) โข 4.07 kB
JavaScript
/**
* URL Builder MCP Server - Pre-Uninstall Cleanup
*
* Provides cleanup guidance and feedback collection before uninstallation.
*/
import os from 'os';
import path from 'path';
// 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 displayHeader() {
log('', 'reset');
log('๐ URL Builder MCP Server - Uninstallation', 'yellow');
log('โ'.repeat(50), 'blue');
log('', 'reset');
}
function displayCleanupInstructions() {
log('๐งน Manual Cleanup Instructions:', 'yellow');
log('', 'reset');
const configPath = getClaudeConfigPath();
if (configPath) {
log('1. Remove Claude Desktop Configuration:', 'bright');
log(` Edit: ${configPath}`, 'blue');
log(' Remove the "url-builder-mcp" entry from mcpServers', 'cyan');
log('', 'reset');
}
log('2. Restart Claude Desktop:', 'bright');
log(' Close and reopen Claude Desktop to apply changes', 'cyan');
log('', 'reset');
log('3. Clean up any custom configurations:', 'bright');
log(' Remove any .env files or custom settings you created', 'cyan');
log('', 'reset');
}
function displayFeedback() {
log('๐ฌ We Value Your Feedback:', 'yellow');
log('', 'reset');
log(' Help us improve URL Builder MCP Server!', 'cyan');
log('', 'reset');
log(' ๐ง Email: contact@daotomata.com', 'blue');
log(' ๐ Issues: https://github.com/enpetrache/url_builder_mcp/issues', 'blue');
log(' โญ Feature Requests: https://github.com/enpetrache/url_builder_mcp/discussions', 'blue');
log('', 'reset');
}
function displayAlternatives() {
log('๐ Alternative Installation Methods:', 'yellow');
log('', 'reset');
log(' If you\'re uninstalling to reinstall:', 'cyan');
log('', 'reset');
log(' โข Global install: npm install -g url-builder-mcp', 'green');
log(' โข Direct NPX: npx url-builder-mcp (no installation needed)', 'green');
log(' โข From source: git clone + npm install + npm run build', 'green');
log('', 'reset');
}
function displaySupport() {
log('๐ Need Help?', 'yellow');
log('', 'reset');
log(' ๐ Documentation: https://github.com/enpetrache/url_builder_mcp#readme', 'blue');
log(' ๐ผ Commercial Support: contact@daotomata.com', 'blue');
log(' ๐ค Community: GitHub Discussions', 'blue');
log('', 'reset');
}
function displayThankYou() {
log('๐ Thank You!', 'green');
log('', 'reset');
log(' Thank you for using URL Builder MCP Server', 'cyan');
log(' Developed by DAOTOMATA FZE', 'blue');
log('', 'reset');
log(' We hope it served you well! ๐', 'magenta');
log('', 'reset');
}
function main() {
try {
displayHeader();
displayCleanupInstructions();
displayFeedback();
displayAlternatives();
displaySupport();
displayThankYou();
} catch (error) {
log(`โ Pre-uninstall error: ${error.message}`, 'red');
log(' Continuing with uninstallation...', 'yellow');
}
}
// Run if called directly
if (import.meta.url === `file://${process.argv[1]}`) {
main();
}
export { main };