viewgate-mcp 1.0.21 → 1.0.22
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 +3 -2
- package/package.json +1 -1
- package/dist/test_fix.js +0 -59
- package/dist/test_sse.js +0 -23
package/dist/index.js
CHANGED
|
@@ -52,7 +52,8 @@ function createMcpServer(apiKey, personalKey) {
|
|
|
52
52
|
inputSchema: {
|
|
53
53
|
type: "object",
|
|
54
54
|
properties: {
|
|
55
|
-
limit: { type: "number", description: "Maximum number of annotations to retrieve (default: 3)", default: 3 }
|
|
55
|
+
limit: { type: "number", description: "Maximum number of annotations to retrieve (default: 3)", default: 3 },
|
|
56
|
+
status: { type: "string", description: "Comma-separated list of statuses to fetch (default: 'pending,bug_fixing')", default: "pending,bug_fixing" }
|
|
56
57
|
},
|
|
57
58
|
},
|
|
58
59
|
},
|
|
@@ -174,7 +175,7 @@ function createMcpServer(apiKey, personalKey) {
|
|
|
174
175
|
try {
|
|
175
176
|
const args = request.params.arguments;
|
|
176
177
|
const limit = args.limit || 3;
|
|
177
|
-
const statuses = 'pending,bug_fixing';
|
|
178
|
+
const statuses = args.status || 'pending,bug_fixing';
|
|
178
179
|
const response = await fetch(`${BACKEND_URL}/api/mcp/annotations?status=${statuses}&limit=${limit}&lock=true`, {
|
|
179
180
|
headers: {
|
|
180
181
|
'x-api-key': apiKey,
|
package/package.json
CHANGED
package/dist/test_fix.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import fetch from "node-fetch";
|
|
2
|
-
async function test() {
|
|
3
|
-
console.log("1. Connecting to http://localhost:3333/sse...");
|
|
4
|
-
const response = await fetch("http://localhost:3333/sse?apiKey=2af5628c9442f10b93cfe6970897d4de26578d958ba43a4e3bcb684fe0f92668");
|
|
5
|
-
if (!response.ok) {
|
|
6
|
-
console.error("Failed to connect to SSE:", response.status, await response.text());
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
console.log("SSE connected. Reading stream for sessionId...");
|
|
10
|
-
const body = response.body;
|
|
11
|
-
let sessionId = null;
|
|
12
|
-
body.on("data", async (chunk) => {
|
|
13
|
-
const text = chunk.toString();
|
|
14
|
-
console.log("SSE Data:", text);
|
|
15
|
-
// Example event:
|
|
16
|
-
// event: endpoint
|
|
17
|
-
// data: /message?sessionId=...
|
|
18
|
-
const match = text.match(/sessionId=([a-f0-9-]+)/);
|
|
19
|
-
if (match && !sessionId) {
|
|
20
|
-
sessionId = match[1];
|
|
21
|
-
console.log("FOUND SESSION ID:", sessionId);
|
|
22
|
-
// 2. Test POST to /message
|
|
23
|
-
console.log(`2. Testing POST to /message?sessionId=${sessionId}...`);
|
|
24
|
-
const postResponse = await fetch(`http://localhost:3333/message?sessionId=${sessionId}`, {
|
|
25
|
-
method: 'POST',
|
|
26
|
-
headers: {
|
|
27
|
-
'Content-Type': 'application/json'
|
|
28
|
-
},
|
|
29
|
-
body: JSON.stringify({
|
|
30
|
-
jsonrpc: "2.0",
|
|
31
|
-
id: 1,
|
|
32
|
-
method: "initialize",
|
|
33
|
-
params: {
|
|
34
|
-
clientInfo: { name: "test-client", version: "1.0.0" },
|
|
35
|
-
protocolVersion: "2024-11-05",
|
|
36
|
-
capabilities: {}
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
});
|
|
40
|
-
console.log("POST Response Status:", postResponse.status);
|
|
41
|
-
const responseText = await postResponse.text();
|
|
42
|
-
console.log("POST Response Body:", responseText);
|
|
43
|
-
if (postResponse.status === 200 || postResponse.status === 202) {
|
|
44
|
-
console.log("SUCCESS: Stream was readable and message was accepted.");
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
console.error("FAILURE: Server returned error status.");
|
|
48
|
-
}
|
|
49
|
-
process.exit(0);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
setTimeout(() => {
|
|
53
|
-
if (!sessionId) {
|
|
54
|
-
console.error("TIMEOUT: Did not receive sessionId from SSE.");
|
|
55
|
-
process.exit(1);
|
|
56
|
-
}
|
|
57
|
-
}, 10000);
|
|
58
|
-
}
|
|
59
|
-
test();
|
package/dist/test_sse.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import fetch from "node-fetch";
|
|
2
|
-
async function test() {
|
|
3
|
-
console.log("Connecting to http://localhost:3333/sse...");
|
|
4
|
-
const response = await fetch("http://localhost:3333/sse?apiKey=test-key");
|
|
5
|
-
if (!response.ok) {
|
|
6
|
-
console.error("Failed to connect:", response.status, await response.text());
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
console.log("Headers:", response.headers.raw());
|
|
10
|
-
const body = response.body;
|
|
11
|
-
body.on("data", (chunk) => {
|
|
12
|
-
console.log("Chunk received:", chunk.toString());
|
|
13
|
-
if (chunk.toString().includes("event: endpoint")) {
|
|
14
|
-
console.log("FOUND ENDPOINT EVENT!");
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
body.on("end", () => console.log("Connection closed"));
|
|
18
|
-
setTimeout(() => {
|
|
19
|
-
console.log("Closing test...");
|
|
20
|
-
process.exit(0);
|
|
21
|
-
}, 5000);
|
|
22
|
-
}
|
|
23
|
-
test();
|