@testledger/mcp 0.0.4 → 0.0.6
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 +72 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
// Test Results MCP Server
|
|
5
6
|
// Configuration from environment
|
|
6
7
|
const API_BASE_URL = process.env.TEST_LEDGER_API_URL;
|
|
7
8
|
const API_KEY = process.env.TEST_LEDGER_API_KEY || "";
|
|
@@ -163,6 +164,39 @@ const tools = [
|
|
|
163
164
|
},
|
|
164
165
|
},
|
|
165
166
|
},
|
|
167
|
+
{
|
|
168
|
+
name: "get_flaky_specs",
|
|
169
|
+
description: "Get flaky specs from pre-computed materialized view. Faster than get_flaky_tests as it uses cached data refreshed hourly. Returns spec-level flakiness (not individual test level).",
|
|
170
|
+
inputSchema: {
|
|
171
|
+
type: "object",
|
|
172
|
+
properties: {
|
|
173
|
+
project_id: {
|
|
174
|
+
type: "number",
|
|
175
|
+
description: "Project ID to filter by (optional)",
|
|
176
|
+
},
|
|
177
|
+
min_flaky_count: {
|
|
178
|
+
type: "number",
|
|
179
|
+
description: "Minimum number of flaky occurrences (default: 1)",
|
|
180
|
+
default: 1,
|
|
181
|
+
},
|
|
182
|
+
min_flaky_percent: {
|
|
183
|
+
type: "number",
|
|
184
|
+
description: "Minimum flaky percentage to include (default: 10)",
|
|
185
|
+
default: 10,
|
|
186
|
+
},
|
|
187
|
+
min_total_runs: {
|
|
188
|
+
type: "number",
|
|
189
|
+
description: "Minimum total runs for statistical significance (default: 1)",
|
|
190
|
+
default: 1,
|
|
191
|
+
},
|
|
192
|
+
limit: {
|
|
193
|
+
type: "number",
|
|
194
|
+
description: "Maximum results to return (default: 50)",
|
|
195
|
+
default: 50,
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
},
|
|
166
200
|
{
|
|
167
201
|
name: "get_recent_failures",
|
|
168
202
|
description: "Get the most recent test failures for quick triage. Useful for seeing what's currently broken. For faster results, provide a spec_file filter.",
|
|
@@ -223,6 +257,38 @@ const tools = [
|
|
|
223
257
|
required: ["spec_file"],
|
|
224
258
|
},
|
|
225
259
|
},
|
|
260
|
+
{
|
|
261
|
+
name: "get_failure_screenshots",
|
|
262
|
+
description: "Get screenshots from recent test failures. Returns presigned S3 URLs that can be viewed with the Read tool to see exactly what the UI looked like when the test failed.",
|
|
263
|
+
inputSchema: {
|
|
264
|
+
type: "object",
|
|
265
|
+
properties: {
|
|
266
|
+
spec_file: {
|
|
267
|
+
type: "string",
|
|
268
|
+
description: "The spec file path (e.g., 'login.spec.js')",
|
|
269
|
+
},
|
|
270
|
+
test_title: {
|
|
271
|
+
type: "string",
|
|
272
|
+
description: "Specific test title to filter by (optional)",
|
|
273
|
+
},
|
|
274
|
+
project_id: {
|
|
275
|
+
type: "number",
|
|
276
|
+
description: "Project ID to filter by (optional)",
|
|
277
|
+
},
|
|
278
|
+
days: {
|
|
279
|
+
type: "number",
|
|
280
|
+
description: "Days to look back (default: 7)",
|
|
281
|
+
default: 7,
|
|
282
|
+
},
|
|
283
|
+
limit: {
|
|
284
|
+
type: "number",
|
|
285
|
+
description: "Maximum screenshots to return (default: 10)",
|
|
286
|
+
default: 10,
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
required: ["spec_file"],
|
|
290
|
+
},
|
|
291
|
+
},
|
|
226
292
|
];
|
|
227
293
|
// Create the server
|
|
228
294
|
const server = new Server({
|
|
@@ -255,12 +321,18 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
255
321
|
case "get_flaky_tests":
|
|
256
322
|
result = await apiCall("/tests/flaky", args);
|
|
257
323
|
break;
|
|
324
|
+
case "get_flaky_specs":
|
|
325
|
+
result = await apiCall("/tests/flaky-specs", args);
|
|
326
|
+
break;
|
|
258
327
|
case "get_recent_failures":
|
|
259
328
|
result = await apiCall("/tests/recent-failures", args);
|
|
260
329
|
break;
|
|
261
330
|
case "get_test_trend":
|
|
262
331
|
result = await apiCall("/tests/trend", args);
|
|
263
332
|
break;
|
|
333
|
+
case "get_failure_screenshots":
|
|
334
|
+
result = await apiCall("/tests/failure-screenshots", args);
|
|
335
|
+
break;
|
|
264
336
|
default:
|
|
265
337
|
throw new Error(`Unknown tool: ${name}`);
|
|
266
338
|
}
|