mcp-sentinel-qa 2.0.0 → 2.0.2
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/CHANGELOG.md +35 -0
- package/README.md +40 -13
- package/dist/lib/tool-result.d.ts +19 -0
- package/dist/lib/tool-result.js +18 -0
- package/dist/package.json +3 -3
- package/dist/server.js +2 -0
- package/dist/tools/functionalities.d.ts +2 -0
- package/dist/tools/functionalities.js +60 -0
- package/dist/tools/functionality-schemas.d.ts +43 -0
- package/dist/tools/functionality-schemas.js +82 -0
- package/dist/tools/test-cases.js +1 -55
- package/package.json +46 -52
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.0.2 — 2026-10-29
|
|
4
|
+
|
|
5
|
+
### Multi-level functionality hierarchy
|
|
6
|
+
|
|
7
|
+
- Update tool schemas and guidance to support functionality trees at any depth.
|
|
8
|
+
- Allow any same-project functionality as a parent; Sentinel validates scope and
|
|
9
|
+
prevents self-parenting and cycles.
|
|
10
|
+
- Clarify that moving a node keeps its descendant subtree and test cases attached,
|
|
11
|
+
while deleting a node promotes direct children and preserves deeper descendants.
|
|
12
|
+
- Describe the paginated list as flat rows linked by `parent_id`.
|
|
13
|
+
|
|
14
|
+
Version 2.0.2 aligns the MCP guidance with the multi-level hierarchy deployed in
|
|
15
|
+
Sentinel production. It preserves the thirteen tool names and argument shapes.
|
|
16
|
+
|
|
17
|
+
## 2.0.1 — 2026-10-29
|
|
18
|
+
|
|
19
|
+
### Functionality management
|
|
20
|
+
|
|
21
|
+
- Prepare detail, partial update, delete, hierarchy move and test-case transfer
|
|
22
|
+
tools, bringing the source implementation to thirteen tools. Extend existing
|
|
23
|
+
functionality listing with pagination and parent details, and persist the
|
|
24
|
+
parent when creating a functionality.
|
|
25
|
+
- Support root/child hierarchy only, with same-project parents and validation
|
|
26
|
+
against cycles, self-parenting and moving a node with children under a parent.
|
|
27
|
+
- Preserve test cases on functionality deletion: unlink them or transfer them to
|
|
28
|
+
an active target in the same project. Promote direct children to roots rather
|
|
29
|
+
than cascading deletion.
|
|
30
|
+
- Transfer 1–100 unique test cases atomically to an active functionality in the
|
|
31
|
+
same project, enforcing current permissions, workspace and API-key project
|
|
32
|
+
restrictions.
|
|
33
|
+
|
|
34
|
+
These tools use the Sentinel functionality endpoints deployed to production.
|
|
35
|
+
Version 2.0.1 includes the five new tools and the updated functionality listing
|
|
36
|
+
and creation behavior.
|
|
37
|
+
|
|
3
38
|
## 2.0.0 — 2026-10-28
|
|
4
39
|
|
|
5
40
|
### Breaking change
|
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ Add the following server entry to your MCP client's configuration:
|
|
|
27
27
|
"mcpServers": {
|
|
28
28
|
"sentinel": {
|
|
29
29
|
"command": "pnpm",
|
|
30
|
-
"args": ["dlx", "mcp-sentinel-qa@2.0.
|
|
30
|
+
"args": ["dlx", "mcp-sentinel-qa@2.0.2"],
|
|
31
31
|
"env": {
|
|
32
32
|
"SENTINEL_API_KEY": "YOUR_SENTINEL_API_KEY"
|
|
33
33
|
}
|
|
@@ -43,29 +43,54 @@ secret storage or environment-variable references, use those instead.
|
|
|
43
43
|
For a manual launch, provide the key through your environment and run:
|
|
44
44
|
|
|
45
45
|
```sh
|
|
46
|
-
pnpm dlx mcp-sentinel-qa@2.0.
|
|
46
|
+
pnpm dlx mcp-sentinel-qa@2.0.2
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
The process waits for MCP messages on stdin; it is not an interactive terminal UI
|
|
50
50
|
or an HTTP server. The API endpoint is currently fixed to
|
|
51
51
|
`https://sentinel-qa.vercel.app`; `SENTINEL_API_URL` is not supported.
|
|
52
52
|
|
|
53
|
-
##
|
|
53
|
+
## Tools in 2.0.2
|
|
54
|
+
|
|
55
|
+
The package provides thirteen tools:
|
|
54
56
|
|
|
55
57
|
| Tool | Purpose |
|
|
56
58
|
| --- | --- |
|
|
57
59
|
| `sentinel_list_projects` | List projects available to the API key. Start here to obtain project IDs. |
|
|
58
|
-
| `sentinel_list_functionalities` | List
|
|
59
|
-
| `sentinel_create_functionality` | Create a functionality
|
|
60
|
+
| `sentinel_list_functionalities` | List flat, paginated functionality records with each node's immediate parent. |
|
|
61
|
+
| `sentinel_create_functionality` | Create a root or nested functionality at any depth. |
|
|
62
|
+
| `sentinel_get_functionality` | Retrieve a functionality's details, project and parent. |
|
|
63
|
+
| `sentinel_update_functionality` | Partially edit its name, description, color, status or parent. |
|
|
64
|
+
| `sentinel_move_functionality` | Move a functionality branch under any same-project node or promote it to a root. |
|
|
65
|
+
| `sentinel_delete_functionality` | Delete a functionality while preserving cases and descendant hierarchy. |
|
|
66
|
+
| `sentinel_move_functionality_test_cases` | Atomically transfer selected test cases to another functionality. |
|
|
60
67
|
| `sentinel_list_test_cases` | Search and paginate test cases, with project, functionality, priority, status and type filters. |
|
|
61
68
|
| `sentinel_get_test_case` | Retrieve a test case by UUID. |
|
|
62
69
|
| `sentinel_create_test_case` | Create a test case with Gherkin, priority, platforms and automation details. |
|
|
63
70
|
| `sentinel_update_test_case` | Update only the fields supplied for an existing test case. |
|
|
64
71
|
| `sentinel_delete_test_case` | Permanently delete a test case by UUID. |
|
|
65
72
|
|
|
66
|
-
Tool
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
Tool schemas expose required fields and allowed values. Test-case lists support
|
|
74
|
+
`page` and `page_size` (maximum 100); functionality lists use the same pagination
|
|
75
|
+
with a default page size of 20.
|
|
76
|
+
|
|
77
|
+
Functionalities can be nested at any depth. `parent_id` identifies the immediate
|
|
78
|
+
parent, which may be any functionality in the same project; an omitted or null
|
|
79
|
+
parent creates or promotes a root. The paginated list is flat, so follow every
|
|
80
|
+
page to reconstruct the full hierarchy. Sentinel validates project scope and
|
|
81
|
+
rejects self-parenting or cycles, including moves under a node's own descendant.
|
|
82
|
+
Moving a functionality changes its parent while its descendants and test cases
|
|
83
|
+
stay attached. Moving test cases is a separate operation that changes their
|
|
84
|
+
assignment. Deleting a functionality unlinks its cases by default or transfers
|
|
85
|
+
them to an active target when `target_id` is provided. Direct children become
|
|
86
|
+
roots; deeper descendants remain attached to those children.
|
|
87
|
+
|
|
88
|
+
Reading functionalities requires `features.view`; creation requires
|
|
89
|
+
`features.create`; edits and hierarchy changes require `features.edit`. Case
|
|
90
|
+
transfers require `features.edit` and `test_cases.edit`. Deletion requires
|
|
91
|
+
`features.delete` and `test_cases.edit`; transferring cases during deletion also
|
|
92
|
+
requires `features.edit` on the destination. Workspace and API-key project
|
|
93
|
+
restrictions apply to every operation.
|
|
69
94
|
|
|
70
95
|
## Access and authentication
|
|
71
96
|
|
|
@@ -91,11 +116,13 @@ replace it in your client configuration.
|
|
|
91
116
|
|
|
92
117
|
## Upgrade from 1.x
|
|
93
118
|
|
|
94
|
-
Version 2.0.0
|
|
95
|
-
supported.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
`mcp-sentinel-qa`
|
|
119
|
+
Version 2.0.0 introduced the Node.js 22 minimum; Node.js 18 and 20 are not
|
|
120
|
+
supported. Version 2.0.1 added functionality management tools while preserving
|
|
121
|
+
the existing eight tool names. Version 2.0.2 updates their hierarchy guidance to
|
|
122
|
+
match Sentinel's multi-level functionality tree without changing tool names or
|
|
123
|
+
arguments. Update a pinned `mcp-sentinel-qa@2.0.1` configuration to
|
|
124
|
+
`mcp-sentinel-qa@2.0.2`, then restart or reconnect your MCP client. Older
|
|
125
|
+
examples using `mcp-server-sentinel` should use `mcp-sentinel-qa` instead.
|
|
99
126
|
|
|
100
127
|
## Development and release checks
|
|
101
128
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function errorResult(error: unknown): {
|
|
2
|
+
content: {
|
|
3
|
+
type: "text";
|
|
4
|
+
text: string;
|
|
5
|
+
}[];
|
|
6
|
+
isError: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function toolRequest(operation: () => Promise<unknown>): Promise<{
|
|
9
|
+
content: {
|
|
10
|
+
type: "text";
|
|
11
|
+
text: string;
|
|
12
|
+
}[];
|
|
13
|
+
isError: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
content: {
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}[];
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ApiError } from './api-client.js';
|
|
2
|
+
export function errorResult(error) {
|
|
3
|
+
const message = error instanceof ApiError
|
|
4
|
+
? `Error ${error.status}: ${error.message}${error.details ? `\nDetails: ${JSON.stringify(error.details)}` : ''}`
|
|
5
|
+
: error instanceof Error
|
|
6
|
+
? error.message
|
|
7
|
+
: String(error);
|
|
8
|
+
return { content: [{ type: 'text', text: message }], isError: true };
|
|
9
|
+
}
|
|
10
|
+
export async function toolRequest(operation) {
|
|
11
|
+
try {
|
|
12
|
+
const result = await operation();
|
|
13
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
return errorResult(error);
|
|
17
|
+
}
|
|
18
|
+
}
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-sentinel-qa",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "MCP server for Sentinel QA — manage test cases from any AI assistant",
|
|
3
|
+
"version": "2.0.2",
|
|
4
|
+
"description": "MCP server for Sentinel QA — manage functionalities and test cases from any AI assistant",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "João Vitor Matos",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"prepack": "pnpm --ignore-workspace run check",
|
|
28
28
|
"prepublishOnly": "pnpm --ignore-workspace audit --prod"
|
|
29
29
|
},
|
|
30
|
-
"keywords": ["mcp", "sentinel", "qa", "testing", "test-cases"],
|
|
30
|
+
"keywords": ["mcp", "sentinel", "qa", "testing", "functionalities", "test-cases"],
|
|
31
31
|
"homepage": "https://sentinel-qa.vercel.app",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@modelcontextprotocol/server": "^2.4.0",
|
package/dist/server.js
CHANGED
|
@@ -10,9 +10,11 @@
|
|
|
10
10
|
import { McpServer } from '@modelcontextprotocol/server';
|
|
11
11
|
import { serveStdio } from '@modelcontextprotocol/server/stdio';
|
|
12
12
|
import metadata from './package.json' with { type: 'json' };
|
|
13
|
+
import { registerFunctionalityTools } from './tools/functionalities.js';
|
|
13
14
|
import { registerTestCaseTools } from './tools/test-cases.js';
|
|
14
15
|
serveStdio(() => {
|
|
15
16
|
const server = new McpServer({ name: 'sentinel', version: metadata.version });
|
|
16
17
|
registerTestCaseTools(server);
|
|
18
|
+
registerFunctionalityTools(server);
|
|
17
19
|
return server;
|
|
18
20
|
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as api from '../lib/api-client.js';
|
|
2
|
+
import { toolRequest } from '../lib/tool-result.js';
|
|
3
|
+
import { createFunctionalitySchema, deleteFunctionalitySchema, getFunctionalitySchema, listFunctionalitiesSchema, moveFunctionalityCasesSchema, moveFunctionalitySchema, updateFunctionalitySchema, } from './functionality-schemas.js';
|
|
4
|
+
export function registerFunctionalityTools(server) {
|
|
5
|
+
registerReads(server);
|
|
6
|
+
registerCreate(server);
|
|
7
|
+
registerUpdate(server);
|
|
8
|
+
registerMove(server);
|
|
9
|
+
registerDelete(server);
|
|
10
|
+
registerCaseTransfer(server);
|
|
11
|
+
}
|
|
12
|
+
function registerReads(server) {
|
|
13
|
+
server.registerTool('sentinel_list_functionalities', {
|
|
14
|
+
description: 'List project functionalities as flat, paginated rows. Each parent_id identifies the immediate parent; follow all pages to reconstruct the hierarchy at any depth.',
|
|
15
|
+
inputSchema: listFunctionalitiesSchema,
|
|
16
|
+
annotations: { readOnlyHint: true },
|
|
17
|
+
}, ({ project_id, page = 1, page_size = 20 }) => toolRequest(() => api.get('/api/mcp/functionalities', {
|
|
18
|
+
project_id,
|
|
19
|
+
page: page?.toString(),
|
|
20
|
+
page_size: page_size?.toString(),
|
|
21
|
+
})));
|
|
22
|
+
server.registerTool('sentinel_get_functionality', {
|
|
23
|
+
description: 'Get functionality details, including its project and immediate parent_id. Read before editing, moving or deleting.',
|
|
24
|
+
inputSchema: getFunctionalitySchema,
|
|
25
|
+
annotations: { readOnlyHint: true },
|
|
26
|
+
}, ({ id }) => toolRequest(() => api.get(`/api/mcp/functionalities/${id}`)));
|
|
27
|
+
}
|
|
28
|
+
function registerCreate(server) {
|
|
29
|
+
server.registerTool('sentinel_create_functionality', {
|
|
30
|
+
description: 'Create a root or nested functionality at any depth. parent_id may reference any functionality in the same project; omit it or use null for a root. Sentinel rejects cross-project parents and cycles.',
|
|
31
|
+
inputSchema: createFunctionalitySchema,
|
|
32
|
+
}, (params) => toolRequest(() => api.post('/api/mcp/functionalities', params)));
|
|
33
|
+
}
|
|
34
|
+
function registerUpdate(server) {
|
|
35
|
+
server.registerTool('sentinel_update_functionality', {
|
|
36
|
+
description: 'Partially edit name, description, color, status or parent_id. Omitted fields are preserved; null clears description/color or promotes to root. A parent may be any node in the same project; Sentinel rejects cycles. Cannot change project.',
|
|
37
|
+
inputSchema: updateFunctionalitySchema,
|
|
38
|
+
}, ({ id, ...changes }) => toolRequest(() => api.patch(`/api/mcp/functionalities/${id}`, changes)));
|
|
39
|
+
}
|
|
40
|
+
function registerMove(server) {
|
|
41
|
+
server.registerTool('sentinel_move_functionality', {
|
|
42
|
+
description: 'Move a functionality branch under any node in the same project, or promote it with parent_id:null. Sentinel rejects moving a node under itself or one of its descendants. Descendants and test cases stay attached.',
|
|
43
|
+
inputSchema: moveFunctionalitySchema,
|
|
44
|
+
}, ({ id, parent_id }) => toolRequest(() => api.patch(`/api/mcp/functionalities/${id}`, { parent_id })));
|
|
45
|
+
}
|
|
46
|
+
function registerDelete(server) {
|
|
47
|
+
server.registerTool('sentinel_delete_functionality', {
|
|
48
|
+
description: 'Delete a functionality after confirming the target. Unlink its test cases by default or transfer them to target_id, an active functionality in the same project. Direct children become roots; deeper descendants remain attached to their parents.',
|
|
49
|
+
inputSchema: deleteFunctionalitySchema,
|
|
50
|
+
annotations: { destructiveHint: true },
|
|
51
|
+
}, ({ id, target_id }) => toolRequest(() => api.del(`/api/mcp/functionalities/${id}${target_id ? `?target_id=${encodeURIComponent(target_id)}` : ''}`)));
|
|
52
|
+
}
|
|
53
|
+
function registerCaseTransfer(server) {
|
|
54
|
+
server.registerTool('sentinel_move_functionality_test_cases', {
|
|
55
|
+
description: 'Atomically move 1–100 selected test cases to an active functionality in the same project. Rejects mixed projects, unauthorized cases and duplicate IDs; requires features.edit and test_cases.edit.',
|
|
56
|
+
inputSchema: moveFunctionalityCasesSchema,
|
|
57
|
+
}, ({ target_functionality_id, test_case_ids }) => toolRequest(() => api.post(`/api/mcp/functionalities/${target_functionality_id}/test-cases/move`, {
|
|
58
|
+
test_case_ids,
|
|
59
|
+
})));
|
|
60
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listFunctionalitiesSchema: z.ZodObject<{
|
|
3
|
+
project_id: z.ZodString;
|
|
4
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
page_size: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
export declare const createFunctionalitySchema: z.ZodObject<{
|
|
8
|
+
project_id: z.ZodString;
|
|
9
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
10
|
+
Ativa: "Ativa";
|
|
11
|
+
Inativa: "Inativa";
|
|
12
|
+
}>>;
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
description: z.ZodOptional<z.ZodString>;
|
|
15
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
export declare const getFunctionalitySchema: z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
export declare const updateFunctionalitySchema: z.ZodObject<{
|
|
22
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
23
|
+
name: z.ZodOptional<z.ZodString>;
|
|
24
|
+
color: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
25
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
26
|
+
Ativa: "Ativa";
|
|
27
|
+
Inativa: "Inativa";
|
|
28
|
+
}>>;
|
|
29
|
+
parent_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
export declare const moveFunctionalitySchema: z.ZodObject<{
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
parent_id: z.ZodNullable<z.ZodString>;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
export declare const deleteFunctionalitySchema: z.ZodObject<{
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
target_id: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, z.core.$strict>;
|
|
40
|
+
export declare const moveFunctionalityCasesSchema: z.ZodObject<{
|
|
41
|
+
target_functionality_id: z.ZodString;
|
|
42
|
+
test_case_ids: z.ZodArray<z.ZodString>;
|
|
43
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const fields = {
|
|
3
|
+
name: z.string().min(2).max(200).describe('Functionality name'),
|
|
4
|
+
description: z.string().optional().describe('Functionality description'),
|
|
5
|
+
color: z
|
|
6
|
+
.string()
|
|
7
|
+
.regex(/^#[0-9A-Fa-f]{6}$/)
|
|
8
|
+
.nullable()
|
|
9
|
+
.optional()
|
|
10
|
+
.describe('Hex color or null'),
|
|
11
|
+
status: z.enum(['Ativa', 'Inativa']).describe('Functionality status'),
|
|
12
|
+
parent_id: z
|
|
13
|
+
.string()
|
|
14
|
+
.uuid()
|
|
15
|
+
.nullable()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('Immediate parent UUID in the same project; omit or use null for a root. Any depth is supported.'),
|
|
18
|
+
};
|
|
19
|
+
export const listFunctionalitiesSchema = z
|
|
20
|
+
.object({
|
|
21
|
+
project_id: z.string().uuid().describe('Project UUID'),
|
|
22
|
+
page: z.number().int().min(1).max(1_000_000).default(1).describe('Page number (default: 1)'),
|
|
23
|
+
page_size: z
|
|
24
|
+
.number()
|
|
25
|
+
.int()
|
|
26
|
+
.min(1)
|
|
27
|
+
.max(100)
|
|
28
|
+
.default(20)
|
|
29
|
+
.describe('Page size (default: 20, max: 100)'),
|
|
30
|
+
})
|
|
31
|
+
.strict();
|
|
32
|
+
export const createFunctionalitySchema = z
|
|
33
|
+
.object({
|
|
34
|
+
...fields,
|
|
35
|
+
project_id: z.string().uuid().describe('Project UUID'),
|
|
36
|
+
status: fields.status.default('Ativa'),
|
|
37
|
+
})
|
|
38
|
+
.strict();
|
|
39
|
+
export const getFunctionalitySchema = z.object({ id: z.string().uuid() }).strict();
|
|
40
|
+
export const updateFunctionalitySchema = z
|
|
41
|
+
.object({
|
|
42
|
+
...fields,
|
|
43
|
+
description: z.string().nullable().optional().describe('Description; null clears it'),
|
|
44
|
+
})
|
|
45
|
+
.partial()
|
|
46
|
+
.extend({ id: z.string().uuid() })
|
|
47
|
+
.strict()
|
|
48
|
+
.refine(({ id, ...changes }) => Object.keys(changes).length > 0, 'Supply at least one changed field')
|
|
49
|
+
.refine(({ id, parent_id }) => id !== parent_id, 'A functionality cannot be its own parent');
|
|
50
|
+
export const moveFunctionalitySchema = z
|
|
51
|
+
.object({
|
|
52
|
+
id: z.string().uuid().describe('Functionality to move'),
|
|
53
|
+
parent_id: z
|
|
54
|
+
.string()
|
|
55
|
+
.uuid()
|
|
56
|
+
.nullable()
|
|
57
|
+
.describe('Immediate parent UUID in the same project at any depth, or null to promote to root'),
|
|
58
|
+
})
|
|
59
|
+
.strict()
|
|
60
|
+
.refine(({ id, parent_id }) => id !== parent_id, 'A functionality cannot be its own parent');
|
|
61
|
+
export const deleteFunctionalitySchema = z
|
|
62
|
+
.object({
|
|
63
|
+
id: z.string().uuid().describe('Functionality to delete'),
|
|
64
|
+
target_id: z
|
|
65
|
+
.string()
|
|
66
|
+
.uuid()
|
|
67
|
+
.optional()
|
|
68
|
+
.describe('Optional active destination for its cases; otherwise unlink'),
|
|
69
|
+
})
|
|
70
|
+
.strict()
|
|
71
|
+
.refine(({ id, target_id }) => id !== target_id, 'Destination must differ from source');
|
|
72
|
+
export const moveFunctionalityCasesSchema = z
|
|
73
|
+
.object({
|
|
74
|
+
target_functionality_id: z.string().uuid().describe('Active destination functionality UUID'),
|
|
75
|
+
test_case_ids: z
|
|
76
|
+
.array(z.string().uuid())
|
|
77
|
+
.min(1)
|
|
78
|
+
.max(100)
|
|
79
|
+
.refine((ids) => new Set(ids).size === ids.length, 'Duplicate case IDs are not allowed')
|
|
80
|
+
.describe('1–100 unique case UUIDs in the same project as the destination'),
|
|
81
|
+
})
|
|
82
|
+
.strict();
|
package/dist/tools/test-cases.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import * as api from '../lib/api-client.js';
|
|
8
|
+
import { errorResult } from '../lib/tool-result.js';
|
|
8
9
|
export function registerTestCaseTools(server) {
|
|
9
10
|
// =========================================================================
|
|
10
11
|
// sentinel_list_projects
|
|
@@ -22,53 +23,6 @@ export function registerTestCaseTools(server) {
|
|
|
22
23
|
}
|
|
23
24
|
});
|
|
24
25
|
// =========================================================================
|
|
25
|
-
// sentinel_list_functionalities
|
|
26
|
-
// =========================================================================
|
|
27
|
-
server.registerTool('sentinel_list_functionalities', {
|
|
28
|
-
description: 'List functionalities (modules/features) for a project. Needed to get functionality_id when creating test cases.',
|
|
29
|
-
inputSchema: z.object({ project_id: z.string().uuid().describe('Project UUID') }),
|
|
30
|
-
}, async ({ project_id }) => {
|
|
31
|
-
try {
|
|
32
|
-
const result = await api.get('/api/mcp/functionalities', { project_id });
|
|
33
|
-
return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
|
|
34
|
-
}
|
|
35
|
-
catch (error) {
|
|
36
|
-
return errorResult(error);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
// =========================================================================
|
|
40
|
-
// sentinel_create_functionality
|
|
41
|
-
// =========================================================================
|
|
42
|
-
server.registerTool('sentinel_create_functionality', {
|
|
43
|
-
description: 'Create a new functionality (module/feature) in a project. Needed before creating test cases if no functionality exists yet.',
|
|
44
|
-
inputSchema: z.object({
|
|
45
|
-
project_id: z.string().uuid().describe('Project UUID (required)'),
|
|
46
|
-
name: z.string().min(2).max(200).describe('Functionality name (min 2 chars)'),
|
|
47
|
-
status: z.enum(['Ativa', 'Inativa']).default('Ativa').describe('Status (default: Ativa)'),
|
|
48
|
-
description: z.string().optional().describe('Optional description'),
|
|
49
|
-
color: z
|
|
50
|
-
.string()
|
|
51
|
-
.regex(/^#[0-9A-Fa-f]{6}$/)
|
|
52
|
-
.optional()
|
|
53
|
-
.describe('Hex color code (e.g. #3B82F6)'),
|
|
54
|
-
}),
|
|
55
|
-
}, async (params) => {
|
|
56
|
-
try {
|
|
57
|
-
const result = await api.post('/api/mcp/functionalities', params);
|
|
58
|
-
return {
|
|
59
|
-
content: [
|
|
60
|
-
{
|
|
61
|
-
type: 'text',
|
|
62
|
-
text: `Functionality created successfully!\n${JSON.stringify(result.data, null, 2)}`,
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
return errorResult(error);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
// =========================================================================
|
|
72
26
|
// sentinel_list_test_cases
|
|
73
27
|
// =========================================================================
|
|
74
28
|
server.registerTool('sentinel_list_test_cases', {
|
|
@@ -268,11 +222,3 @@ export function registerTestCaseTools(server) {
|
|
|
268
222
|
}
|
|
269
223
|
});
|
|
270
224
|
}
|
|
271
|
-
function errorResult(error) {
|
|
272
|
-
const message = error instanceof api.ApiError
|
|
273
|
-
? `Error ${error.status}: ${error.message}${error.details ? `\nDetails: ${JSON.stringify(error.details)}` : ''}`
|
|
274
|
-
: error instanceof Error
|
|
275
|
-
? error.message
|
|
276
|
-
: String(error);
|
|
277
|
-
return { content: [{ type: 'text', text: message }], isError: true };
|
|
278
|
-
}
|
package/package.json
CHANGED
|
@@ -1,53 +1,47 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"test": "node --test tests/*.test.mjs && MCP_TEST_CLIENT=modern node --test tests/*.test.mjs",
|
|
49
|
-
"test:package": "node scripts/verify-package.mjs",
|
|
50
|
-
"check": "pnpm --ignore-workspace run type-check && pnpm --ignore-workspace run build && pnpm --ignore-workspace run test",
|
|
51
|
-
"dev": "tsx server.ts"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
2
|
+
"name": "mcp-sentinel-qa",
|
|
3
|
+
"version": "2.0.2",
|
|
4
|
+
"description": "MCP server for Sentinel QA — manage functionalities and test cases from any AI assistant",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "João Vitor Matos",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/JVMatos/sentinel.git",
|
|
11
|
+
"directory": "mcp"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/JVMatos/sentinel/issues"
|
|
15
|
+
},
|
|
16
|
+
"bin": {
|
|
17
|
+
"mcp-sentinel-qa": "dist/server.js"
|
|
18
|
+
},
|
|
19
|
+
"files": ["dist", "CHANGELOG.md"],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"type-check": "tsc --noEmit",
|
|
23
|
+
"test": "node --test tests/*.test.mjs && MCP_TEST_CLIENT=modern node --test tests/*.test.mjs",
|
|
24
|
+
"test:package": "node scripts/verify-package.mjs",
|
|
25
|
+
"check": "pnpm --ignore-workspace run type-check && pnpm --ignore-workspace run build && pnpm --ignore-workspace run test",
|
|
26
|
+
"dev": "tsx server.ts",
|
|
27
|
+
"prepack": "pnpm --ignore-workspace run check",
|
|
28
|
+
"prepublishOnly": "pnpm --ignore-workspace audit --prod"
|
|
29
|
+
},
|
|
30
|
+
"keywords": ["mcp", "sentinel", "qa", "testing", "functionalities", "test-cases"],
|
|
31
|
+
"homepage": "https://sentinel-qa.vercel.app",
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@modelcontextprotocol/server": "^2.4.0",
|
|
34
|
+
"zod": "^4.6.7"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@modelcontextprotocol/client": "^2.4.0",
|
|
38
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
39
|
+
"@types/node": "^22.20.5",
|
|
40
|
+
"tsx": "^4.23.15",
|
|
41
|
+
"typescript": "~5.9.3"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=22"
|
|
45
|
+
},
|
|
46
|
+
"packageManager": "pnpm@11.20.0"
|
|
47
|
+
}
|