@azure-devops/mcp 2.2.0-nightly.20251013 → 2.2.1-nightly.20251014
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/README.md +1 -0
- package/dist/auth.js +6 -1
- package/dist/tools/test-plans.js +39 -24
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -122,6 +122,7 @@ Interact with these Azure DevOps services:
|
|
|
122
122
|
|
|
123
123
|
- **testplan_create_test_plan**: Create a new test plan in the project.
|
|
124
124
|
- **testplan_create_test_case**: Create a new test case work item.
|
|
125
|
+
- **testplan_update_test_case_steps**: Update an existing test case work item's steps.
|
|
125
126
|
- **testplan_add_test_cases_to_suite**: Add existing test cases to a test suite.
|
|
126
127
|
- **testplan_list_test_plans**: Retrieve a paginated list of test plans from an Azure DevOps project. Allows filtering for active plans and toggling detailed information.
|
|
127
128
|
- **testplan_list_test_cases**: Get a list of test cases in the test plan.
|
package/dist/auth.js
CHANGED
|
@@ -5,14 +5,19 @@ const scopes = ["499b84ac-1321-427f-aa17-267ca6975798/.default"];
|
|
|
5
5
|
class OAuthAuthenticator {
|
|
6
6
|
static clientId = "0d50963b-7bb9-4fe7-94c7-a99af00b5136";
|
|
7
7
|
static defaultAuthority = "https://login.microsoftonline.com/common";
|
|
8
|
+
static zeroTenantId = "00000000-0000-0000-0000-000000000000";
|
|
8
9
|
accountId;
|
|
9
10
|
publicClientApp;
|
|
10
11
|
constructor(tenantId) {
|
|
11
12
|
this.accountId = null;
|
|
13
|
+
let authority = OAuthAuthenticator.defaultAuthority;
|
|
14
|
+
if (tenantId && tenantId !== OAuthAuthenticator.zeroTenantId) {
|
|
15
|
+
authority = `https://login.microsoftonline.com/${tenantId}`;
|
|
16
|
+
}
|
|
12
17
|
this.publicClientApp = new PublicClientApplication({
|
|
13
18
|
auth: {
|
|
14
19
|
clientId: OAuthAuthenticator.clientId,
|
|
15
|
-
authority
|
|
20
|
+
authority,
|
|
16
21
|
},
|
|
17
22
|
});
|
|
18
23
|
}
|
package/dist/tools/test-plans.js
CHANGED
|
@@ -4,6 +4,7 @@ import { z } from "zod";
|
|
|
4
4
|
const Test_Plan_Tools = {
|
|
5
5
|
create_test_plan: "testplan_create_test_plan",
|
|
6
6
|
create_test_case: "testplan_create_test_case",
|
|
7
|
+
update_test_case_steps: "testplan_update_test_case_steps",
|
|
7
8
|
add_test_cases_to_suite: "testplan_add_test_cases_to_suite",
|
|
8
9
|
test_results_from_build_id: "testplan_show_test_results_from_build_id",
|
|
9
10
|
list_test_cases: "testplan_list_test_cases",
|
|
@@ -11,10 +12,6 @@ const Test_Plan_Tools = {
|
|
|
11
12
|
create_test_suite: "testplan_create_test_suite",
|
|
12
13
|
};
|
|
13
14
|
function configureTestPlanTools(server, _, connectionProvider) {
|
|
14
|
-
/*
|
|
15
|
-
LIST OF TEST PLANS
|
|
16
|
-
get list of test plans by project
|
|
17
|
-
*/
|
|
18
15
|
server.tool(Test_Plan_Tools.list_test_plans, "Retrieve a paginated list of test plans from an Azure DevOps project. Allows filtering for active plans and toggling detailed information.", {
|
|
19
16
|
project: z.string().describe("The unique identifier (ID or name) of the Azure DevOps project."),
|
|
20
17
|
filterActivePlans: z.boolean().default(true).describe("Filter to include only active test plans. Defaults to true."),
|
|
@@ -29,9 +26,6 @@ function configureTestPlanTools(server, _, connectionProvider) {
|
|
|
29
26
|
content: [{ type: "text", text: JSON.stringify(testPlans, null, 2) }],
|
|
30
27
|
};
|
|
31
28
|
});
|
|
32
|
-
/*
|
|
33
|
-
Create Test Plan - CREATE
|
|
34
|
-
*/
|
|
35
29
|
server.tool(Test_Plan_Tools.create_test_plan, "Creates a new test plan in the project.", {
|
|
36
30
|
project: z.string().describe("The unique identifier (ID or name) of the Azure DevOps project where the test plan will be created."),
|
|
37
31
|
name: z.string().describe("The name of the test plan to be created."),
|
|
@@ -56,9 +50,6 @@ function configureTestPlanTools(server, _, connectionProvider) {
|
|
|
56
50
|
content: [{ type: "text", text: JSON.stringify(createdTestPlan, null, 2) }],
|
|
57
51
|
};
|
|
58
52
|
});
|
|
59
|
-
/*
|
|
60
|
-
Create Test Suite - CREATE
|
|
61
|
-
*/
|
|
62
53
|
server.tool(Test_Plan_Tools.create_test_suite, "Creates a new test suite in a test plan.", {
|
|
63
54
|
project: z.string().describe("Project ID or project name"),
|
|
64
55
|
planId: z.number().describe("ID of the test plan that contains the suites"),
|
|
@@ -80,9 +71,6 @@ function configureTestPlanTools(server, _, connectionProvider) {
|
|
|
80
71
|
content: [{ type: "text", text: JSON.stringify(createdTestSuite, null, 2) }],
|
|
81
72
|
};
|
|
82
73
|
});
|
|
83
|
-
/*
|
|
84
|
-
Add Test Cases to Suite - ADD
|
|
85
|
-
*/
|
|
86
74
|
server.tool(Test_Plan_Tools.add_test_cases_to_suite, "Adds existing test cases to a test suite.", {
|
|
87
75
|
project: z.string().describe("The unique identifier (ID or name) of the Azure DevOps project."),
|
|
88
76
|
planId: z.number().describe("The ID of the test plan."),
|
|
@@ -98,9 +86,6 @@ function configureTestPlanTools(server, _, connectionProvider) {
|
|
|
98
86
|
content: [{ type: "text", text: JSON.stringify(addedTestCases, null, 2) }],
|
|
99
87
|
};
|
|
100
88
|
});
|
|
101
|
-
/*
|
|
102
|
-
Create Test Case - CREATE
|
|
103
|
-
*/
|
|
104
89
|
server.tool(Test_Plan_Tools.create_test_case, "Creates a new test case work item.", {
|
|
105
90
|
project: z.string().describe("The unique identifier (ID or name) of the Azure DevOps project."),
|
|
106
91
|
title: z.string().describe("The title of the test case."),
|
|
@@ -111,7 +96,8 @@ function configureTestPlanTools(server, _, connectionProvider) {
|
|
|
111
96
|
priority: z.number().optional().describe("The priority of the test case."),
|
|
112
97
|
areaPath: z.string().optional().describe("The area path for the test case."),
|
|
113
98
|
iterationPath: z.string().optional().describe("The iteration path for the test case."),
|
|
114
|
-
|
|
99
|
+
testsWorkItemId: z.number().optional().describe("Optional work item id that will be set as a Microsoft.VSTS.Common.TestedBy-Reverse link to the test case."),
|
|
100
|
+
}, async ({ project, title, steps, priority, areaPath, iterationPath, testsWorkItemId }) => {
|
|
115
101
|
const connection = await connectionProvider();
|
|
116
102
|
const witClient = await connection.getWorkItemTrackingApi();
|
|
117
103
|
let stepsXml;
|
|
@@ -125,6 +111,16 @@ function configureTestPlanTools(server, _, connectionProvider) {
|
|
|
125
111
|
path: "/fields/System.Title",
|
|
126
112
|
value: title,
|
|
127
113
|
});
|
|
114
|
+
if (testsWorkItemId) {
|
|
115
|
+
patchDocument.push({
|
|
116
|
+
op: "add",
|
|
117
|
+
path: "/relations/-",
|
|
118
|
+
value: {
|
|
119
|
+
rel: "Microsoft.VSTS.Common.TestedBy-Reverse",
|
|
120
|
+
url: `${connection.serverUrl}/${project}/_apis/wit/workItems/${testsWorkItemId}`,
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
}
|
|
128
124
|
if (stepsXml) {
|
|
129
125
|
patchDocument.push({
|
|
130
126
|
op: "add",
|
|
@@ -158,10 +154,32 @@ function configureTestPlanTools(server, _, connectionProvider) {
|
|
|
158
154
|
content: [{ type: "text", text: JSON.stringify(workItem, null, 2) }],
|
|
159
155
|
};
|
|
160
156
|
});
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
157
|
+
server.tool(Test_Plan_Tools.update_test_case_steps, "Update an existing test case work item.", {
|
|
158
|
+
id: z.number().describe("The ID of the test case work item to update."),
|
|
159
|
+
steps: z
|
|
160
|
+
.string()
|
|
161
|
+
.describe("The steps to reproduce the test case. Make sure to format each step as '1. Step one|Expected result one\n2. Step two|Expected result two. USE '|' as the delimiter between step and expected result. DO NOT use '|' in the description of the step or expected result."),
|
|
162
|
+
}, async ({ id, steps }) => {
|
|
163
|
+
const connection = await connectionProvider();
|
|
164
|
+
const witClient = await connection.getWorkItemTrackingApi();
|
|
165
|
+
let stepsXml;
|
|
166
|
+
if (steps) {
|
|
167
|
+
stepsXml = convertStepsToXml(steps);
|
|
168
|
+
}
|
|
169
|
+
// Create JSON patch document for work item
|
|
170
|
+
const patchDocument = [];
|
|
171
|
+
if (stepsXml) {
|
|
172
|
+
patchDocument.push({
|
|
173
|
+
op: "add",
|
|
174
|
+
path: "/fields/Microsoft.VSTS.TCM.Steps",
|
|
175
|
+
value: stepsXml,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
const workItem = await witClient.updateWorkItem({}, patchDocument, id);
|
|
179
|
+
return {
|
|
180
|
+
content: [{ type: "text", text: JSON.stringify(workItem, null, 2) }],
|
|
181
|
+
};
|
|
182
|
+
});
|
|
165
183
|
server.tool(Test_Plan_Tools.list_test_cases, "Gets a list of test cases in the test plan.", {
|
|
166
184
|
project: z.string().describe("The unique identifier (ID or name) of the Azure DevOps project."),
|
|
167
185
|
planid: z.number().describe("The ID of the test plan."),
|
|
@@ -174,9 +192,6 @@ function configureTestPlanTools(server, _, connectionProvider) {
|
|
|
174
192
|
content: [{ type: "text", text: JSON.stringify(testcases, null, 2) }],
|
|
175
193
|
};
|
|
176
194
|
});
|
|
177
|
-
/*
|
|
178
|
-
Gets a list of test results for a given project and build ID
|
|
179
|
-
*/
|
|
180
195
|
server.tool(Test_Plan_Tools.test_results_from_build_id, "Gets a list of test results for a given project and build ID.", {
|
|
181
196
|
project: z.string().describe("The unique identifier (ID or name) of the Azure DevOps project."),
|
|
182
197
|
buildid: z.number().describe("The ID of the build."),
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageVersion = "2.2.
|
|
1
|
+
export const packageVersion = "2.2.1-nightly.20251014";
|