@champz-llc/legends-mcp-server 1.8.0 → 1.8.1
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 +94 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -295,6 +295,20 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
295
295
|
},
|
|
296
296
|
required: []
|
|
297
297
|
},
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: 'legends_game_guide',
|
|
301
|
+
description: 'Get comprehensive game guide information about Legends of Champz. Use this tool when users ask about game mechanics, how to play, strategies, features, or any game-related questions. Covers: battles, elements, Guardian, Elemental Charge, AI Magistrate, rewards, achievements, tiers, AP system, and pro tips.',
|
|
302
|
+
inputSchema: {
|
|
303
|
+
type: 'object',
|
|
304
|
+
properties: {
|
|
305
|
+
topic: {
|
|
306
|
+
type: 'string',
|
|
307
|
+
description: 'Optional: specific topic to search for (e.g., "elemental charge", "AI magistrate", "guardian", "battles", "achievements"). If not provided, returns overview.',
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
required: []
|
|
311
|
+
},
|
|
298
312
|
}
|
|
299
313
|
];
|
|
300
314
|
|
|
@@ -1460,6 +1474,86 @@ You can still ask about:
|
|
|
1460
1474
|
};
|
|
1461
1475
|
}
|
|
1462
1476
|
|
|
1477
|
+
case 'legends_game_guide':
|
|
1478
|
+
try {
|
|
1479
|
+
const docPath = join(__dirname, 'docs', 'game-guide.md');
|
|
1480
|
+
const fullGuide = readFileSync(docPath, 'utf-8');
|
|
1481
|
+
|
|
1482
|
+
const topic = request.params.arguments?.topic;
|
|
1483
|
+
|
|
1484
|
+
if (!topic) {
|
|
1485
|
+
// Return full guide overview
|
|
1486
|
+
return {
|
|
1487
|
+
content: [
|
|
1488
|
+
{
|
|
1489
|
+
type: 'text',
|
|
1490
|
+
text: fullGuide,
|
|
1491
|
+
},
|
|
1492
|
+
],
|
|
1493
|
+
};
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
// Search for specific topic (case-insensitive)
|
|
1497
|
+
const topicLower = topic.toLowerCase();
|
|
1498
|
+
const lines = fullGuide.split('\n');
|
|
1499
|
+
let relevantSection = '';
|
|
1500
|
+
let inRelevantSection = false;
|
|
1501
|
+
let sectionDepth = 0;
|
|
1502
|
+
|
|
1503
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1504
|
+
const line = lines[i];
|
|
1505
|
+
const lineLower = line.toLowerCase();
|
|
1506
|
+
|
|
1507
|
+
// Check if this line is a header that matches our topic
|
|
1508
|
+
if (line.startsWith('#')) {
|
|
1509
|
+
const headerLevel = line.match(/^#+/)[0].length;
|
|
1510
|
+
|
|
1511
|
+
if (lineLower.includes(topicLower)) {
|
|
1512
|
+
inRelevantSection = true;
|
|
1513
|
+
sectionDepth = headerLevel;
|
|
1514
|
+
relevantSection = line + '\n';
|
|
1515
|
+
} else if (inRelevantSection && headerLevel <= sectionDepth) {
|
|
1516
|
+
// Hit a same-level or higher-level header, section ended
|
|
1517
|
+
break;
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
if (inRelevantSection) {
|
|
1522
|
+
relevantSection += line + '\n';
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
if (relevantSection) {
|
|
1527
|
+
return {
|
|
1528
|
+
content: [
|
|
1529
|
+
{
|
|
1530
|
+
type: 'text',
|
|
1531
|
+
text: `Found relevant section about "${topic}":\n\n${relevantSection}`,
|
|
1532
|
+
},
|
|
1533
|
+
],
|
|
1534
|
+
};
|
|
1535
|
+
} else {
|
|
1536
|
+
// Topic not found, return full guide
|
|
1537
|
+
return {
|
|
1538
|
+
content: [
|
|
1539
|
+
{
|
|
1540
|
+
type: 'text',
|
|
1541
|
+
text: `Topic "${topic}" not found in specific section. Here's the complete game guide:\n\n${fullGuide}`,
|
|
1542
|
+
},
|
|
1543
|
+
],
|
|
1544
|
+
};
|
|
1545
|
+
}
|
|
1546
|
+
} catch (error) {
|
|
1547
|
+
return {
|
|
1548
|
+
content: [
|
|
1549
|
+
{
|
|
1550
|
+
type: 'text',
|
|
1551
|
+
text: `Error reading game guide: ${error.message}`,
|
|
1552
|
+
},
|
|
1553
|
+
],
|
|
1554
|
+
};
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1463
1557
|
case 'show_throne':
|
|
1464
1558
|
if (!hasWalletAuth) {
|
|
1465
1559
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@champz-llc/legends-mcp-server",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.1",
|
|
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",
|