@stacksfinder/mcp-server 1.1.0 → 1.2.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/LICENSE +16 -16
- package/README.md +92 -3
- package/dist/compatibility/index.d.ts +11 -0
- package/dist/compatibility/index.d.ts.map +1 -0
- package/dist/compatibility/index.js +13 -0
- package/dist/compatibility/index.js.map +1 -0
- package/dist/compatibility/rules.d.ts +29 -0
- package/dist/compatibility/rules.d.ts.map +1 -0
- package/dist/compatibility/rules.js +419 -0
- package/dist/compatibility/rules.js.map +1 -0
- package/dist/compatibility/scoring.d.ts +54 -0
- package/dist/compatibility/scoring.d.ts.map +1 -0
- package/dist/compatibility/scoring.js +209 -0
- package/dist/compatibility/scoring.js.map +1 -0
- package/dist/compatibility/types.d.ts +176 -0
- package/dist/compatibility/types.d.ts.map +1 -0
- package/dist/compatibility/types.js +26 -0
- package/dist/compatibility/types.js.map +1 -0
- package/dist/compatibility/utils.d.ts +82 -0
- package/dist/compatibility/utils.d.ts.map +1 -0
- package/dist/compatibility/utils.js +269 -0
- package/dist/compatibility/utils.js.map +1 -0
- package/dist/data/357/200/242/357/200/212cp H:bac_/303/240_guigui_v2stack_finderpackagesmcp-serversrcdatacompatibility_matrix.json H:bac_/303/240_guigui_v2stack_finderpackagesmcp-serverdistdata/357/200/242" +226 -0
- package/dist/http.d.ts +7 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +69 -0
- package/dist/http.js.map +1 -0
- package/dist/lib/mcp-compatibility/index.d.ts +33 -0
- package/dist/lib/mcp-compatibility/index.d.ts.map +1 -0
- package/dist/lib/mcp-compatibility/index.js +35 -0
- package/dist/lib/mcp-compatibility/index.js.map +1 -0
- package/dist/lib/mcp-compatibility/rules.d.ts +29 -0
- package/dist/lib/mcp-compatibility/rules.d.ts.map +1 -0
- package/dist/lib/mcp-compatibility/rules.js +419 -0
- package/dist/lib/mcp-compatibility/rules.js.map +1 -0
- package/dist/lib/mcp-compatibility/scoring.d.ts +54 -0
- package/dist/lib/mcp-compatibility/scoring.d.ts.map +1 -0
- package/dist/lib/mcp-compatibility/scoring.js +209 -0
- package/dist/lib/mcp-compatibility/scoring.js.map +1 -0
- package/dist/lib/mcp-compatibility/types.d.ts +176 -0
- package/dist/lib/mcp-compatibility/types.d.ts.map +1 -0
- package/dist/lib/mcp-compatibility/types.js +26 -0
- package/dist/lib/mcp-compatibility/types.js.map +1 -0
- package/dist/lib/mcp-compatibility/utils.d.ts +82 -0
- package/dist/lib/mcp-compatibility/utils.d.ts.map +1 -0
- package/dist/lib/mcp-compatibility/utils.js +269 -0
- package/dist/lib/mcp-compatibility/utils.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +296 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/check-compatibility.d.ts +43 -0
- package/dist/tools/check-compatibility.d.ts.map +1 -0
- package/dist/tools/check-compatibility.js +133 -0
- package/dist/tools/check-compatibility.js.map +1 -0
- package/dist/tools/project-kit/analyze-repo.d.ts +50 -0
- package/dist/tools/project-kit/analyze-repo.d.ts.map +1 -0
- package/dist/tools/project-kit/analyze-repo.js +456 -0
- package/dist/tools/project-kit/analyze-repo.js.map +1 -0
- package/dist/tools/project-kit/detect-stack.d.ts +16 -0
- package/dist/tools/project-kit/detect-stack.d.ts.map +1 -0
- package/dist/tools/project-kit/detect-stack.js +572 -0
- package/dist/tools/project-kit/detect-stack.js.map +1 -0
- package/dist/tools/project-kit/execute-installation.d.ts +50 -0
- package/dist/tools/project-kit/execute-installation.d.ts.map +1 -0
- package/dist/tools/project-kit/execute-installation.js +440 -0
- package/dist/tools/project-kit/execute-installation.js.map +1 -0
- package/dist/tools/project-kit/generate.d.ts +70 -0
- package/dist/tools/project-kit/generate.d.ts.map +1 -0
- package/dist/tools/project-kit/generate.js +455 -0
- package/dist/tools/project-kit/generate.js.map +1 -0
- package/dist/tools/project-kit/index.d.ts +18 -0
- package/dist/tools/project-kit/index.d.ts.map +1 -0
- package/dist/tools/project-kit/index.js +21 -0
- package/dist/tools/project-kit/index.js.map +1 -0
- package/dist/tools/project-kit/installation-types.d.ts +147 -0
- package/dist/tools/project-kit/installation-types.d.ts.map +1 -0
- package/dist/tools/project-kit/installation-types.js +491 -0
- package/dist/tools/project-kit/installation-types.js.map +1 -0
- package/dist/tools/project-kit/match-mcps.d.ts +67 -0
- package/dist/tools/project-kit/match-mcps.d.ts.map +1 -0
- package/dist/tools/project-kit/match-mcps.js +497 -0
- package/dist/tools/project-kit/match-mcps.js.map +1 -0
- package/dist/tools/project-kit/prepare-installation.d.ts +54 -0
- package/dist/tools/project-kit/prepare-installation.d.ts.map +1 -0
- package/dist/tools/project-kit/prepare-installation.js +382 -0
- package/dist/tools/project-kit/prepare-installation.js.map +1 -0
- package/dist/tools/project-kit/types.d.ts +200 -0
- package/dist/tools/project-kit/types.d.ts.map +1 -0
- package/dist/tools/project-kit/types.js +76 -0
- package/dist/tools/project-kit/types.js.map +1 -0
- package/dist/tools/recommend.d.ts.map +1 -1
- package/dist/tools/recommend.js +26 -10
- package/dist/tools/recommend.js.map +1 -1
- package/package.json +8 -3
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Compatibility Scoring
|
|
3
|
+
*
|
|
4
|
+
* Health score calculation based on conflicts, redundancies, and synergies.
|
|
5
|
+
*/
|
|
6
|
+
import type { CompatibilityReport, Grade, MatchedRule } from './types.js';
|
|
7
|
+
import type { CompatibilityRule } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Calculate the health score from matched rules.
|
|
10
|
+
*
|
|
11
|
+
* Formula:
|
|
12
|
+
* - Base: 100
|
|
13
|
+
* - -40 per conflict (critical)
|
|
14
|
+
* - -20 per conflict (warning)
|
|
15
|
+
* - -10 per redundant (warning)
|
|
16
|
+
* - -5 per redundant (info)
|
|
17
|
+
* - +5 per synergy (cap +15)
|
|
18
|
+
* - Clamp 0..100
|
|
19
|
+
*
|
|
20
|
+
* @param conflicts - Array of conflict rules
|
|
21
|
+
* @param redundancies - Array of redundancy rules
|
|
22
|
+
* @param synergies - Array of synergy rules
|
|
23
|
+
* @returns Score between 0 and 100
|
|
24
|
+
*/
|
|
25
|
+
export declare function calculateHealthScore(conflicts: MatchedRule[], redundancies: MatchedRule[], synergies: MatchedRule[]): number;
|
|
26
|
+
/**
|
|
27
|
+
* Get grade from score.
|
|
28
|
+
*
|
|
29
|
+
* - A: 90-100
|
|
30
|
+
* - B: 75-89
|
|
31
|
+
* - C: 55-74
|
|
32
|
+
* - D: < 55
|
|
33
|
+
*/
|
|
34
|
+
export declare function getGrade(score: number): Grade;
|
|
35
|
+
/**
|
|
36
|
+
* Generate a full compatibility report for a set of MCPs.
|
|
37
|
+
*
|
|
38
|
+
* @param mcps - Array of MCP IDs to analyze
|
|
39
|
+
* @param allRules - All compatibility rules (for suggestions)
|
|
40
|
+
* @returns Full compatibility report
|
|
41
|
+
*/
|
|
42
|
+
export declare function generateReport(mcps: string[], allRules: CompatibilityRule[]): CompatibilityReport;
|
|
43
|
+
/**
|
|
44
|
+
* Format a compatibility report as Markdown.
|
|
45
|
+
*
|
|
46
|
+
* @param report - The compatibility report to format
|
|
47
|
+
* @returns Markdown string
|
|
48
|
+
*/
|
|
49
|
+
export declare function formatReportAsMarkdown(report: CompatibilityReport): string;
|
|
50
|
+
/**
|
|
51
|
+
* Get a short summary line for the report.
|
|
52
|
+
*/
|
|
53
|
+
export declare function getReportSummaryLine(report: CompatibilityReport): string;
|
|
54
|
+
//# sourceMappingURL=scoring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoring.d.ts","sourceRoot":"","sources":["../../src/compatibility/scoring.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,mBAAmB,EAEnB,KAAK,EACL,WAAW,EAEZ,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AA0BpD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,WAAW,EAAE,EACxB,YAAY,EAAE,WAAW,EAAE,EAC3B,SAAS,EAAE,WAAW,EAAE,GACvB,MAAM,CA8BR;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAK7C;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EAAE,EACd,QAAQ,EAAE,iBAAiB,EAAE,GAC5B,mBAAmB,CAgCrB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CA8E1E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CASxE"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Compatibility Scoring
|
|
3
|
+
*
|
|
4
|
+
* Health score calculation based on conflicts, redundancies, and synergies.
|
|
5
|
+
*/
|
|
6
|
+
import { checkAllPairs, getSuggestions, canonicalizeMcpId } from './utils.js';
|
|
7
|
+
/**
|
|
8
|
+
* Scoring constants
|
|
9
|
+
*/
|
|
10
|
+
const SCORE_PENALTIES = {
|
|
11
|
+
conflict_critical: -40,
|
|
12
|
+
conflict_warning: -20,
|
|
13
|
+
redundant_warning: -10,
|
|
14
|
+
redundant_info: -5,
|
|
15
|
+
};
|
|
16
|
+
const SCORE_BONUSES = {
|
|
17
|
+
synergy: 5,
|
|
18
|
+
synergy_cap: 15,
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Grade thresholds
|
|
22
|
+
*/
|
|
23
|
+
const GRADE_THRESHOLDS = {
|
|
24
|
+
A: 90,
|
|
25
|
+
B: 75,
|
|
26
|
+
C: 55,
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Calculate the health score from matched rules.
|
|
30
|
+
*
|
|
31
|
+
* Formula:
|
|
32
|
+
* - Base: 100
|
|
33
|
+
* - -40 per conflict (critical)
|
|
34
|
+
* - -20 per conflict (warning)
|
|
35
|
+
* - -10 per redundant (warning)
|
|
36
|
+
* - -5 per redundant (info)
|
|
37
|
+
* - +5 per synergy (cap +15)
|
|
38
|
+
* - Clamp 0..100
|
|
39
|
+
*
|
|
40
|
+
* @param conflicts - Array of conflict rules
|
|
41
|
+
* @param redundancies - Array of redundancy rules
|
|
42
|
+
* @param synergies - Array of synergy rules
|
|
43
|
+
* @returns Score between 0 and 100
|
|
44
|
+
*/
|
|
45
|
+
export function calculateHealthScore(conflicts, redundancies, synergies) {
|
|
46
|
+
let score = 100;
|
|
47
|
+
// Apply conflict penalties
|
|
48
|
+
for (const matched of conflicts) {
|
|
49
|
+
if (matched.rule.severity === 'critical') {
|
|
50
|
+
score += SCORE_PENALTIES.conflict_critical;
|
|
51
|
+
}
|
|
52
|
+
else if (matched.rule.severity === 'warning') {
|
|
53
|
+
score += SCORE_PENALTIES.conflict_warning;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// Apply redundancy penalties
|
|
57
|
+
for (const matched of redundancies) {
|
|
58
|
+
if (matched.rule.severity === 'warning') {
|
|
59
|
+
score += SCORE_PENALTIES.redundant_warning;
|
|
60
|
+
}
|
|
61
|
+
else if (matched.rule.severity === 'info') {
|
|
62
|
+
score += SCORE_PENALTIES.redundant_info;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Apply synergy bonuses (capped)
|
|
66
|
+
const synergyBonus = Math.min(synergies.length * SCORE_BONUSES.synergy, SCORE_BONUSES.synergy_cap);
|
|
67
|
+
score += synergyBonus;
|
|
68
|
+
// Clamp to 0..100
|
|
69
|
+
return Math.max(0, Math.min(100, score));
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get grade from score.
|
|
73
|
+
*
|
|
74
|
+
* - A: 90-100
|
|
75
|
+
* - B: 75-89
|
|
76
|
+
* - C: 55-74
|
|
77
|
+
* - D: < 55
|
|
78
|
+
*/
|
|
79
|
+
export function getGrade(score) {
|
|
80
|
+
if (score >= GRADE_THRESHOLDS.A)
|
|
81
|
+
return 'A';
|
|
82
|
+
if (score >= GRADE_THRESHOLDS.B)
|
|
83
|
+
return 'B';
|
|
84
|
+
if (score >= GRADE_THRESHOLDS.C)
|
|
85
|
+
return 'C';
|
|
86
|
+
return 'D';
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Generate a full compatibility report for a set of MCPs.
|
|
90
|
+
*
|
|
91
|
+
* @param mcps - Array of MCP IDs to analyze
|
|
92
|
+
* @param allRules - All compatibility rules (for suggestions)
|
|
93
|
+
* @returns Full compatibility report
|
|
94
|
+
*/
|
|
95
|
+
export function generateReport(mcps, allRules) {
|
|
96
|
+
// Check all pairs
|
|
97
|
+
const { conflicts, redundancies, synergies } = checkAllPairs(mcps);
|
|
98
|
+
// Calculate score and grade
|
|
99
|
+
const score = calculateHealthScore(conflicts, redundancies, synergies);
|
|
100
|
+
const grade = getGrade(score);
|
|
101
|
+
// Get suggestions based on synergies
|
|
102
|
+
const suggestions = getSuggestions(mcps, allRules);
|
|
103
|
+
// Build summary
|
|
104
|
+
const summary = {
|
|
105
|
+
total: mcps.length,
|
|
106
|
+
conflicts: conflicts.length,
|
|
107
|
+
redundancies: redundancies.length,
|
|
108
|
+
synergies: synergies.length,
|
|
109
|
+
score,
|
|
110
|
+
grade,
|
|
111
|
+
};
|
|
112
|
+
// Get canonical IDs for analyzed MCPs
|
|
113
|
+
const analyzedMcps = [...new Set(mcps.map(canonicalizeMcpId))];
|
|
114
|
+
return {
|
|
115
|
+
summary,
|
|
116
|
+
conflicts,
|
|
117
|
+
redundancies,
|
|
118
|
+
synergies,
|
|
119
|
+
suggestions,
|
|
120
|
+
analyzedMcps,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Format a compatibility report as Markdown.
|
|
125
|
+
*
|
|
126
|
+
* @param report - The compatibility report to format
|
|
127
|
+
* @returns Markdown string
|
|
128
|
+
*/
|
|
129
|
+
export function formatReportAsMarkdown(report) {
|
|
130
|
+
const lines = [];
|
|
131
|
+
// Header
|
|
132
|
+
lines.push('## MCP Compatibility Report\n');
|
|
133
|
+
lines.push(`**Health Score: ${report.summary.score}/100 (Grade ${report.summary.grade})**\n`);
|
|
134
|
+
// Summary table
|
|
135
|
+
lines.push('### Summary');
|
|
136
|
+
lines.push('| Metric | Count |');
|
|
137
|
+
lines.push('|--------|-------|');
|
|
138
|
+
lines.push(`| MCPs Analyzed | ${report.summary.total} |`);
|
|
139
|
+
lines.push(`| 🔴 Conflicts | ${report.summary.conflicts} |`);
|
|
140
|
+
lines.push(`| 🟡 Redundancies | ${report.summary.redundancies} |`);
|
|
141
|
+
lines.push(`| 🟢 Synergies | ${report.summary.synergies} |`);
|
|
142
|
+
lines.push('');
|
|
143
|
+
// Conflicts
|
|
144
|
+
if (report.conflicts.length > 0) {
|
|
145
|
+
lines.push('### 🔴 Conflicts');
|
|
146
|
+
for (const matched of report.conflicts) {
|
|
147
|
+
const { rule, inputA, inputB } = matched;
|
|
148
|
+
lines.push(`\n**${inputA} ⚡ ${inputB}** (${rule.severity})`);
|
|
149
|
+
lines.push(`- Category: ${rule.category}`);
|
|
150
|
+
lines.push(`- Reason: ${rule.reason}`);
|
|
151
|
+
if (rule.solution) {
|
|
152
|
+
lines.push(`- Solution: ${rule.solution}`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
lines.push('');
|
|
156
|
+
}
|
|
157
|
+
// Redundancies
|
|
158
|
+
if (report.redundancies.length > 0) {
|
|
159
|
+
lines.push('### 🟡 Redundancies');
|
|
160
|
+
for (const matched of report.redundancies) {
|
|
161
|
+
const { rule, inputA, inputB } = matched;
|
|
162
|
+
lines.push(`\n**${inputA} ↔ ${inputB}** (${rule.severity})`);
|
|
163
|
+
lines.push(`- Category: ${rule.category}`);
|
|
164
|
+
lines.push(`- Reason: ${rule.reason}`);
|
|
165
|
+
if (rule.solution) {
|
|
166
|
+
lines.push(`- Solution: ${rule.solution}`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
lines.push('');
|
|
170
|
+
}
|
|
171
|
+
// Synergies
|
|
172
|
+
if (report.synergies.length > 0) {
|
|
173
|
+
lines.push('### 🟢 Synergies');
|
|
174
|
+
for (const matched of report.synergies) {
|
|
175
|
+
const { rule, inputA, inputB } = matched;
|
|
176
|
+
lines.push(`\n**${inputA} + ${inputB}**`);
|
|
177
|
+
lines.push(`- ${rule.reason}`);
|
|
178
|
+
}
|
|
179
|
+
lines.push('');
|
|
180
|
+
}
|
|
181
|
+
// Suggestions
|
|
182
|
+
if (report.suggestions.length > 0) {
|
|
183
|
+
lines.push('### 💡 Suggestions');
|
|
184
|
+
for (const suggestion of report.suggestions) {
|
|
185
|
+
lines.push(`- Consider adding \`${suggestion.mcp}\` - ${suggestion.reason} (pairs with ${suggestion.basedOn})`);
|
|
186
|
+
}
|
|
187
|
+
lines.push('');
|
|
188
|
+
}
|
|
189
|
+
// No issues
|
|
190
|
+
if (report.conflicts.length === 0 &&
|
|
191
|
+
report.redundancies.length === 0 &&
|
|
192
|
+
report.synergies.length === 0) {
|
|
193
|
+
lines.push('\n✅ No compatibility issues found between the analyzed MCPs.');
|
|
194
|
+
lines.push('');
|
|
195
|
+
}
|
|
196
|
+
return lines.join('\n');
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Get a short summary line for the report.
|
|
200
|
+
*/
|
|
201
|
+
export function getReportSummaryLine(report) {
|
|
202
|
+
const { summary } = report;
|
|
203
|
+
const issues = summary.conflicts + summary.redundancies;
|
|
204
|
+
if (issues === 0) {
|
|
205
|
+
return `✅ All ${summary.total} MCPs are compatible (Score: ${summary.score}/100)`;
|
|
206
|
+
}
|
|
207
|
+
return `⚠️ Found ${summary.conflicts} conflicts, ${summary.redundancies} redundancies among ${summary.total} MCPs (Score: ${summary.score}/100, Grade ${summary.grade})`;
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=scoring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoring.js","sourceRoot":"","sources":["../../src/compatibility/scoring.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG9E;;GAEG;AACH,MAAM,eAAe,GAAG;IACtB,iBAAiB,EAAE,CAAC,EAAE;IACtB,gBAAgB,EAAE,CAAC,EAAE;IACrB,iBAAiB,EAAE,CAAC,EAAE;IACtB,cAAc,EAAE,CAAC,CAAC;CACV,CAAC;AAEX,MAAM,aAAa,GAAG;IACpB,OAAO,EAAE,CAAC;IACV,WAAW,EAAE,EAAE;CACP,CAAC;AAEX;;GAEG;AACH,MAAM,gBAAgB,GAAG;IACvB,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;CACG,CAAC;AAEX;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,oBAAoB,CAClC,SAAwB,EACxB,YAA2B,EAC3B,SAAwB;IAExB,IAAI,KAAK,GAAG,GAAG,CAAC;IAEhB,2BAA2B;IAC3B,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE,CAAC;QAChC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC;YACzC,KAAK,IAAI,eAAe,CAAC,iBAAiB,CAAC;QAC7C,CAAC;aAAM,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC/C,KAAK,IAAI,eAAe,CAAC,gBAAgB,CAAC;QAC5C,CAAC;IACH,CAAC;IAED,6BAA6B;IAC7B,KAAK,MAAM,OAAO,IAAI,YAAY,EAAE,CAAC;QACnC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACxC,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,EAC7B,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;QAC3E,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAA2B;IAC9D,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAC3B,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC;IAExD,IAAI,MAAM,KAAK,CAAC,EAAE,CAAC;QACjB,OAAO,SAAS,OAAO,CAAC,KAAK,gCAAgC,OAAO,CAAC,KAAK,OAAO,CAAC;IACpF,CAAC;IAED,OAAO,YAAY,OAAO,CAAC,SAAS,eAAe,OAAO,CAAC,YAAY,uBAAuB,OAAO,CAAC,KAAK,iBAAiB,OAAO,CAAC,KAAK,eAAe,OAAO,CAAC,KAAK,GAAG,CAAC;AAC3K,CAAC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Compatibility Types
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for compatibility matrix types.
|
|
5
|
+
* Used by both the MCP server and web application.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* MCP category types - typed enum for validation
|
|
9
|
+
*/
|
|
10
|
+
export declare const MCP_CATEGORIES: readonly ["database", "orm", "auth", "payments", "deployment", "monitoring", "email", "storage", "ai", "version-control", "communication", "testing", "documentation", "general"];
|
|
11
|
+
export type MCPCategory = (typeof MCP_CATEGORIES)[number];
|
|
12
|
+
/**
|
|
13
|
+
* Compatibility status between two MCPs
|
|
14
|
+
*/
|
|
15
|
+
export type CompatibilityStatus = 'compatible' | 'conflict' | 'redundant' | 'synergy' | 'conditional';
|
|
16
|
+
/**
|
|
17
|
+
* Severity levels for compatibility issues
|
|
18
|
+
*/
|
|
19
|
+
export type Severity = 'critical' | 'warning' | 'info';
|
|
20
|
+
/**
|
|
21
|
+
* A single compatibility rule between two MCPs
|
|
22
|
+
*/
|
|
23
|
+
export interface CompatibilityRule {
|
|
24
|
+
/** Unique rule identifier (e.g., 'db-001', 'orm-002') */
|
|
25
|
+
id: string;
|
|
26
|
+
/**
|
|
27
|
+
* First MCP in the pair (canonical ID).
|
|
28
|
+
* Must be alphabetically less than mcpB after canonicalization.
|
|
29
|
+
*/
|
|
30
|
+
mcpA: string;
|
|
31
|
+
/**
|
|
32
|
+
* Second MCP in the pair (canonical ID).
|
|
33
|
+
* Must be alphabetically greater than mcpA after canonicalization.
|
|
34
|
+
*/
|
|
35
|
+
mcpB: string;
|
|
36
|
+
/** Compatibility status */
|
|
37
|
+
status: CompatibilityStatus;
|
|
38
|
+
/** Category this rule belongs to */
|
|
39
|
+
category: MCPCategory;
|
|
40
|
+
/** Severity of the issue (for conflicts/redundancies) */
|
|
41
|
+
severity: Severity;
|
|
42
|
+
/** Human-readable explanation */
|
|
43
|
+
reason: string;
|
|
44
|
+
/** Suggested solution for conflicts/redundancies */
|
|
45
|
+
solution?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Which MCP is recommended when there's a conflict/redundancy
|
|
48
|
+
* - 'A': Recommend mcpA
|
|
49
|
+
* - 'B': Recommend mcpB
|
|
50
|
+
* - 'either': Both are fine, pick one
|
|
51
|
+
* - 'both': Keep both (for synergies or conditional)
|
|
52
|
+
*/
|
|
53
|
+
recommendation?: 'A' | 'B' | 'either' | 'both';
|
|
54
|
+
/**
|
|
55
|
+
* For synergy rules: suggest these MCPs if the synergy partner is missing.
|
|
56
|
+
* E.g., if user has stripe-mcp, suggest resend-mcp
|
|
57
|
+
*/
|
|
58
|
+
suggestWhenMissing?: string[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A rule matched against user's MCPs
|
|
62
|
+
*/
|
|
63
|
+
export interface MatchedRule {
|
|
64
|
+
/** The compatibility rule that was matched */
|
|
65
|
+
rule: CompatibilityRule;
|
|
66
|
+
/** The actual MCP ID from user input (before canonicalization) */
|
|
67
|
+
inputA: string;
|
|
68
|
+
/** The actual MCP ID from user input (before canonicalization) */
|
|
69
|
+
inputB: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A suggestion based on synergy rules
|
|
73
|
+
*/
|
|
74
|
+
export interface Suggestion {
|
|
75
|
+
/** MCP to suggest */
|
|
76
|
+
mcp: string;
|
|
77
|
+
/** Why it's suggested */
|
|
78
|
+
reason: string;
|
|
79
|
+
/** Which installed MCP triggered this suggestion */
|
|
80
|
+
basedOn: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Grade based on health score
|
|
84
|
+
*/
|
|
85
|
+
export type Grade = 'A' | 'B' | 'C' | 'D';
|
|
86
|
+
/**
|
|
87
|
+
* Summary statistics for a compatibility report
|
|
88
|
+
*/
|
|
89
|
+
export interface CompatibilitySummary {
|
|
90
|
+
/** Total MCPs analyzed */
|
|
91
|
+
total: number;
|
|
92
|
+
/** Number of conflicts found */
|
|
93
|
+
conflicts: number;
|
|
94
|
+
/** Number of redundancies found */
|
|
95
|
+
redundancies: number;
|
|
96
|
+
/** Number of synergies found */
|
|
97
|
+
synergies: number;
|
|
98
|
+
/**
|
|
99
|
+
* Health score (0-100)
|
|
100
|
+
* Formula:
|
|
101
|
+
* - Base: 100
|
|
102
|
+
* - -40 per conflict (critical)
|
|
103
|
+
* - -20 per conflict (warning)
|
|
104
|
+
* - -10 per redundant (warning)
|
|
105
|
+
* - -5 per redundant (info)
|
|
106
|
+
* - +5 per synergy (cap +15)
|
|
107
|
+
* - Clamp 0..100
|
|
108
|
+
*/
|
|
109
|
+
score: number;
|
|
110
|
+
/**
|
|
111
|
+
* Grade based on score
|
|
112
|
+
* - A: 90-100
|
|
113
|
+
* - B: 75-89
|
|
114
|
+
* - C: 55-74
|
|
115
|
+
* - D: < 55
|
|
116
|
+
*/
|
|
117
|
+
grade: Grade;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Full compatibility report
|
|
121
|
+
*/
|
|
122
|
+
export interface CompatibilityReport {
|
|
123
|
+
/** Summary statistics */
|
|
124
|
+
summary: CompatibilitySummary;
|
|
125
|
+
/** All conflicts found */
|
|
126
|
+
conflicts: MatchedRule[];
|
|
127
|
+
/** All redundancies found */
|
|
128
|
+
redundancies: MatchedRule[];
|
|
129
|
+
/** All synergies found */
|
|
130
|
+
synergies: MatchedRule[];
|
|
131
|
+
/** Suggestions based on synergies */
|
|
132
|
+
suggestions: Suggestion[];
|
|
133
|
+
/** MCPs that were analyzed (canonical IDs) */
|
|
134
|
+
analyzedMcps: string[];
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Output format for MCP tool
|
|
138
|
+
*/
|
|
139
|
+
export interface CompatibilityToolOutput {
|
|
140
|
+
/** Markdown-formatted report for display */
|
|
141
|
+
text: string;
|
|
142
|
+
/** Structured data for programmatic use */
|
|
143
|
+
data: CompatibilityReport;
|
|
144
|
+
/** Whether an error occurred */
|
|
145
|
+
isError: boolean;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Conflict found between a recommendation and installed MCPs
|
|
149
|
+
*/
|
|
150
|
+
export interface RecommendationConflict {
|
|
151
|
+
/** The recommended MCP that conflicts */
|
|
152
|
+
recommended: string;
|
|
153
|
+
/** The installed MCP it conflicts with */
|
|
154
|
+
conflictsWith: string;
|
|
155
|
+
/** The rule that was matched */
|
|
156
|
+
rule: CompatibilityRule;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Excluded recommendation with reason
|
|
160
|
+
*/
|
|
161
|
+
export interface ExcludedRecommendation {
|
|
162
|
+
/** The MCP that was excluded */
|
|
163
|
+
mcp: string;
|
|
164
|
+
/** Why it was excluded */
|
|
165
|
+
excludedBecause: string;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Enhanced output for analyze_repo_mcps integration
|
|
169
|
+
*/
|
|
170
|
+
export interface AnalyzeRepoCompatibility {
|
|
171
|
+
/** Report for currently installed MCPs */
|
|
172
|
+
installedReport: CompatibilityReport;
|
|
173
|
+
/** Conflicts between recommendations and installed MCPs */
|
|
174
|
+
recommendationConflicts: RecommendationConflict[];
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/compatibility/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc,mLAejB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,YAAY,GACZ,UAAU,GACV,WAAW,GACX,SAAS,GACT,aAAa,CAAC;AAElB;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb,2BAA2B;IAC3B,MAAM,EAAE,mBAAmB,CAAC;IAE5B,oCAAoC;IACpC,QAAQ,EAAE,WAAW,CAAC;IAEtB,yDAAyD;IACzD,QAAQ,EAAE,QAAQ,CAAC;IAEnB,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IAEf,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,QAAQ,GAAG,MAAM,CAAC;IAE/C;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;GAE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mB,CAAC;IAE1B,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IAEpB,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAC;IAEtB,gCAAgC;IAChC,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,gCAAgC;IAChC,GAAG,EAAE,MAAM,CAAC;IAEZ,0BAA0B;IAC1B,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,0CAA0C;IAC1C,eAAe,EAAE,mBAAmB,CAAC;IAErC,2DAA2D;IAC3D,uBAAuB,EAAE,sBAAsB,EAAE,CAAC;CACnD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Compatibility Types
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for compatibility matrix types.
|
|
5
|
+
* Used by both the MCP server and web application.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* MCP category types - typed enum for validation
|
|
9
|
+
*/
|
|
10
|
+
export const MCP_CATEGORIES = [
|
|
11
|
+
'database',
|
|
12
|
+
'orm',
|
|
13
|
+
'auth',
|
|
14
|
+
'payments',
|
|
15
|
+
'deployment',
|
|
16
|
+
'monitoring',
|
|
17
|
+
'email',
|
|
18
|
+
'storage',
|
|
19
|
+
'ai',
|
|
20
|
+
'version-control',
|
|
21
|
+
'communication',
|
|
22
|
+
'testing',
|
|
23
|
+
'documentation',
|
|
24
|
+
'general',
|
|
25
|
+
];
|
|
26
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/compatibility/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,UAAU;IACV,KAAK;IACL,MAAM;IACN,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,OAAO;IACP,SAAS;IACT,IAAI;IACJ,iBAAiB;IACjB,eAAe;IACf,SAAS;IACT,eAAe;IACf,SAAS;CACD,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Compatibility Utilities
|
|
3
|
+
*
|
|
4
|
+
* Canonical matching utilities for consistent MCP identification.
|
|
5
|
+
*/
|
|
6
|
+
import type { CompatibilityRule, MatchedRule } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Aliases map for common MCP name variations.
|
|
9
|
+
* Keys are normalized (lowercase, trimmed), values are canonical IDs.
|
|
10
|
+
*/
|
|
11
|
+
export declare const MCP_ALIASES: Record<string, string>;
|
|
12
|
+
/**
|
|
13
|
+
* Canonicalize an MCP ID to a consistent format.
|
|
14
|
+
*
|
|
15
|
+
* @param id - The MCP ID to canonicalize (e.g., "supabase", "@supabase/mcp")
|
|
16
|
+
* @returns The canonical ID (e.g., "supabase-mcp")
|
|
17
|
+
*/
|
|
18
|
+
export declare function canonicalizeMcpId(id: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Generate a consistent pair key for two MCPs.
|
|
21
|
+
* The key is ordered alphabetically to ensure A/B and B/A produce the same key.
|
|
22
|
+
*
|
|
23
|
+
* @param a - First MCP ID
|
|
24
|
+
* @param b - Second MCP ID
|
|
25
|
+
* @returns Pair key in format "mcpA::mcpB" (alphabetically ordered)
|
|
26
|
+
*/
|
|
27
|
+
export declare function pairKey(a: string, b: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Initialize the rules index from an array of rules.
|
|
30
|
+
* Must be called before using findRule().
|
|
31
|
+
*
|
|
32
|
+
* @param rules - Array of compatibility rules
|
|
33
|
+
*/
|
|
34
|
+
export declare function initRulesIndex(rules: CompatibilityRule[]): void;
|
|
35
|
+
/**
|
|
36
|
+
* Get the rules index (for testing).
|
|
37
|
+
*/
|
|
38
|
+
export declare function getRulesIndex(): Map<string, CompatibilityRule>;
|
|
39
|
+
/**
|
|
40
|
+
* Find a compatibility rule for two MCPs.
|
|
41
|
+
* Order doesn't matter: findRule(A, B) === findRule(B, A)
|
|
42
|
+
*
|
|
43
|
+
* @param a - First MCP ID (can be any alias)
|
|
44
|
+
* @param b - Second MCP ID (can be any alias)
|
|
45
|
+
* @returns The matching rule, or undefined if no rule exists
|
|
46
|
+
*/
|
|
47
|
+
export declare function findRule(a: string, b: string): CompatibilityRule | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Generate all unique pairs from an array of MCPs.
|
|
50
|
+
* Used to check all nC2 combinations.
|
|
51
|
+
*
|
|
52
|
+
* @param mcps - Array of MCP IDs
|
|
53
|
+
* @returns Array of [mcpA, mcpB] pairs
|
|
54
|
+
*/
|
|
55
|
+
export declare function generatePairs(mcps: string[]): [string, string][];
|
|
56
|
+
/**
|
|
57
|
+
* Check all pairs of MCPs for compatibility issues.
|
|
58
|
+
*
|
|
59
|
+
* @param mcps - Array of MCP IDs to check
|
|
60
|
+
* @returns Object with categorized matched rules
|
|
61
|
+
*/
|
|
62
|
+
export declare function checkAllPairs(mcps: string[]): {
|
|
63
|
+
conflicts: MatchedRule[];
|
|
64
|
+
redundancies: MatchedRule[];
|
|
65
|
+
synergies: MatchedRule[];
|
|
66
|
+
conditionals: MatchedRule[];
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Get suggestions based on synergy rules.
|
|
70
|
+
* If user has MCP A and rule says A+B is a synergy,
|
|
71
|
+
* suggest B if user doesn't have it.
|
|
72
|
+
*
|
|
73
|
+
* @param mcps - Array of installed MCP IDs
|
|
74
|
+
* @param allRules - All compatibility rules
|
|
75
|
+
* @returns Array of suggestions
|
|
76
|
+
*/
|
|
77
|
+
export declare function getSuggestions(mcps: string[], allRules: CompatibilityRule[]): {
|
|
78
|
+
mcp: string;
|
|
79
|
+
reason: string;
|
|
80
|
+
basedOn: string;
|
|
81
|
+
}[];
|
|
82
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/compatibility/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAsG9C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAKpD;AAQD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAM/D;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAE9D;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAG5E;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAQhE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAC7C,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B,CAoCA;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,M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