viewgate-mcp 1.0.23 → 1.0.24
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/dist/index.js +11 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -180,17 +180,17 @@ function createMcpServer(apiKey, personalKey) {
|
|
|
180
180
|
const statuses = args.status || 'pending,bug_fixing';
|
|
181
181
|
const search = args.search || '';
|
|
182
182
|
const key = args.key || '';
|
|
183
|
-
|
|
183
|
+
let fetchUrl = `${BACKEND_URL}/api/mcp/annotations?lock=true`;
|
|
184
184
|
if (statuses && statuses !== 'all')
|
|
185
|
-
|
|
185
|
+
fetchUrl += `&status=${statuses}`;
|
|
186
186
|
if (limit)
|
|
187
|
-
|
|
187
|
+
fetchUrl += `&limit=${limit}`;
|
|
188
188
|
if (search)
|
|
189
|
-
|
|
189
|
+
fetchUrl += `&search=${encodeURIComponent(search)}`;
|
|
190
190
|
if (key)
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
const response = await fetch(
|
|
191
|
+
fetchUrl += `&key=${encodeURIComponent(key)}`;
|
|
192
|
+
console.error(`[MCP] Fetching annotations from: ${fetchUrl}`);
|
|
193
|
+
const response = await fetch(fetchUrl, {
|
|
194
194
|
headers: {
|
|
195
195
|
'x-api-key': apiKey,
|
|
196
196
|
...(personalKey ? { 'x-personal-key': personalKey } : {})
|
|
@@ -368,12 +368,13 @@ Instruction: ${ann.message}${pendingCorrection ? `\nCorrection Needed: ${pending
|
|
|
368
368
|
throw new Error(`Backend responded with ${response.status}`);
|
|
369
369
|
}
|
|
370
370
|
const data = (await response.json());
|
|
371
|
+
const backlogNodes = Array.isArray(data) ? data : (data.data || data.backlog || []);
|
|
371
372
|
return {
|
|
372
373
|
content: [{
|
|
373
374
|
type: "text",
|
|
374
375
|
text: JSON.stringify({
|
|
375
376
|
preferredLanguage: data.preferredLanguage || 'en',
|
|
376
|
-
backlog:
|
|
377
|
+
backlog: backlogNodes
|
|
377
378
|
}, null, 2)
|
|
378
379
|
}]
|
|
379
380
|
};
|
|
@@ -451,10 +452,11 @@ Instruction: ${ann.message}${pendingCorrection ? `\nCorrection Needed: ${pending
|
|
|
451
452
|
throw new Error(`Backend responded with ${response.status}`);
|
|
452
453
|
}
|
|
453
454
|
const data = (await response.json());
|
|
455
|
+
const endpointsList = Array.isArray(data) ? data : (data.endpoints || data.routes || data.data || []);
|
|
454
456
|
return {
|
|
455
457
|
content: [{
|
|
456
458
|
type: "text",
|
|
457
|
-
text: JSON.stringify(
|
|
459
|
+
text: JSON.stringify(endpointsList, null, 2)
|
|
458
460
|
}]
|
|
459
461
|
};
|
|
460
462
|
}
|