zephyr-scale-mcp-server 0.8.1 → 0.9.0

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/build/index.js CHANGED
@@ -3,10 +3,16 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
3
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
4
  import { CallToolRequestSchema, ErrorCode, ListResourcesRequestSchema, ListToolsRequestSchema, McpError, ReadResourceRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
5
5
  import axios from 'axios';
6
+ import { readFileSync } from 'node:fs';
7
+ import { fileURLToPath } from 'node:url';
8
+ import { dirname, join } from 'node:path';
6
9
  import { toolSchemas } from './tool-schemas.js';
7
10
  import { ZephyrToolHandlers } from './tool-handlers.js';
8
11
  import { resourceList, readResource, setAxiosInstance } from './resources.js';
9
12
  import { createJiraConfig } from './utils.js';
13
+ // Read version from package.json (../ relative to build/index.js at runtime) so
14
+ // it always matches the published package rather than drifting on each release.
15
+ const pkg = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json'), 'utf8'));
10
16
  class ZephyrServer {
11
17
  server;
12
18
  toolHandlers;
@@ -14,7 +20,7 @@ class ZephyrServer {
14
20
  const jiraConfig = createJiraConfig();
15
21
  this.server = new Server({
16
22
  name: 'zephyr-server',
17
- version: '0.3.1',
23
+ version: pkg.version,
18
24
  }, {
19
25
  capabilities: {
20
26
  tools: {},
@@ -577,3 +577,38 @@ export const toolSchemas = [
577
577
  },
578
578
  },
579
579
  ];
580
+ // MCP tool annotations (behavioral hints, protocol revision 2025-03-26+).
581
+ // Advisory only — clients use them for UX and safety, e.g. auto-approving
582
+ // read-only calls or confirming before a destructive delete. Every tool talks
583
+ // to the remote Zephyr/Jira API, so openWorldHint is true across the board.
584
+ const READ_ONLY = { readOnlyHint: true, openWorldHint: true };
585
+ const WRITE = { readOnlyHint: false, destructiveHint: false, openWorldHint: true };
586
+ const DESTRUCTIVE = { readOnlyHint: false, destructiveHint: true, openWorldHint: true };
587
+ const TOOL_ANNOTATIONS = {
588
+ // Reads
589
+ get_test_case: READ_ONLY,
590
+ get_folders: READ_ONLY,
591
+ get_test_run_cases: READ_ONLY,
592
+ get_test_run: READ_ONLY,
593
+ get_test_execution: READ_ONLY,
594
+ search_test_cases_by_folder: READ_ONLY,
595
+ search_test_runs: READ_ONLY,
596
+ list_executions_by_cycle: READ_ONLY,
597
+ get_test_cycles_for_issue: READ_ONLY,
598
+ // Non-destructive writes (create / update / append)
599
+ create_test_case: WRITE,
600
+ update_test_case_bdd: WRITE,
601
+ create_folder: WRITE,
602
+ create_test_run: WRITE,
603
+ update_test_run: WRITE,
604
+ add_test_cases_to_run: WRITE,
605
+ update_test_execution: WRITE,
606
+ // Destructive
607
+ delete_test_case: DESTRUCTIVE,
608
+ delete_test_run: DESTRUCTIVE,
609
+ };
610
+ for (const tool of toolSchemas) {
611
+ const annotations = TOOL_ANNOTATIONS[tool.name];
612
+ if (annotations)
613
+ tool.annotations = annotations;
614
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zephyr-scale-mcp-server",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
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",
@@ -53,10 +53,10 @@
53
53
  },
54
54
  "homepage": "https://github.com/Milo0821/Zephyr_mcp_server#readme",
55
55
  "engines": {
56
- "node": ">=16.0.0"
56
+ "node": ">=18.0.0"
57
57
  },
58
58
  "dependencies": {
59
- "@modelcontextprotocol/sdk": "0.6.0",
59
+ "@modelcontextprotocol/sdk": "^1.30.0",
60
60
  "axios": "^1.15.0"
61
61
  },
62
62
  "devDependencies": {
package/src/index.ts CHANGED
@@ -10,11 +10,20 @@ import {
10
10
  ReadResourceRequestSchema,
11
11
  } from '@modelcontextprotocol/sdk/types.js';
12
12
  import axios from 'axios';
13
+ import { readFileSync } from 'node:fs';
14
+ import { fileURLToPath } from 'node:url';
15
+ import { dirname, join } from 'node:path';
13
16
  import { toolSchemas } from './tool-schemas.js';
14
17
  import { ZephyrToolHandlers } from './tool-handlers.js';
15
18
  import { resourceList, readResource, setAxiosInstance } from './resources.js';
16
19
  import { createJiraConfig } from './utils.js';
17
20
 
21
+ // Read version from package.json (../ relative to build/index.js at runtime) so
22
+ // it always matches the published package rather than drifting on each release.
23
+ const pkg = JSON.parse(
24
+ readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json'), 'utf8')
25
+ );
26
+
18
27
  class ZephyrServer {
19
28
  private server: Server;
20
29
  private toolHandlers: ZephyrToolHandlers;
@@ -25,7 +34,7 @@ class ZephyrServer {
25
34
  this.server = new Server(
26
35
  {
27
36
  name: 'zephyr-server',
28
- version: '0.3.1',
37
+ version: pkg.version,
29
38
  },
30
39
  {
31
40
  capabilities: {
@@ -576,4 +576,41 @@ export const toolSchemas = [
576
576
  required: ['test_run_key', 'test_case_keys'],
577
577
  },
578
578
  },
579
- ];
579
+ ];
580
+
581
+ // MCP tool annotations (behavioral hints, protocol revision 2025-03-26+).
582
+ // Advisory only — clients use them for UX and safety, e.g. auto-approving
583
+ // read-only calls or confirming before a destructive delete. Every tool talks
584
+ // to the remote Zephyr/Jira API, so openWorldHint is true across the board.
585
+ const READ_ONLY = { readOnlyHint: true, openWorldHint: true };
586
+ const WRITE = { readOnlyHint: false, destructiveHint: false, openWorldHint: true };
587
+ const DESTRUCTIVE = { readOnlyHint: false, destructiveHint: true, openWorldHint: true };
588
+
589
+ const TOOL_ANNOTATIONS: Record<string, Record<string, boolean>> = {
590
+ // Reads
591
+ get_test_case: READ_ONLY,
592
+ get_folders: READ_ONLY,
593
+ get_test_run_cases: READ_ONLY,
594
+ get_test_run: READ_ONLY,
595
+ get_test_execution: READ_ONLY,
596
+ search_test_cases_by_folder: READ_ONLY,
597
+ search_test_runs: READ_ONLY,
598
+ list_executions_by_cycle: READ_ONLY,
599
+ get_test_cycles_for_issue: READ_ONLY,
600
+ // Non-destructive writes (create / update / append)
601
+ create_test_case: WRITE,
602
+ update_test_case_bdd: WRITE,
603
+ create_folder: WRITE,
604
+ create_test_run: WRITE,
605
+ update_test_run: WRITE,
606
+ add_test_cases_to_run: WRITE,
607
+ update_test_execution: WRITE,
608
+ // Destructive
609
+ delete_test_case: DESTRUCTIVE,
610
+ delete_test_run: DESTRUCTIVE,
611
+ };
612
+
613
+ for (const tool of toolSchemas) {
614
+ const annotations = TOOL_ANNOTATIONS[tool.name];
615
+ if (annotations) (tool as { annotations?: unknown }).annotations = annotations;
616
+ }