@azure-devops/mcp 0.1.0 → 0.2.0-preview-oauth
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/LICENSE.md +21 -21
- package/README.md +320 -247
- package/dist/auth.js +74 -0
- package/dist/domains.js +1 -0
- package/dist/http.js +52 -0
- package/dist/index.js +61 -28
- package/dist/org-tenants.js +73 -0
- package/dist/orgtenants.js +73 -0
- package/dist/prompts.js +35 -10
- package/dist/server.js +36 -0
- package/dist/shared/domains.js +122 -0
- package/dist/shared/tool-validation.js +92 -0
- package/dist/tenant.js +73 -0
- package/dist/tools/advanced-security.js +108 -0
- package/dist/tools/advsec.js +108 -0
- package/dist/tools/auth.js +46 -4
- package/dist/tools/builds.js +146 -21
- package/dist/tools/core.js +73 -14
- package/dist/tools/releases.js +40 -15
- package/dist/tools/repos.js +421 -54
- package/dist/tools/repositories.js +666 -0
- package/dist/tools/search.js +100 -89
- package/dist/tools/test-plans.js +213 -0
- package/dist/tools/testplans.js +22 -21
- package/dist/tools/wiki.js +295 -37
- package/dist/tools/work-items.js +809 -0
- package/dist/tools/work.js +83 -39
- package/dist/tools/workitems.js +495 -171
- package/dist/tools.js +24 -14
- package/dist/useragent.js +20 -0
- package/dist/utils.js +52 -2
- package/dist/version.js +1 -1
- package/package.json +65 -55
package/dist/tools/work.js
CHANGED
|
@@ -7,64 +7,108 @@ const WORK_TOOLS = {
|
|
|
7
7
|
create_iterations: "work_create_iterations",
|
|
8
8
|
assign_iterations: "work_assign_iterations",
|
|
9
9
|
};
|
|
10
|
-
function configureWorkTools(server,
|
|
10
|
+
function configureWorkTools(server, _, connectionProvider) {
|
|
11
11
|
server.tool(WORK_TOOLS.list_team_iterations, "Retrieve a list of iterations for a specific team in a project.", {
|
|
12
12
|
project: z.string().describe("The name or ID of the Azure DevOps project."),
|
|
13
13
|
team: z.string().describe("The name or ID of the Azure DevOps team."),
|
|
14
14
|
timeframe: z.enum(["current"]).optional().describe("The timeframe for which to retrieve iterations. Currently, only 'current' is supported."),
|
|
15
15
|
}, async ({ project, team, timeframe }) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
try {
|
|
17
|
+
const connection = await connectionProvider();
|
|
18
|
+
const workApi = await connection.getWorkApi();
|
|
19
|
+
const iterations = await workApi.getTeamIterations({ project, team }, timeframe);
|
|
20
|
+
if (!iterations) {
|
|
21
|
+
return { content: [{ type: "text", text: "No iterations found" }], isError: true };
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
content: [{ type: "text", text: JSON.stringify(iterations, null, 2) }],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
29
|
+
return {
|
|
30
|
+
content: [{ type: "text", text: `Error fetching team iterations: ${errorMessage}` }],
|
|
31
|
+
isError: true,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
22
34
|
});
|
|
23
35
|
server.tool(WORK_TOOLS.create_iterations, "Create new iterations in a specified Azure DevOps project.", {
|
|
24
36
|
project: z.string().describe("The name or ID of the Azure DevOps project."),
|
|
25
|
-
iterations: z
|
|
37
|
+
iterations: z
|
|
38
|
+
.array(z.object({
|
|
26
39
|
iterationName: z.string().describe("The name of the iteration to create."),
|
|
27
40
|
startDate: z.string().optional().describe("The start date of the iteration in ISO format (e.g., '2023-01-01T00:00:00Z'). Optional."),
|
|
28
|
-
finishDate: z.string().optional().describe("The finish date of the iteration in ISO format (e.g., '2023-01-31T23:59:59Z'). Optional.")
|
|
29
|
-
}))
|
|
41
|
+
finishDate: z.string().optional().describe("The finish date of the iteration in ISO format (e.g., '2023-01-31T23:59:59Z'). Optional."),
|
|
42
|
+
}))
|
|
43
|
+
.describe("An array of iterations to create. Each iteration must have a name and can optionally have start and finish dates in ISO format."),
|
|
30
44
|
}, async ({ project, iterations }) => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
try {
|
|
46
|
+
const connection = await connectionProvider();
|
|
47
|
+
const workItemTrackingApi = await connection.getWorkItemTrackingApi();
|
|
48
|
+
const results = [];
|
|
49
|
+
for (const { iterationName, startDate, finishDate } of iterations) {
|
|
50
|
+
// Step 1: Create the iteration
|
|
51
|
+
const iteration = await workItemTrackingApi.createOrUpdateClassificationNode({
|
|
52
|
+
name: iterationName,
|
|
53
|
+
attributes: {
|
|
54
|
+
startDate: startDate ? new Date(startDate) : undefined,
|
|
55
|
+
finishDate: finishDate ? new Date(finishDate) : undefined,
|
|
56
|
+
},
|
|
57
|
+
}, project, TreeStructureGroup.Iterations);
|
|
58
|
+
if (iteration) {
|
|
59
|
+
results.push(iteration);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (results.length === 0) {
|
|
63
|
+
return { content: [{ type: "text", text: "No iterations were created" }], isError: true };
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
content: [{ type: "text", text: JSON.stringify(results, null, 2) }],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
71
|
+
return {
|
|
72
|
+
content: [{ type: "text", text: `Error creating iterations: ${errorMessage}` }],
|
|
73
|
+
isError: true,
|
|
74
|
+
};
|
|
44
75
|
}
|
|
45
|
-
return {
|
|
46
|
-
content: [{ type: "text", text: JSON.stringify(results, null, 2) }],
|
|
47
|
-
};
|
|
48
76
|
});
|
|
49
77
|
server.tool(WORK_TOOLS.assign_iterations, "Assign existing iterations to a specific team in a project.", {
|
|
50
78
|
project: z.string().describe("The name or ID of the Azure DevOps project."),
|
|
51
79
|
team: z.string().describe("The name or ID of the Azure DevOps team."),
|
|
52
|
-
iterations: z
|
|
80
|
+
iterations: z
|
|
81
|
+
.array(z.object({
|
|
53
82
|
identifier: z.string().describe("The identifier of the iteration to assign."),
|
|
54
|
-
path: z.string().describe("The path of the iteration to assign, e.g., 'Project/Iteration'.")
|
|
55
|
-
}))
|
|
83
|
+
path: z.string().describe("The path of the iteration to assign, e.g., 'Project/Iteration'."),
|
|
84
|
+
}))
|
|
85
|
+
.describe("An array of iterations to assign. Each iteration must have an identifier and a path."),
|
|
56
86
|
}, async ({ project, team, iterations }) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
87
|
+
try {
|
|
88
|
+
const connection = await connectionProvider();
|
|
89
|
+
const workApi = await connection.getWorkApi();
|
|
90
|
+
const teamContext = { project, team };
|
|
91
|
+
const results = [];
|
|
92
|
+
for (const { identifier, path } of iterations) {
|
|
93
|
+
const assignment = await workApi.postTeamIteration({ path: path, id: identifier }, teamContext);
|
|
94
|
+
if (assignment) {
|
|
95
|
+
results.push(assignment);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (results.length === 0) {
|
|
99
|
+
return { content: [{ type: "text", text: "No iterations were assigned to the team" }], isError: true };
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
content: [{ type: "text", text: JSON.stringify(results, null, 2) }],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
107
|
+
return {
|
|
108
|
+
content: [{ type: "text", text: `Error assigning iterations: ${errorMessage}` }],
|
|
109
|
+
isError: true,
|
|
110
|
+
};
|
|
64
111
|
}
|
|
65
|
-
return {
|
|
66
|
-
content: [{ type: "text", text: JSON.stringify(results, null, 2) }],
|
|
67
|
-
};
|
|
68
112
|
});
|
|
69
113
|
}
|
|
70
114
|
export { WORK_TOOLS, configureWorkTools };
|