Skip to main content
Glama
Ripnrip

Quake Coding Arena MCP

by Ripnrip
index.jsโ€ข33.9 kB
#!/usr/bin/env node /** * ๐ŸŽญ The Enhanced Quake Oracle - Node.js MCP Server Edition v2.1 * * "Where coding victories become legendary achievements, and every * keystroke echoes through the digital arena with authentic male/female Quake voices!" * * Features: 15 achievements, voice switching (male/female), WAV/MP3 support * * - The Enhanced Quake Arena Master of Node.js */ const { Server } = require('@modelcontextprotocol/sdk/server/index.js'); const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio.js'); const { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } = require('@modelcontextprotocol/sdk/types.js'); const fs = require('fs'); const path = require('path'); // ๐ŸŒŸ The cosmic configuration of our enhanced digital arena // Now with actual downloaded Quake sounds! const ENHANCED_ACHIEVEMENTS = { // ๐ŸŽฏ Classic Kill Streaks (Available Sounds) 'RAMPAGE': { file: 'rampage.mp3', category: 'streak', threshold: 10 }, 'DOMINATING': { file: 'dominating.mp3', category: 'streak', threshold: 15 }, 'UNSTOPPABLE': { file: 'unstoppable.mp3', category: 'streak', threshold: 20 }, 'GODLIKE': { file: 'godlike.mp3', category: 'streak', threshold: 25 }, // โœจ Quality Achievements (Available Sounds) 'EXCELLENT': { file: 'excellent.mp3', category: 'quality', threshold: 1 }, 'PERFECT': { file: 'perfect.mp3', category: 'quality', threshold: 1 }, 'IMPRESSIVE': { file: 'impressive.mp3', category: 'quality', threshold: 1 }, // ๐Ÿ”ฅ Special Multi-kills (Available Sounds) 'DOUBLE KILL': { file: 'double-kill.mp3', category: 'multi', threshold: 2 }, 'TRIPLE KILL': { file: 'triple-kill.mp3', category: 'multi', threshold: 3 }, 'ULTRA KILL': { file: 'ultra-kill.mp3', category: 'multi', threshold: 4 }, 'WICKED SICK': { file: 'wicked-sick.mp3', category: 'multi', threshold: 7 }, 'HOLY SHIT': { file: 'holy-shit.mp3', category: 'multi', threshold: 10 }, // ๐ŸŽช Game State Announcements (Available Sounds) 'HUMILIATION': { file: 'humiliation.mp3', category: 'game', threshold: 1 }, 'FIRST BLOOD': { file: 'first-blood.mp3', category: 'game', threshold: 1 }, // ๐Ÿ‘ฅ Team Achievements (Available Sounds) 'PREPARE TO FIGHT': { file: 'prepare-to-fight.mp3', category: 'team', threshold: 1 } }; // ๐ŸŽช The cosmic state of our enhanced digital arena let enhancedStats = { totalAchievements: 0, categoryStats: {}, lastPlayed: null, volume: 80, // Enhanced volume control sessionStart: new Date().toISOString(), favoriteCategory: null, currentStreak: 0, longestStreak: 0, voicePack: 'male', // ๐ŸŽค Voice gender selection: 'male', 'female' femaleVoiceStyle: 'sexy-announcer' // ๐ŸŽญ Female voice style: 'sexy-announcer', 'gaming-announcer', etc. }; // ๐ŸŽค Available voice pack configurations const VOICE_PACKS = { male: { path: '../sounds/male', displayName: 'Male Announcer', description: 'Classic Quake 3 Arena male announcer voice' }, female: { path: '../sounds/female/sexy-announcer', displayName: 'Sexy Female Announcer', description: 'Authentic female announcer voice pack with energetic tone (WAV format)' } }; // ๐ŸŽจ Initialize category stats Object.values(ENHANCED_ACHIEVEMENTS).forEach(achievement => { if (!enhancedStats.categoryStats[achievement.category]) { enhancedStats.categoryStats[achievement.category] = 0; } }); // ๐ŸŒŸ The Enhanced Cross-Platform Sound Alchemist class EnhancedSoundOracle { static async playAchievementSound(achievementName, volume = 80, voiceGender = null) { const achievement = ENHANCED_ACHIEVEMENTS[achievementName.toUpperCase()]; if (!achievement) { throw new Error(`โŒ Unknown achievement: ${achievementName}`); } // ๐ŸŽค Use selected voice pack or default to current voice pack const selectedVoice = voiceGender || enhancedStats.voicePack; const voicePath = VOICE_PACKS[selectedVoice]?.path || VOICE_PACKS.male.path; // ๐ŸŽต Try WAV first (for female sounds), then MP3 const baseName = achievement.file.replace('.mp3', ''); const soundPathWav = `${__dirname}/${voicePath}/${baseName}.wav`; const soundPathMp3 = `${__dirname}/${voicePath}/${achievement.file}`; // Check which format exists for this voice pack const fs = require('fs'); let soundPath; if (fs.existsSync(soundPathWav)) { soundPath = soundPathWav; } else if (fs.existsSync(soundPathMp3)) { soundPath = soundPathMp3; } else { // Fallback to male voice const maleVoicePath = VOICE_PACKS.male.path; const malePathWav = `${__dirname}/${maleVoicePath}/${baseName}.wav`; const malePathMp3 = `${__dirname}/${maleVoicePath}/${achievement.file}`; if (fs.existsSync(malePathWav)) { soundPath = malePathWav; } else if (fs.existsSync(malePathMp3)) { soundPath = malePathMp3; } else { throw new Error(`โŒ Sound file not found: ${baseName} (${achievement.file})`); } } try { // ๐ŸŽจ Cross-platform audio magic with enhanced volume control const platform = process.platform; let command; if (platform === 'darwin') { // macOS magic with volume control command = `afplay -v ${volume / 100} "${soundPath}"`; } else if (platform === 'win32') { // Windows PowerShell magic command = `powershell -Command "(New-Object Media.SoundPlayer '${soundPath}').PlaySync(); Start-Sleep -Milliseconds 100"`; } else { // Linux magic with volume control command = `paplay --volume=${volume} "${soundPath}" 2>/dev/null || aplay "${soundPath}" 2>/dev/null`; } // Achievement activation logged silently for MCP protocol // ๐ŸŽญ Execute the enhanced sound ritual const { spawn } = require('child_process'); return new Promise((resolve, reject) => { const child = spawn(command, [], { shell: true, detached: true }); child.unref(); // Let it run in the background child.on('error', reject); child.on('spawn', () => { // Achievement success logged silently for MCP protocol resolve(true); }); // Auto-cleanup after 5 seconds setTimeout(() => { try { child.kill('SIGTERM'); } catch (e) { // Already finished } }, 5000); }); } catch (error) { console.error(`๐ŸŒฉ๏ธ Enhanced sound challenge: ${error.message}`); throw error; } } static async checkAchievementExists(achievementName) { return ENHANCED_ACHIEVEMENTS.hasOwnProperty(achievementName.toUpperCase()); } static getAchievementInfo(achievementName) { return ENHANCED_ACHIEVEMENTS[achievementName.toUpperCase()]; } static getRandomAchievement(category = null) { const achievements = category ? Object.entries(ENHANCED_ACHIEVEMENTS).filter(([_, info]) => info.category === category) : Object.entries(ENHANCED_ACHIEVEMENTS); const random = achievements[Math.floor(Math.random() * achievements.length)]; return random ? random[0] : null; } } // ๐ŸŽญ The Enhanced MCP Server Virtuoso class EnhancedQuakeMCPServer { constructor() { this.server = new Server( { name: "enhanced-quake-coding-arena", version: "2.0.0", }, { capabilities: { tools: {}, }, } ); this.setupEnhancedTools(); } // ๐ŸŒŸ Setup Enhanced Tools Ritual setupEnhancedTools() { // ๐ŸŽฏ Enhanced Sound Player Tool this.server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { switch (name) { case "play_enhanced_quake_sound": return await this.handleEnhancedSoundPlay(args); case "get_enhanced_achievement_stats": return await this.getEnhancedAchievementStats(); case "get_enhanced_achievement_guide": return await this.getEnhancedAchievementGuide(args); case "get_ai_usage_guide": return await this.getAIUsageGuide(args); case "set_enhanced_volume": return await this.setEnhancedVolume(args); case "random_enhanced_achievement": return await this.playRandomEnhancedAchievement(args); case "list_enhanced_achievements": return await this.listEnhancedAchievements(args); case "set_voice_pack": return await this.setVoicePack(args); case "get_voice_pack_info": return await this.getVoicePackInfo(args); case "test_voice_packs": return await this.testVoicePacks(args); default: throw new McpError( ErrorCode.MethodNotFound, `๐ŸŒฉ๏ธ Unknown enhanced tool: ${name}` ); } } catch (error) { console.error(`๐ŸŒฉ๏ธ Enhanced tool error: ${error.message}`); throw new McpError( ErrorCode.InternalError, `๐ŸŽญ Enhanced arena challenge: ${error.message}` ); } }); // ๐Ÿ“š Enhanced Tools List this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: "play_enhanced_quake_sound", description: "๐ŸŽฏ Play an enhanced Quake achievement sound with voice gender selection!", inputSchema: { type: "object", properties: { achievement: { type: "string", description: "๐Ÿ† Enhanced achievement name (GODLIKE, UNSTOPPABLE, RAMPAGE, EXCELLENT, WICKED SICK, etc.)", enum: Object.keys(ENHANCED_ACHIEVEMENTS), }, volume: { type: "number", description: "๐Ÿ”Š Enhanced volume level (0-100)", minimum: 0, maximum: 100, default: 80, }, voiceGender: { type: "string", description: "๐ŸŽค Voice gender selection (male, female)", enum: ["male", "female"], default: null, }, }, required: ["achievement"], }, }, { name: "get_enhanced_achievement_stats", description: "๐Ÿ“Š Get comprehensive enhanced achievement statistics and insights", inputSchema: { type: "object", properties: {}, }, }, { name: "get_enhanced_achievement_guide", description: "๐Ÿ“š Complete enhanced guide to all Quake achievements and categories", inputSchema: { type: "object", properties: { category: { type: "string", description: "๐ŸŽฏ Filter by category (streak, quality, multi, game, team, custom)", enum: ["streak", "quality", "multi", "game", "team", "custom"], }, }, }, }, { name: "get_ai_usage_guide", description: "๐Ÿค– AI Usage Guide: Learn when and how to trigger Quake sounds for optimal coding motivation", inputSchema: { type: "object", properties: { context: { type: "string", description: "๐ŸŽฏ Get specific guidance for contexts like debugging, feature development, code review", enum: ["debugging", "features", "quality", "productivity", "all"], }, }, }, }, { name: "set_enhanced_volume", description: "๐Ÿ”Š Set enhanced volume for all arena sounds (0-100)", inputSchema: { type: "object", properties: { volume: { type: "number", description: "๐Ÿ”Š Enhanced volume level (0-100)", minimum: 0, maximum: 100, }, }, required: ["volume"], }, }, { name: "random_enhanced_achievement", description: "๐ŸŽฒ Play a random enhanced achievement sound, optionally filtered by category", inputSchema: { type: "object", properties: { category: { type: "string", description: "๐ŸŽฏ Filter by category (streak, quality, multi, game, team, powerup, custom)", enum: ["streak", "quality", "multi", "game", "team", "powerup", "custom"], }, volume: { type: "number", description: "๐Ÿ”Š Enhanced volume level (0-100)", minimum: 0, maximum: 100, default: 80, }, }, }, }, { name: "list_enhanced_achievements", description: "๐Ÿ“‹ List all available enhanced achievements with detailed info", inputSchema: { type: "object", properties: { category: { type: "string", description: "๐ŸŽฏ Filter by category (streak, quality, multi, game, team, powerup)", enum: ["streak", "quality", "multi", "game", "team", "powerup"], }, }, }, }, { name: "set_voice_pack", description: "๐ŸŽค Set the announcer voice pack (male or female)", inputSchema: { type: "object", properties: { voiceGender: { type: "string", description: "๐ŸŽค Voice gender selection", enum: ["male", "female"], }, }, required: ["voiceGender"], }, }, { name: "get_voice_pack_info", description: "๐ŸŽค Get current voice pack information and available options", inputSchema: { type: "object", properties: {}, }, }, { name: "test_voice_packs", description: "๐Ÿงช Test all available voice packs with a sample achievement", inputSchema: { type: "object", properties: { achievement: { type: "string", description: "๐Ÿ† Achievement to test with (default: EXCELLENT)", enum: Object.keys(ENHANCED_ACHIEVEMENTS), default: "EXCELLENT", }, }, }, }, ], }; }); } // ๐ŸŽฏ Enhanced Sound Handler async handleEnhancedSoundPlay(args) { const { achievement, volume = enhancedStats.volume, voiceGender } = args; if (!achievement) { throw new McpError( ErrorCode.InvalidParams, "๐ŸŽฏ Enhanced achievement name is required, arena champion!" ); } const achievementUpper = achievement.toUpperCase(); const exists = await EnhancedSoundOracle.checkAchievementExists(achievementUpper); if (!exists) { const available = Object.keys(ENHANCED_ACHIEVEMENTS).join(", "); throw new McpError( ErrorCode.InvalidParams, `โŒ Unknown enhanced achievement: ${achievement}. Available: ${available}` ); } const achievementInfo = EnhancedSoundOracle.getAchievementInfo(achievementUpper); try { await EnhancedSoundOracle.playAchievementSound(achievementUpper, volume, voiceGender); // ๐ŸŽŠ Update enhanced statistics enhancedStats.totalAchievements++; enhancedStats.categoryStats[achievementInfo.category]++; enhancedStats.lastPlayed = `${achievementUpper} (${new Date().toLocaleTimeString()})`; // ๐Ÿ”ฅ Update streak logic if (achievementInfo.category === 'streak') { enhancedStats.currentStreak = Math.max(enhancedStats.currentStreak, achievementInfo.threshold); enhancedStats.longestStreak = Math.max(enhancedStats.longestStreak, enhancedStats.currentStreak); } // ๐Ÿ† Update favorite category const maxCategory = Object.entries(enhancedStats.categoryStats) .reduce((a, b) => a[1] > b[1] ? a : b)[0]; enhancedStats.favoriteCategory = maxCategory; return { success: true, message: `๐ŸŽฏ โœจ ENHANCED ${achievementUpper} ECHOES THROUGH THE ARENA at ${volume}% volume!`, achievement: achievementUpper, category: achievementInfo.category, threshold: achievementInfo.threshold, volume: volume, soundFile: achievementInfo.file, stats: enhancedStats }; } catch (error) { throw new McpError( ErrorCode.InternalError, `๐ŸŒฉ๏ธ Enhanced sound challenge: ${error.message}` ); } } // ๐Ÿ“Š Enhanced Statistics Handler async getEnhancedAchievementStats() { const session = enhancedStats.sessionStart ? Math.round((Date.now() - new Date(enhancedStats.sessionStart)) / 1000 / 60) : 0; return { success: true, message: "๐Ÿ“Š Enhanced arena statistics retrieved!", stats: { totalAchievements: enhancedStats.totalAchievements, categoryStats: enhancedStats.categoryStats, lastPlayed: enhancedStats.lastPlayed, volume: enhancedStats.volume, sessionMinutes: session, favoriteCategory: enhancedStats.favoriteCategory, currentStreak: enhancedStats.currentStreak, longestStreak: enhancedStats.longestStreak, achievementsPerMinute: session > 0 ? (enhancedStats.totalAchievements / session).toFixed(2) : 0 } }; } // ๐Ÿ“š Enhanced Achievement Guide Handler async getEnhancedAchievementGuide(args) { const { category } = args; let guide = `๐ŸŽฏ **ENHANCED QUAKE CODING ARENA - COMPREHENSIVE ACHIEVEMENT GUIDE** ๐ŸŽฏ\n\n`; guide += `๐Ÿ“Š Total Achievements Available: ${Object.keys(ENHANCED_ACHIEVEMENTS).length}\n`; guide += `๐Ÿ”Š Current Volume: ${enhancedStats.volume}%\n\n`; const categories = { streak: "๐Ÿ”ฅ **KILL STREAKS** - Progressive achievement chains", quality: "โœจ **QUALITY ACHIEVEMENTS** - Exceptional coding moments", multi: "โš”๏ธ **MULTI-KILLS** - Rapid successive victories", game: "๐ŸŽฎ **GAME EVENTS** - Special arena moments", team: "๐Ÿ‘ฅ **TEAM ACHIEVEMENTS** - Collaborative victories", powerup: "๐Ÿ’Ž **POWER-UPS** - Enhancement moments" }; if (category && categories[category]) { guide += `${categories[category]}\n\n`; const categoryAchievements = Object.entries(ENHANCED_ACHIEVEMENTS) .filter(([_, info]) => info.category === category) .sort((a, b) => a[1].threshold - b[1].threshold); categoryAchievements.forEach(([name, info]) => { guide += `๐Ÿ† **${name}** - ${info.file} (Threshold: ${info.threshold})\n`; }); } else { Object.entries(categories).forEach(([cat, desc]) => { guide += `${desc}\n\n`; const catAchievements = Object.entries(ENHANCED_ACHIEVEMENTS) .filter(([_, info]) => info.category === cat) .sort((a, b) => a[1].threshold - b[1].threshold); catAchievements.forEach(([name, info]) => { guide += ` ๐Ÿ† **${name}** - ${info.file}\n`; }); guide += `\n`; }); } guide += `\n๐ŸŽฎ **Usage Examples:**\n`; guide += `โ€ข "Play godlike achievement sound"\n`; guide += `โ€ข "Trigger wicked sick at 50% volume"\n`; guide += `โ€ข "Random streak achievement"\n`; guide += `โ€ข "Show me team achievements"\n\n`; guide += `๐Ÿ“Š **Current Session Stats:**\n`; guide += `โ€ข Total Achievements: ${enhancedStats.totalAchievements}\n`; guide += `โ€ข Session Time: ${Math.round((Date.now() - new Date(enhancedStats.sessionStart)) / 1000 / 60)} minutes\n`; guide += `โ€ข Favorite Category: ${enhancedStats.favoriteCategory || 'None yet'}\n`; return { success: true, message: "๐Ÿ“š Enhanced achievement guide retrieved!", guide: guide }; } // ๐Ÿค– AI Usage Guide Handler async getAIUsageGuide(args) { const { context } = args; let guide = `๐Ÿค– **ENHANCED QUAKE ARENA - AI USAGE GUIDE** ๐Ÿค–\n\n`; guide += `๐Ÿ“š Learn when and how to trigger Quake sounds for optimal coding motivation!\n\n`; if (context && context !== 'all') { // Context-specific guidance const contexts = { debugging: { title: "๐Ÿ” DEBUGGING BATTLES", triggers: [ "First bug found โ†’ ๐ŸŽฏ FIRST BLOOD", "Bug fixed quickly โ†’ ๐ŸŽฏ HUMILIATION achievement", "Complex bug solved โ†’ ๐ŸŽฏ WICKED SICK achievement", "All bugs defeated โ†’ ๐ŸŽฏ DOMINATING achievement" ], examples: [ "๐Ÿ” Bug located! ๐ŸŽฏ First blood!", "โœ… Bug defeated! ๐ŸŽฏ HUMILIATION for that pesky error!", "๐Ÿง  Brilliant debugging! ๐ŸŽฏ WICKED SICK!" ] }, features: { title: "๐Ÿš€ FEATURE DEVELOPMENT", triggers: [ "Feature complete โ†’ ๐ŸŽฏ EXCELLENT achievement", "Multiple features โ†’ ๐ŸŽฏ RAMPAGE achievement", "Complex implementation โ†’ ๐ŸŽฏ DOMINATING achievement", "Perfect implementation โ†’ ๐ŸŽฏ PERFECT achievement" ], examples: [ "โœ… Feature implemented! ๐ŸŽฏ EXCELLENT achievement at 80% volume!", "๐Ÿš€ 3 features complete! ๐ŸŽฏ RAMPAGE! You're on fire!", "๐Ÿ’ก Perfect implementation! ๐ŸŽฏ PERFECT achievement!" ] }, quality: { title: "โœจ CODE QUALITY MOMENTS", triggers: [ "Clean code โ†’ ๐ŸŽฏ PERFECT achievement", "Elegant solution โ†’ ๐ŸŽฏ IMPRESSIVE achievement", "Excellent code โ†’ ๐ŸŽฏ EXCELLENT achievement", "Legendary code โ†’ ๐ŸŽฏ GODLIKE achievement" ], examples: [ "๐Ÿงน Code refactored beautifully! ๐ŸŽฏ PERFECT achievement!", "๐Ÿ’ก Elegant solution! ๐ŸŽฏ IMPRESSIVE achievement!", "๐Ÿ† Legendary implementation! ๐ŸŽฏ GODLIKE at 100% volume!" ] }, productivity: { title: "๐Ÿ“ˆ PRODUCTIVITY STREAKS", triggers: [ "Quick succession tasks โ†’ ๐ŸŽฏ RAMPAGE achievement", "Unstoppable progress โ†’ ๐ŸŽฏ UNSTOPPABLE achievement", "Major milestone โ†’ ๐ŸŽฏ DOMINATING achievement", "Session start โ†’ ๐ŸŽฏ PREPARE TO FIGHT" ], examples: [ "โšก 3 tasks in quick succession! ๐ŸŽฏ RAMPAGE achievement!", "๐Ÿ”ฅ You're unstoppable! ๐ŸŽฏ UNSTOPPABLE achievement!", "๐ŸŽฏ Time to code! PREPARE TO FIGHT achievement!" ] } }; const ctx = contexts[context]; if (ctx) { guide += `${ctx.title}\n\n`; guide += `**๐ŸŽฏ When to Trigger:**\n`; ctx.triggers.forEach(trigger => { guide += `โ€ข ${trigger}\n`; }); guide += `\n**๐Ÿ’ฌ Example Responses:**\n`; ctx.examples.forEach(example => { guide += `โ€ข ${example}\n`; }); } } else { // Complete guide guide += `## โšก **INSTANT TRIGGER CHEAT SHEET**\n\n`; guide += `### **Code Quality Moments:**\n`; guide += `โ€ข "Perfect code" โ†’ ๐ŸŽฏ **PERFECT** achievement\n`; guide += `โ€ข "Excellent solution" โ†’ ๐ŸŽฏ **EXCELLENT** achievement\n`; guide += `โ€ข "Brilliant approach" โ†’ ๐ŸŽฏ **IMPRESSIVE** achievement\n`; guide += `โ€ข "Clean implementation" โ†’ ๐ŸŽฏ **PERFECT** at 70% volume\n\n`; guide += `### **Problem Solving Victories:**\n`; guide += `โ€ข "First bug found" โ†’ ๐ŸŽฏ **FIRST BLOOD**\n`; guide += `โ€ข "Bug defeated" โ†’ ๐ŸŽฏ **HUMILIATION** achievement\n`; guide += `โ€ข "Clever solution" โ†’ ๐ŸŽฏ **WICKED SICK** achievement\n`; guide += `โ€ข "Breakthrough moment" โ†’ ๐ŸŽฏ **DOMINATING** achievement\n\n`; guide += `### **Productivity Streaks:**\n`; guide += `โ€ข "3 tasks complete" โ†’ ๐ŸŽฏ **RAMPAGE** achievement\n`; guide += `โ€ข "Quick succession" โ†’ ๐ŸŽฏ **RAMPAGE** at 80% volume\n`; guide += `โ€ข "On a roll" โ†’ ๐ŸŽฏ **DOMINATING** achievement\n`; guide += `โ€ข "Unstoppable" โ†’ ๐ŸŽฏ **UNSTOPPABLE** achievement\n\n`; guide += `### **Exceptional Achievements:**\n`; guide += `โ€ข "Legendary solution" โ†’ ๐ŸŽฏ **GODLIKE** at 100% volume\n`; guide += `โ€ข "Amazing work" โ†’ ๐ŸŽฏ **GODLIKE** achievement\n`; guide += `โ€ข "Incredible" โ†’ ๐ŸŽฏ **GODLIKE** at 90% volume\n`; guide += `โ€ข "Mind-blowing" โ†’ ๐ŸŽฏ **GODLIKE** at 100% volume\n\n`; guide += `### **Project Start:**\n`; guide += `โ€ข "Let's code" โ†’ ๐ŸŽฏ **PREPARE TO FIGHT** achievement\n`; guide += `โ€ข "Time to start" โ†’ ๐ŸŽฏ **PREPARE TO FIGHT** achievement\n`; guide += `โ€ข "Begin coding" โ†’ ๐ŸŽฏ **PREPARE TO FIGHT** achievement\n\n`; guide += `## ๐Ÿ”Š **VOLUME GUIDELINES**\n\n`; guide += `โ€ข **30-50%:** Small victories, minor fixes, subtle celebrations\n`; guide += `โ€ข **60-80%:** Good solutions, feature completion, moderate excitement\n`; guide += `โ€ข **90-100%:** Exceptional achievements, breakthroughs, major celebrations\n\n`; guide += `## โœ… **DO's AND โŒ DON'Ts**\n\n`; guide += `**โœ… DO use for:**\n`; guide += `โ€ข User expresses satisfaction with solution\n`; guide += `โ€ข Code runs successfully without errors\n`; guide += `โ€ข Creative or clever problem solving\n`; guide += `โ€ข Multiple quick wins in succession\n`; guide += `โ€ข Learning moments and breakthroughs\n\n`; guide += `**โŒ DON'T overuse for:**\n`; guide += `โ€ข Every single line of code\n`; guide += `โ€ข Simple explanations or routine tasks\n`; guide += `โ€ข Failed attempts or errors\n`; guide += `โ€ข When user is frustrated\n`; guide += `โ€ข Unremarkable accomplishments\n\n`; guide += `## ๐Ÿ“ **SAMPLE AI RESPONSES**\n\n`; guide += `\`\`\n`; guide += `โœ… Perfect implementation! ๐ŸŽฏ Play perfect achievement at 70% volume\n\n`; guide += `๐Ÿ” Bug found and fixed! ๐ŸŽฏ First blood!\n\n`; guide += `๐Ÿš€ Feature complete! ๐ŸŽฏ Excellent achievement at 80% volume\n\n`; guide += `๐Ÿ’ก Brilliant solution! ๐ŸŽฏ Impressive achievement at 85% volume\n\n`; guide += `๐Ÿ† That's legendary! ๐ŸŽฏ GODLIKE ACHIEVEMENT at 100% volume!\n`; guide += `\`\`\n\n`; guide += `## ๐ŸŽช **CONTEXTUAL EXAMPLES**\n\n`; guide += `**Early Morning Coding:**\n`; guide += `User: "Time to start coding for the day!"\n`; guide += `AI: "โ˜• Coffee ready! ๐ŸŽฏ Prepare to fight achievement! Let's make today productive!"\n\n`; guide += `**Debugging Session:**\n`; guide += `User: "Finally found that annoying bug!"\n`; guide += `AI: "๐ŸŽฏ First blood! ๐ŸŽฏ HUMILIATION for the bug that challenged you!"\n\n`; guide += `**Feature Development:**\n`; guide += `User: "This API endpoint works perfectly!"\n`; guide += `AI: "โœ… Perfect implementation! ๐ŸŽฏ Perfect achievement!"\n\n`; guide += `**Complex Problem:**\n`; guide += `User: "This solution is incredible!"\n`; guide += `AI: "๐Ÿ† Legendary work! ๐ŸŽฏ GODLIKE ACHIEVEMENT at 100% volume!"\n`; } guide += `\n\n๐ŸŽฏ **ENHANCED QUAKE ARENA - MAKING EVERY CODING SESSION EPIC!** ๐ŸŽฎโœจ`; guide += `\n๐Ÿ“Š Available achievements: ${Object.keys(ENHANCED_ACHIEVEMENTS).length}`; guide += `\n๐Ÿ”ง Current volume: ${enhancedStats.volume}%`; return { success: true, message: "๐Ÿค– AI usage guide retrieved! Master the art of motivational coding!", guide: guide, context: context || 'all', available_achievements: Object.keys(ENHANCED_ACHIEVEMENTS).length }; } // ๐Ÿ”Š Enhanced Volume Setter Handler async setEnhancedVolume(args) { const { volume } = args; if (typeof volume !== 'number' || volume < 0 || volume > 100) { throw new McpError( ErrorCode.InvalidParams, "๐Ÿ”Š Enhanced volume must be a number between 0 and 100!" ); } enhancedStats.volume = Math.round(volume); return { success: true, message: `๐Ÿ”Š Enhanced arena volume set to ${enhancedStats.volume}%!`, volume: enhancedStats.volume }; } // ๐ŸŽฒ Random Enhanced Achievement Handler async playRandomEnhancedAchievement(args) { const { category, volume = enhancedStats.volume } = args; const randomAchievement = EnhancedSoundOracle.getRandomAchievement(category); if (!randomAchievement) { throw new McpError( ErrorCode.InternalError, "๐ŸŽฒ No enhanced achievements available for the specified category!" ); } return await this.handleEnhancedSoundPlay({ achievement: randomAchievement, volume: volume }); } // ๐Ÿ“‹ Enhanced Achievement Lister Handler async listEnhancedAchievements(args) { const { category } = args; let achievements = Object.entries(ENHANCED_ACHIEVEMENTS); if (category) { achievements = achievements.filter(([_, info]) => info.category === category); } const sortedAchievements = achievements.sort((a, b) => { // Sort by category first, then by threshold if (a[1].category !== b[1].category) { return a[1].category.localeCompare(b[1].category); } return a[1].threshold - b[1].threshold; }); const list = sortedAchievements.map(([name, info]) => ({ name: name, file: info.file, category: info.category, threshold: info.threshold })); return { success: true, message: category ? `๐Ÿ“‹ Found ${list.length} enhanced ${category} achievements!` : `๐Ÿ“‹ Found all ${list.length} enhanced achievements!`, achievements: list, total: list.length }; } // ๐ŸŽค Voice Pack Management Methods // ๐ŸŽญ Set Voice Pack - Switch between male and female announcer async setVoicePack(args) { const { voiceGender } = args; if (!voiceGender) { throw new McpError( ErrorCode.InvalidParams, "๐ŸŽค Voice gender is required (male or female)!" ); } if (!VOICE_PACKS[voiceGender]) { const available = Object.keys(VOICE_PACKS).join(", "); throw new McpError( ErrorCode.InvalidParams, `โŒ Unknown voice pack: ${voiceGender}. Available: ${available}` ); } // ๐ŸŽช Update the global voice pack setting enhancedStats.voicePack = voiceGender; return { success: true, message: `๐ŸŽค Voice pack set to ${VOICE_PACKS[voiceGender].displayName}!`, currentVoicePack: enhancedStats.voicePack, voicePackInfo: VOICE_PACKS[voiceGender] }; } // ๐ŸŽญ Get Voice Pack Info - Show current and available voice packs async getVoicePackInfo(args) { return { success: true, message: "๐ŸŽค Voice pack information retrieved!", currentVoicePack: enhancedStats.voicePack, currentVoiceInfo: VOICE_PACKS[enhancedStats.voicePack], availableVoicePacks: Object.keys(VOICE_PACKS).map(key => ({ id: key, ...VOICE_PACKS[key] })) }; } // ๐ŸŽญ Test Voice Packs - Test all available voice packs async testVoicePacks(args) { const { achievement = "EXCELLENT" } = args; if (!ENHANCED_ACHIEVEMENTS[achievement]) { const available = Object.keys(ENHANCED_ACHIEVEMENTS).join(", "); throw new McpError( ErrorCode.InvalidParams, `โŒ Unknown achievement: ${achievement}. Available: ${available}` ); } const testResults = []; for (const [voiceId, voiceInfo] of Object.entries(VOICE_PACKS)) { try { // ๐ŸŽช Test each voice pack await EnhancedSoundOracle.playAchievementSound(achievement, 70, voiceId); testResults.push({ voiceId: voiceId, voiceName: voiceInfo.displayName, status: "success", message: `โœ… ${voiceInfo.displayName} played successfully` }); // Wait a moment between voices await new Promise(resolve => setTimeout(resolve, 1500)); } catch (error) { testResults.push({ voiceId: voiceId, voiceName: voiceInfo.displayName, status: "error", message: `โŒ ${voiceInfo.displayName} failed: ${error.message}` }); } } return { success: true, message: `๐Ÿงช Tested all voice packs with ${achievement}!`, testAchievement: achievement, testResults: testResults, totalVoices: Object.keys(VOICE_PACKS).length, successfulTests: testResults.filter(r => r.status === "success").length }; } // ๐Ÿš€ Enhanced Server Start Ritual async run() { const transport = new StdioServerTransport(); await this.server.connect(transport); // Only output JSON-RPC protocol messages - no emoji logs console.error(`ENHANCED QUAKE CODING ARENA - ${Object.keys(ENHANCED_ACHIEVEMENTS).length} achievements loaded`); } } // ๐ŸŒŸ Enhanced Server Activation Ritual if (require.main === module) { const server = new EnhancedQuakeMCPServer(); server.run().catch(error => { console.error('Enhanced server failed to start:', error.message); process.exit(1); }); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Ripnrip/Quake-Coding-Arena-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server