mcmodding-mcp 0.1.0 → 0.2.2

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.
@@ -0,0 +1,370 @@
1
+ import Database from 'better-sqlite3';
2
+ import * as fs from 'fs';
3
+ import * as path from 'path';
4
+ export class ModExamplesService {
5
+ db;
6
+ static dbPath = path.join(process.cwd(), 'data', 'mod-examples.db');
7
+ constructor(dbPath) {
8
+ const finalPath = dbPath || ModExamplesService.dbPath;
9
+ console.error(`[ModExamplesService] Using database at: ${finalPath}`);
10
+ this.db = new Database(finalPath, { readonly: true });
11
+ }
12
+ static isAvailable() {
13
+ return fs.existsSync(ModExamplesService.dbPath);
14
+ }
15
+ getStats() {
16
+ const stats = this.db
17
+ .prepare(`
18
+ SELECT
19
+ (SELECT COUNT(*) FROM mods) as mods,
20
+ (SELECT COUNT(*) FROM examples) as examples,
21
+ (SELECT COUNT(*) FROM example_relations) as relations,
22
+ (SELECT COUNT(*) FROM categories) as categories,
23
+ (SELECT COUNT(*) FROM examples WHERE is_featured = TRUE) as featuredExamples,
24
+ (SELECT AVG(quality_score) FROM examples) as avgQualityScore
25
+ `)
26
+ .get();
27
+ return {
28
+ ...stats,
29
+ avgQualityScore: Math.round((stats.avgQualityScore || 0) * 100) / 100,
30
+ };
31
+ }
32
+ listMods() {
33
+ const mods = this.db
34
+ .prepare(`
35
+ SELECT
36
+ m.id,
37
+ m.name,
38
+ m.repo,
39
+ m.loader,
40
+ m.description,
41
+ m.readme_summary as readmeSummary,
42
+ m.architecture_notes as architectureNotes,
43
+ m.star_count as starCount,
44
+ m.minecraft_versions as minecraftVersions,
45
+ COUNT(e.id) as exampleCount
46
+ FROM mods m
47
+ LEFT JOIN examples e ON e.mod_id = m.id
48
+ GROUP BY m.id
49
+ ORDER BY m.priority DESC, m.star_count DESC
50
+ `)
51
+ .all();
52
+ return mods.map((m) => ({
53
+ ...m,
54
+ minecraftVersions: JSON.parse(m.minecraftVersions || '[]'),
55
+ }));
56
+ }
57
+ getMod(name) {
58
+ const mod = this.db
59
+ .prepare(`
60
+ SELECT
61
+ m.id,
62
+ m.name,
63
+ m.repo,
64
+ m.loader,
65
+ m.description,
66
+ m.readme_summary as readmeSummary,
67
+ m.architecture_notes as architectureNotes,
68
+ m.star_count as starCount,
69
+ m.minecraft_versions as minecraftVersions,
70
+ COUNT(e.id) as exampleCount
71
+ FROM mods m
72
+ LEFT JOIN examples e ON e.mod_id = m.id
73
+ WHERE LOWER(m.name) = LOWER(?)
74
+ GROUP BY m.id
75
+ `)
76
+ .get(name);
77
+ if (!mod)
78
+ return null;
79
+ return {
80
+ ...mod,
81
+ minecraftVersions: JSON.parse(mod.minecraftVersions || '[]'),
82
+ };
83
+ }
84
+ listCategories() {
85
+ return this.db
86
+ .prepare(`
87
+ SELECT
88
+ c.slug,
89
+ c.name,
90
+ c.description,
91
+ c.icon,
92
+ COUNT(e.id) as exampleCount
93
+ FROM categories c
94
+ LEFT JOIN examples e ON e.category_id = c.id
95
+ GROUP BY c.id
96
+ HAVING exampleCount > 0
97
+ ORDER BY c.sort_order ASC
98
+ `)
99
+ .all();
100
+ }
101
+ searchExamples(options) {
102
+ const { query, modName, category, patternType, complexity, minQualityScore = 0, featured, tags, limit = 10, } = options;
103
+ let sql = `
104
+ SELECT DISTINCT
105
+ e.id,
106
+ m.name as modName,
107
+ m.repo as modRepo,
108
+ e.file_path as filePath,
109
+ e.file_url as fileUrl,
110
+ e.start_line as startLine,
111
+ e.end_line as endLine,
112
+ e.title,
113
+ e.code,
114
+ e.language,
115
+ e.caption,
116
+ e.explanation,
117
+ e.pattern_type as patternType,
118
+ e.complexity,
119
+ c.slug as category,
120
+ c.name as categoryName,
121
+ e.best_practices as bestPractices,
122
+ e.potential_pitfalls as potentialPitfalls,
123
+ e.use_cases as useCases,
124
+ e.keywords,
125
+ e.minecraft_concepts as minecraftConcepts,
126
+ e.quality_score as qualityScore,
127
+ e.is_featured as isFeatured
128
+ FROM examples e
129
+ JOIN mods m ON e.mod_id = m.id
130
+ LEFT JOIN categories c ON e.category_id = c.id
131
+ `;
132
+ const conditions = [];
133
+ const params = [];
134
+ if (query && query.trim()) {
135
+ sql += ` JOIN examples_fts fts ON fts.rowid = e.id`;
136
+ conditions.push(`examples_fts MATCH ?`);
137
+ const ftsQuery = query
138
+ .split(/\s+/)
139
+ .filter((t) => t.length > 1)
140
+ .map((t) => `"${t}"*`)
141
+ .join(' OR ');
142
+ params.push(ftsQuery || query);
143
+ }
144
+ if (modName) {
145
+ conditions.push(`LOWER(m.name) = LOWER(?)`);
146
+ params.push(modName);
147
+ }
148
+ if (category) {
149
+ conditions.push(`c.slug = ?`);
150
+ params.push(category);
151
+ }
152
+ if (patternType) {
153
+ conditions.push(`e.pattern_type = ?`);
154
+ params.push(patternType);
155
+ }
156
+ if (complexity) {
157
+ conditions.push(`e.complexity = ?`);
158
+ params.push(complexity);
159
+ }
160
+ if (minQualityScore > 0) {
161
+ conditions.push(`e.quality_score >= ?`);
162
+ params.push(minQualityScore);
163
+ }
164
+ if (featured !== undefined) {
165
+ conditions.push(`e.is_featured = ?`);
166
+ params.push(featured ? 1 : 0);
167
+ }
168
+ if (tags && tags.length > 0) {
169
+ sql += ` JOIN example_tags et ON et.example_id = e.id JOIN tags t ON t.id = et.tag_id`;
170
+ conditions.push(`t.slug IN (${tags.map(() => '?').join(', ')})`);
171
+ params.push(...tags);
172
+ }
173
+ if (conditions.length > 0) {
174
+ sql += ` WHERE ${conditions.join(' AND ')}`;
175
+ }
176
+ sql += ` ORDER BY e.quality_score DESC, e.is_featured DESC LIMIT ?`;
177
+ params.push(limit);
178
+ const examples = this.db.prepare(sql).all(...params);
179
+ return examples.map((e) => this.enrichExample(e));
180
+ }
181
+ getExample(id) {
182
+ const example = this.db
183
+ .prepare(`
184
+ SELECT
185
+ e.id,
186
+ m.name as modName,
187
+ m.repo as modRepo,
188
+ e.file_path as filePath,
189
+ e.file_url as fileUrl,
190
+ e.start_line as startLine,
191
+ e.end_line as endLine,
192
+ e.title,
193
+ e.code,
194
+ e.language,
195
+ e.caption,
196
+ e.explanation,
197
+ e.pattern_type as patternType,
198
+ e.complexity,
199
+ c.slug as category,
200
+ c.name as categoryName,
201
+ e.best_practices as bestPractices,
202
+ e.potential_pitfalls as potentialPitfalls,
203
+ e.use_cases as useCases,
204
+ e.keywords,
205
+ e.minecraft_concepts as minecraftConcepts,
206
+ e.quality_score as qualityScore,
207
+ e.is_featured as isFeatured
208
+ FROM examples e
209
+ JOIN mods m ON e.mod_id = m.id
210
+ LEFT JOIN categories c ON e.category_id = c.id
211
+ WHERE e.id = ?
212
+ `)
213
+ .get(id);
214
+ if (!example)
215
+ return null;
216
+ return this.enrichExample(example);
217
+ }
218
+ getRelatedExamples(exampleId) {
219
+ return this.db
220
+ .prepare(`
221
+ SELECT
222
+ r.source_id as sourceId,
223
+ r.target_id as targetId,
224
+ r.relation_type as relationType,
225
+ r.description,
226
+ r.strength,
227
+ e.title as targetTitle,
228
+ e.caption as targetCaption
229
+ FROM example_relations r
230
+ JOIN examples e ON e.id = r.target_id
231
+ WHERE r.source_id = ?
232
+ ORDER BY r.strength DESC
233
+ `)
234
+ .all(exampleId);
235
+ }
236
+ getFeaturedExamples(limit = 10) {
237
+ return this.searchExamples({
238
+ featured: true,
239
+ minQualityScore: 0.7,
240
+ limit,
241
+ });
242
+ }
243
+ getExamplesByPattern(patternType, limit = 10) {
244
+ return this.searchExamples({
245
+ patternType,
246
+ minQualityScore: 0.5,
247
+ limit,
248
+ });
249
+ }
250
+ getPatternTypes() {
251
+ return this.db
252
+ .prepare(`
253
+ SELECT pattern_type as type, COUNT(*) as count
254
+ FROM examples
255
+ WHERE pattern_type IS NOT NULL
256
+ GROUP BY pattern_type
257
+ ORDER BY count DESC
258
+ `)
259
+ .all();
260
+ }
261
+ enrichExample(example) {
262
+ const tags = this.db
263
+ .prepare(`
264
+ SELECT t.slug
265
+ FROM tags t
266
+ JOIN example_tags et ON et.tag_id = t.id
267
+ WHERE et.example_id = ?
268
+ `)
269
+ .all(example.id);
270
+ const imports = this.db
271
+ .prepare(`
272
+ SELECT import_path as path, import_type as type, is_critical as isCritical
273
+ FROM example_imports
274
+ WHERE example_id = ?
275
+ `)
276
+ .all(example.id);
277
+ const apiRefs = this.db
278
+ .prepare(`
279
+ SELECT class_name as className, method_name as methodName, api_type as apiType
280
+ FROM api_references
281
+ WHERE example_id = ?
282
+ `)
283
+ .all(example.id);
284
+ return {
285
+ ...example,
286
+ bestPractices: JSON.parse(example.bestPractices || '[]'),
287
+ potentialPitfalls: JSON.parse(example.potentialPitfalls || '[]'),
288
+ useCases: JSON.parse(example.useCases || '[]'),
289
+ keywords: JSON.parse(example.keywords || '[]'),
290
+ minecraftConcepts: JSON.parse(example.minecraftConcepts || '[]'),
291
+ tags: tags.map((t) => t.slug),
292
+ imports: imports.map((i) => ({ ...i, isCritical: Boolean(i.isCritical) })),
293
+ apiReferences: apiRefs.map((r) => ({
294
+ className: r.className,
295
+ methodName: r.methodName || undefined,
296
+ apiType: r.apiType,
297
+ })),
298
+ };
299
+ }
300
+ formatExampleForAI(example) {
301
+ let output = '';
302
+ output += `## ${example.title}\n\n`;
303
+ output += `**Source:** ${example.modName} (${example.modRepo})\n`;
304
+ output += `**File:** [${example.filePath}](${example.fileUrl}) (lines ${example.startLine}-${example.endLine})\n`;
305
+ output += `**Category:** ${example.categoryName || example.category}\n`;
306
+ output += `**Pattern:** ${example.patternType}\n`;
307
+ output += `**Complexity:** ${example.complexity}\n`;
308
+ output += `**Quality Score:** ${(example.qualityScore * 100).toFixed(0)}%\n`;
309
+ if (example.isFeatured) {
310
+ output += `**Featured:** Yes (curated high-quality example)\n`;
311
+ }
312
+ if (example.tags.length > 0) {
313
+ output += `**Tags:** ${example.tags.join(', ')}\n`;
314
+ }
315
+ output += `\n### Description\n${example.caption}\n`;
316
+ if (example.explanation) {
317
+ output += `\n### Detailed Explanation\n${example.explanation}\n`;
318
+ }
319
+ output += `\n### Code\n\`\`\`${example.language}\n${example.code}\n\`\`\`\n`;
320
+ if (example.bestPractices.length > 0) {
321
+ output += `\n### Best Practices\n`;
322
+ example.bestPractices.forEach((bp) => {
323
+ output += `- ${bp}\n`;
324
+ });
325
+ }
326
+ if (example.potentialPitfalls.length > 0) {
327
+ output += `\n### Potential Pitfalls\n`;
328
+ example.potentialPitfalls.forEach((pp) => {
329
+ output += `- ⚠️ ${pp}\n`;
330
+ });
331
+ }
332
+ if (example.useCases.length > 0) {
333
+ output += `\n### When to Use\n`;
334
+ example.useCases.forEach((uc) => {
335
+ output += `- ${uc}\n`;
336
+ });
337
+ }
338
+ if (example.minecraftConcepts.length > 0) {
339
+ output += `\n### Minecraft Concepts Used\n`;
340
+ output += example.minecraftConcepts.join(', ') + '\n';
341
+ }
342
+ if (example.imports.length > 0) {
343
+ const criticalImports = example.imports.filter((i) => i.isCritical);
344
+ if (criticalImports.length > 0) {
345
+ output += `\n### Required Imports\n\`\`\`java\n`;
346
+ criticalImports.forEach((i) => {
347
+ output += `import ${i.path};\n`;
348
+ });
349
+ output += `\`\`\`\n`;
350
+ }
351
+ }
352
+ return output;
353
+ }
354
+ formatExamplesForAI(examples) {
355
+ if (examples.length === 0) {
356
+ return 'No mod examples found matching your criteria.\n\nTry:\n- Using broader search terms\n- Removing filters\n- Checking available categories with list_mod_categories';
357
+ }
358
+ let output = `Found ${examples.length} canonical mod example${examples.length > 1 ? 's' : ''}:\n\n`;
359
+ examples.forEach((example, index) => {
360
+ output += `---\n\n`;
361
+ output += `### Example ${index + 1} of ${examples.length}\n\n`;
362
+ output += this.formatExampleForAI(example);
363
+ });
364
+ return output;
365
+ }
366
+ close() {
367
+ this.db.close();
368
+ }
369
+ }
370
+ //# sourceMappingURL=mod-examples-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod-examples-service.js","sourceRoot":"","sources":["../../src/services/mod-examples-service.ts"],"names":[],"mappings":"AAKA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAA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I,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC/B,MAAM,IAAI,sCAAsC,CAAC;gBACjD,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;oBAC5B,MAAM,IAAI,UAAU,CAAC,CAAC,IAAI,KAAK,CAAC;gBAClC,CAAC,CAAC,CAAC;gBACH,MAAM,IAAI,UAAU,CAAC;YACvB,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAKD,mBAAmB,CAAC,QAAsB;QACxC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1B,OAAO,mKAAmK,CAAC;QAC7K,CAAC;QAED,IAAI,MAAM,GAAG,SAAS,QAAQ,CAAC,MAAM,yBAAyB,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;QAEpG,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;YAClC,MAAM,IAAI,SAAS,CAAC;YACpB,MAAM,IAAI,eAAe,KAAK,GAAG,CAAC,OAAO,QAAQ,CAAC,MAAM,MAAM,CAAC;YAC/D,MAAM,IAAI,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC;IAKD,KAAK;QACH,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC"}
@@ -0,0 +1,144 @@
1
+ import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
+ export declare const MOD_EXAMPLES_TOOLS: ({
3
+ name: string;
4
+ description: string;
5
+ inputSchema: {
6
+ type: "object";
7
+ properties: {
8
+ query: {
9
+ type: string;
10
+ description: string;
11
+ };
12
+ mod: {
13
+ type: string;
14
+ description: string;
15
+ };
16
+ category: {
17
+ type: string;
18
+ enum: string[];
19
+ description: string;
20
+ };
21
+ pattern_type: {
22
+ type: string;
23
+ description: string;
24
+ };
25
+ complexity: {
26
+ type: string;
27
+ enum: string[];
28
+ description: string;
29
+ };
30
+ min_quality: {
31
+ type: string;
32
+ description: string;
33
+ minimum: number;
34
+ maximum: number;
35
+ };
36
+ featured_only: {
37
+ type: string;
38
+ description: string;
39
+ };
40
+ limit: {
41
+ type: string;
42
+ description: string;
43
+ minimum: number;
44
+ maximum: number;
45
+ };
46
+ id?: undefined;
47
+ include_related?: undefined;
48
+ include_stats?: undefined;
49
+ };
50
+ required?: undefined;
51
+ };
52
+ } | {
53
+ name: string;
54
+ description: string;
55
+ inputSchema: {
56
+ type: "object";
57
+ properties: {
58
+ id: {
59
+ type: string;
60
+ description: string;
61
+ };
62
+ include_related: {
63
+ type: string;
64
+ description: string;
65
+ };
66
+ query?: undefined;
67
+ mod?: undefined;
68
+ category?: undefined;
69
+ pattern_type?: undefined;
70
+ complexity?: undefined;
71
+ min_quality?: undefined;
72
+ featured_only?: undefined;
73
+ limit?: undefined;
74
+ include_stats?: undefined;
75
+ };
76
+ required: string[];
77
+ };
78
+ } | {
79
+ name: string;
80
+ description: string;
81
+ inputSchema: {
82
+ type: "object";
83
+ properties: {
84
+ include_stats: {
85
+ type: string;
86
+ description: string;
87
+ };
88
+ query?: undefined;
89
+ mod?: undefined;
90
+ category?: undefined;
91
+ pattern_type?: undefined;
92
+ complexity?: undefined;
93
+ min_quality?: undefined;
94
+ featured_only?: undefined;
95
+ limit?: undefined;
96
+ id?: undefined;
97
+ include_related?: undefined;
98
+ };
99
+ required?: undefined;
100
+ };
101
+ } | {
102
+ name: string;
103
+ description: string;
104
+ inputSchema: {
105
+ type: "object";
106
+ properties: {
107
+ query?: undefined;
108
+ mod?: undefined;
109
+ category?: undefined;
110
+ pattern_type?: undefined;
111
+ complexity?: undefined;
112
+ min_quality?: undefined;
113
+ featured_only?: undefined;
114
+ limit?: undefined;
115
+ id?: undefined;
116
+ include_related?: undefined;
117
+ include_stats?: undefined;
118
+ };
119
+ required?: undefined;
120
+ };
121
+ })[];
122
+ export interface SearchModExamplesParams {
123
+ query?: string;
124
+ mod?: string;
125
+ category?: string;
126
+ pattern_type?: string;
127
+ complexity?: string;
128
+ min_quality?: number;
129
+ featured_only?: boolean;
130
+ limit?: number;
131
+ }
132
+ export declare function handleSearchModExamples(params: SearchModExamplesParams): CallToolResult;
133
+ export interface GetModExampleParams {
134
+ id: number;
135
+ include_related?: boolean;
136
+ }
137
+ export declare function handleGetModExample(params: GetModExampleParams): CallToolResult;
138
+ export interface ListCanonicalModsParams {
139
+ include_stats?: boolean;
140
+ }
141
+ export declare function handleListCanonicalMods(params: ListCanonicalModsParams): CallToolResult;
142
+ export declare function handleListModCategories(): CallToolResult;
143
+ export declare function handleGetModPatterns(): CallToolResult;
144
+ //# sourceMappingURL=modExamples.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modExamples.d.ts","sourceRoot":"","sources":["../../src/tools/modExamples.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAMzE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6H9B,CAAC;AAMF,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,uBAAuB,GAAG,cAAc,CAsEvF;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,cAAc,CA0E/E;AAED,MAAM,WAAW,uBAAuB;IACtC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,uBAAuB,GAAG,cAAc,CAkEvF;AAED,wBAAgB,uBAAuB,IAAI,cAAc,CA+CxD;AAED,wBAAgB,oBAAoB,IAAI,cAAc,CA+CrD"}