zephyr-scale-mcp-server 0.4.5 → 0.4.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.
@@ -12,8 +12,18 @@ export class ZephyrToolHandlers {
12
12
  const { test_case_key } = args;
13
13
  try {
14
14
  const response = await this.axiosInstance.get(`${this.jiraConfig.apiEndpoints.testcase}/${test_case_key}`);
15
+ const testCase = response.data;
16
+ // Fetch the test script content and embed it inline.
17
+ // The base GET /testcases/{key} only returns a link to the script, not the content.
18
+ try {
19
+ const scriptResponse = await this.axiosInstance.get(`${this.jiraConfig.apiEndpoints.testcase}/${test_case_key}/testscript`);
20
+ testCase.testScript = scriptResponse.data;
21
+ }
22
+ catch {
23
+ // Script fetch failed (e.g. no script yet) — leave testScript as the link object
24
+ }
15
25
  return {
16
- content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }],
26
+ content: [{ type: 'text', text: JSON.stringify(testCase, null, 2) }],
17
27
  };
18
28
  }
19
29
  catch (error) {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "zephyr-scale-mcp-server",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "Model Context Protocol (MCP) server for Zephyr Scale test case management with comprehensive STEP_BY_STEP, PLAIN_TEXT, and BDD support",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",
7
7
  "bin": {
8
- "zephyr-scale-mcp": "./build/index.js"
8
+ "zephyr-scale-mcp": "build/index.js"
9
9
  },
10
10
  "files": [
11
11
  "build/",
@@ -24,8 +24,21 @@ export class ZephyrToolHandlers {
24
24
  const { test_case_key } = args;
25
25
  try {
26
26
  const response = await this.axiosInstance.get(`${this.jiraConfig.apiEndpoints.testcase}/${test_case_key}`);
27
+ const testCase = response.data;
28
+
29
+ // Fetch the test script content and embed it inline.
30
+ // The base GET /testcases/{key} only returns a link to the script, not the content.
31
+ try {
32
+ const scriptResponse = await this.axiosInstance.get(
33
+ `${this.jiraConfig.apiEndpoints.testcase}/${test_case_key}/testscript`
34
+ );
35
+ testCase.testScript = scriptResponse.data;
36
+ } catch {
37
+ // Script fetch failed (e.g. no script yet) — leave testScript as the link object
38
+ }
39
+
27
40
  return {
28
- content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }],
41
+ content: [{ type: 'text', text: JSON.stringify(testCase, null, 2) }],
29
42
  };
30
43
  } catch (error) {
31
44
  throw new McpError(ErrorCode.InternalError, `Failed to get test case: ${this.formatError(error)}`);