@champz-llc/legends-mcp-server 1.3.8 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +97 -49
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -27,13 +27,13 @@ async function fetchImageAsBase64(imageUrl) {
|
|
|
27
27
|
const originalBuffer = Buffer.from(arrayBuffer);
|
|
28
28
|
console.error(`[MCP] Original image size: ${Math.round(originalBuffer.length / 1024)}KB`);
|
|
29
29
|
|
|
30
|
-
// Resize image to max
|
|
30
|
+
// Resize image to max 200x200 (perfect for chat) and convert to JPEG for smaller size
|
|
31
31
|
const resizedBuffer = await sharp(originalBuffer)
|
|
32
|
-
.resize(
|
|
32
|
+
.resize(200, 200, {
|
|
33
33
|
fit: 'inside',
|
|
34
34
|
withoutEnlargement: true
|
|
35
35
|
})
|
|
36
|
-
.
|
|
36
|
+
.jpeg({ quality: 80, mozjpeg: true }) // JPEG is much smaller than PNG
|
|
37
37
|
.toBuffer();
|
|
38
38
|
|
|
39
39
|
const base64 = resizedBuffer.toString('base64');
|
|
@@ -659,39 +659,50 @@ You can still ask about:
|
|
|
659
659
|
const stats = data.statistics;
|
|
660
660
|
const claims = data.claims;
|
|
661
661
|
|
|
662
|
-
let output =
|
|
663
|
-
output +=
|
|
664
|
-
output += `Wallet: ${data.wallet}\n`;
|
|
662
|
+
let output = `🍄 **LEGENDS OF CHAMPZ** - Player Stats 🍄\n\n`;
|
|
663
|
+
output += `👤 **Player:** ${displayName}\n`;
|
|
665
664
|
if (data.basename) {
|
|
666
|
-
output +=
|
|
665
|
+
output += `🎯 **Basename:** ${data.basename}\n`;
|
|
667
666
|
}
|
|
668
|
-
output +=
|
|
669
|
-
|
|
670
|
-
output +=
|
|
671
|
-
output +=
|
|
672
|
-
output +=
|
|
673
|
-
output += `
|
|
674
|
-
output += `
|
|
675
|
-
|
|
676
|
-
output +=
|
|
677
|
-
|
|
678
|
-
output +=
|
|
679
|
-
output +=
|
|
680
|
-
output +=
|
|
681
|
-
output += `
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
output += `
|
|
685
|
-
output += `
|
|
686
|
-
output += `
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
output +=
|
|
690
|
-
output +=
|
|
691
|
-
output +=
|
|
692
|
-
output += `
|
|
693
|
-
output += `
|
|
694
|
-
output += `
|
|
667
|
+
output += `📅 **Member Since:** ${new Date(stats.member_since).toLocaleDateString()} - Let's go! 🎮\n\n`;
|
|
668
|
+
|
|
669
|
+
output += `━━━━━━━━━━━━━━━━━━━━━━\n`;
|
|
670
|
+
output += `📦 **PACKS & LEGENDS**\n`;
|
|
671
|
+
output += `━━━━━━━━━━━━━━━━━━━━━━\n`;
|
|
672
|
+
output += ` 🎲 Packs opened: **${stats.total_packs_opened}** ${stats.total_packs_opened > 50 ? '(Pack master! 🔥)' : ''}\n`;
|
|
673
|
+
output += ` 💎 CHAMPZ spent: **${stats.champz_spent_on_packs.toLocaleString()}** tokens\n`;
|
|
674
|
+
output += ` 🍄 Legends owned: **${stats.legends_owned}** ${stats.legends_owned > 30 ? '(Epic collection! ⭐)' : ''}\n`;
|
|
675
|
+
output += ` ⭐ Trainer slots: **${stats.saved_trainer_slots}**\n\n`;
|
|
676
|
+
|
|
677
|
+
output += `━━━━━━━━━━━━━━━━━━━━━━\n`;
|
|
678
|
+
output += `⚔️ **BATTLE RECORD**\n`;
|
|
679
|
+
output += `━━━━━━━━━━━━━━━━━━━━━━\n`;
|
|
680
|
+
output += ` 🎯 Total battles: **${stats.total_battles}** fights!\n`;
|
|
681
|
+
const winRate = (stats.win_rate * 100).toFixed(1);
|
|
682
|
+
const winRateEmoji = winRate >= 70 ? '🔥🔥🔥' : winRate >= 60 ? '🔥🔥' : winRate >= 50 ? '🔥' : '💪';
|
|
683
|
+
output += ` 🏆 Wins: **${stats.battles_won}** (${winRate}% win rate ${winRateEmoji})\n`;
|
|
684
|
+
output += ` 💀 Losses: **${stats.battles_lost}**\n`;
|
|
685
|
+
output += ` ⚡ Current streak: **${stats.current_win_streak}** ${stats.current_win_streak >= 5 ? '(ON FIRE! 🔥)' : ''}\n`;
|
|
686
|
+
output += ` 🌟 Best streak: **${stats.best_win_streak}** ${stats.best_win_streak >= 10 ? '(Legendary! 💎)' : ''}\n\n`;
|
|
687
|
+
|
|
688
|
+
output += `━━━━━━━━━━━━━━━━━━━━━━\n`;
|
|
689
|
+
output += `👑 **THRONES & GUARDIAN**\n`;
|
|
690
|
+
output += `━━━━━━━━━━━━━━━━━━━━━━\n`;
|
|
691
|
+
output += ` 🏆 Thrones owned: **${stats.thrones_owned}** ${stats.thrones_owned > 0 ? '(Champion! 👑)' : ''}\n`;
|
|
692
|
+
output += ` 🛡️ Times held guardian: **${stats.times_held_guardian}** ${stats.times_held_guardian > 5 ? '(Guardian master! ⚡)' : ''}\n`;
|
|
693
|
+
output += ` 💰 CHAMPZ spent: **${stats.champz_spent_on_guardian.toLocaleString()}** tokens\n\n`;
|
|
694
|
+
|
|
695
|
+
output += `━━━━━━━━━━━━━━━━━━━━━━\n`;
|
|
696
|
+
output += `💵 **REWARDS CLAIMED**\n`;
|
|
697
|
+
output += `━━━━━━━━━━━━━━━━━━━━━━\n`;
|
|
698
|
+
const totalUSDC = claims.total_usdc_claimed;
|
|
699
|
+
const totalCHAMPZ = claims.total_champz_claimed;
|
|
700
|
+
output += ` 💵 Total USDC: **$${totalUSDC}** ${totalUSDC > 50 ? '(Big earner! 💰)' : totalUSDC > 20 ? '(Nice! 🎯)' : ''}\n`;
|
|
701
|
+
output += ` 🍄 Total CHAMPZ: **${totalCHAMPZ.toLocaleString()}** tokens ${totalCHAMPZ > 10000 ? '(Whale alert! 🐋)' : ''}\n`;
|
|
702
|
+
if (claims.by_type['6'].count > 0 || claims.by_type['19'].count > 0) {
|
|
703
|
+
output += ` 🎉 You're earning rewards - keep battling! ⚔️\n`;
|
|
704
|
+
}
|
|
705
|
+
output += `\n`;
|
|
695
706
|
|
|
696
707
|
// Build content array with text and images
|
|
697
708
|
const content = [
|
|
@@ -820,14 +831,40 @@ You can still ask about:
|
|
|
820
831
|
};
|
|
821
832
|
}
|
|
822
833
|
|
|
823
|
-
// Build output
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
834
|
+
// Build card-like output with gaming vibes
|
|
835
|
+
const rarityEmojis = {
|
|
836
|
+
unique: '💎',
|
|
837
|
+
legendary: '🌟',
|
|
838
|
+
epic: '🟣',
|
|
839
|
+
rare: '🔵',
|
|
840
|
+
common: '⚪'
|
|
841
|
+
};
|
|
842
|
+
const elementEmojis = {
|
|
843
|
+
fire: '🔥',
|
|
844
|
+
water: '💧',
|
|
845
|
+
wind: '🌪️',
|
|
846
|
+
earth: '🌍',
|
|
847
|
+
light: '✨',
|
|
848
|
+
dark: '🌑'
|
|
849
|
+
};
|
|
850
|
+
|
|
851
|
+
let output = `╔════════════════════════╗\n`;
|
|
852
|
+
output += `║ ${rarityEmojis[legend.rarity]} ${legend.rarity.toUpperCase()} LEGEND #${legend.legend_id} ║\n`;
|
|
853
|
+
output += `╚════════════════════════╝\n\n`;
|
|
854
|
+
|
|
855
|
+
output += `🍄 **${legend.name}**\n\n`;
|
|
856
|
+
|
|
857
|
+
// Elements with emojis
|
|
858
|
+
const elementIcons = legend.elements.map(e => `${elementEmojis[e] || '⭐'} ${e.charAt(0).toUpperCase() + e.slice(1)}`).join(' ');
|
|
859
|
+
output += `${elementIcons}\n\n`;
|
|
860
|
+
|
|
861
|
+
output += `⚡ **Total Power:** ${legend.total_power}\n`;
|
|
862
|
+
output += `⚔️ **ATK:** ${legend.attack}\n`;
|
|
863
|
+
output += `🛡️ **DEF:** ${legend.defense}\n`;
|
|
864
|
+
output += `💨 **SPD:** ${legend.speed}\n\n`;
|
|
865
|
+
|
|
866
|
+
output += `📅 Rolled: ${new Date(legend.rolled_at).toLocaleDateString()}\n`;
|
|
867
|
+
output += legend.is_saved ? `⭐ **Saved Trainer** - This legend is in your collection!\n` : `💡 Not saved yet - save this legend to keep it forever!\n`;
|
|
831
868
|
|
|
832
869
|
// Fetch image
|
|
833
870
|
const imageUrl = `https://img.champz.world${legend.image_path}`;
|
|
@@ -846,7 +883,7 @@ You can still ask about:
|
|
|
846
883
|
content.push({
|
|
847
884
|
type: 'image',
|
|
848
885
|
data: base64Data,
|
|
849
|
-
mimeType: 'image/
|
|
886
|
+
mimeType: 'image/jpeg',
|
|
850
887
|
});
|
|
851
888
|
}
|
|
852
889
|
|
|
@@ -898,11 +935,22 @@ You can still ask about:
|
|
|
898
935
|
};
|
|
899
936
|
}
|
|
900
937
|
|
|
901
|
-
// Build output
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
938
|
+
// Build card-like output with gaming vibes
|
|
939
|
+
const rarityEmojis = {
|
|
940
|
+
legendary: '👑',
|
|
941
|
+
epic: '💜',
|
|
942
|
+
rare: '💙',
|
|
943
|
+
common: '🤍'
|
|
944
|
+
};
|
|
945
|
+
|
|
946
|
+
let output = `╔════════════════════════╗\n`;
|
|
947
|
+
output += `║ ${rarityEmojis[throne.rarity] || '🏆'} ${throne.rarity.toUpperCase()} THRONE #${throne.throne_id} ║\n`;
|
|
948
|
+
output += `╚════════════════════════╝\n\n`;
|
|
949
|
+
|
|
950
|
+
output += `👑 **${throne.name}**\n\n`;
|
|
951
|
+
output += `🎮 **Earned in Cycle:** ${throne.cycle_id}\n`;
|
|
952
|
+
output += `📅 **Date Earned:** ${new Date(throne.earned_at).toLocaleDateString()}\n\n`;
|
|
953
|
+
output += `🏆 You're a champion! This throne proves you held the Guardian position and won the cycle!\n`;
|
|
906
954
|
|
|
907
955
|
// Fetch and convert image to base64
|
|
908
956
|
const imageUrl = `https://img.champz.world${throne.image_path}`;
|
|
@@ -919,7 +967,7 @@ You can still ask about:
|
|
|
919
967
|
content.push({
|
|
920
968
|
type: 'image',
|
|
921
969
|
data: base64Data,
|
|
922
|
-
mimeType: 'image/
|
|
970
|
+
mimeType: 'image/jpeg',
|
|
923
971
|
});
|
|
924
972
|
}
|
|
925
973
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@champz-llc/legends-mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "MCP server for Legends of Champz - Query game stats, access personal data with signature auth, and claim rewards through Claude Desktop",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|