@azure-devops/mcp 2.4.0-nightly.20260113 → 2.4.0-nightly.20260115
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/dist/tools/pipelines.js +67 -0
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/tools/pipelines.js
CHANGED
|
@@ -5,6 +5,8 @@ import { BuildQueryOrder, DefinitionQueryOrder } from "azure-devops-node-api/int
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { StageUpdateType } from "azure-devops-node-api/interfaces/BuildInterfaces.js";
|
|
7
7
|
import { ConfigurationType, RepositoryType } from "azure-devops-node-api/interfaces/PipelinesInterfaces.js";
|
|
8
|
+
import { mkdirSync, createWriteStream } from "fs";
|
|
9
|
+
import { join, resolve } from "path";
|
|
8
10
|
const PIPELINE_TOOLS = {
|
|
9
11
|
pipelines_get_builds: "pipelines_get_builds",
|
|
10
12
|
pipelines_get_build_changes: "pipelines_get_build_changes",
|
|
@@ -18,6 +20,8 @@ const PIPELINE_TOOLS = {
|
|
|
18
20
|
pipelines_get_run: "pipelines_get_run",
|
|
19
21
|
pipelines_list_runs: "pipelines_list_runs",
|
|
20
22
|
pipelines_run_pipeline: "pipelines_run_pipeline",
|
|
23
|
+
pipelines_list_artifacts: "pipelines_list_artifacts",
|
|
24
|
+
pipelines_download_artifact: "pipelines_download_artifact",
|
|
21
25
|
};
|
|
22
26
|
function configurePipelineTools(server, tokenProvider, connectionProvider, userAgentProvider) {
|
|
23
27
|
server.tool(PIPELINE_TOOLS.pipelines_get_build_definitions, "Retrieves a list of build definitions for a given project.", {
|
|
@@ -315,5 +319,68 @@ function configurePipelineTools(server, tokenProvider, connectionProvider, userA
|
|
|
315
319
|
content: [{ type: "text", text: JSON.stringify(updatedBuild, null, 2) }],
|
|
316
320
|
};
|
|
317
321
|
});
|
|
322
|
+
server.tool(PIPELINE_TOOLS.pipelines_list_artifacts, "Lists artifacts for a given build.", {
|
|
323
|
+
project: z.string().describe("The name or ID of the project."),
|
|
324
|
+
buildId: z.number().describe("The ID of the build."),
|
|
325
|
+
}, async ({ project, buildId }) => {
|
|
326
|
+
const connection = await connectionProvider();
|
|
327
|
+
const buildApi = await connection.getBuildApi();
|
|
328
|
+
const artifacts = await buildApi.getArtifacts(project, buildId);
|
|
329
|
+
return {
|
|
330
|
+
content: [{ type: "text", text: JSON.stringify(artifacts, null, 2) }],
|
|
331
|
+
};
|
|
332
|
+
});
|
|
333
|
+
server.tool(PIPELINE_TOOLS.pipelines_download_artifact, "Downloads a pipeline artifact.", {
|
|
334
|
+
project: z.string().describe("The name or ID of the project."),
|
|
335
|
+
buildId: z.number().describe("The ID of the build."),
|
|
336
|
+
artifactName: z.string().describe("The name of the artifact to download."),
|
|
337
|
+
destinationPath: z.string().optional().describe("The local path to download the artifact to. If not provided, returns binary content as base64."),
|
|
338
|
+
}, async ({ project, buildId, artifactName, destinationPath }) => {
|
|
339
|
+
const connection = await connectionProvider();
|
|
340
|
+
const buildApi = await connection.getBuildApi();
|
|
341
|
+
const artifact = await buildApi.getArtifact(project, buildId, artifactName);
|
|
342
|
+
if (!artifact) {
|
|
343
|
+
return {
|
|
344
|
+
content: [{ type: "text", text: `Artifact ${artifactName} not found in build ${buildId}.` }],
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
const fileStream = await buildApi.getArtifactContentZip(project, buildId, artifactName);
|
|
348
|
+
// If destinationPath is provided, save to disk
|
|
349
|
+
if (destinationPath) {
|
|
350
|
+
const fullDestinationPath = resolve(destinationPath);
|
|
351
|
+
mkdirSync(fullDestinationPath, { recursive: true });
|
|
352
|
+
const fileDestinationPath = join(fullDestinationPath, `${artifactName}.zip`);
|
|
353
|
+
const writeStream = createWriteStream(fileDestinationPath);
|
|
354
|
+
await new Promise((resolve, reject) => {
|
|
355
|
+
fileStream.pipe(writeStream);
|
|
356
|
+
fileStream.on("end", () => resolve());
|
|
357
|
+
fileStream.on("error", (err) => reject(err));
|
|
358
|
+
});
|
|
359
|
+
return {
|
|
360
|
+
content: [{ type: "text", text: `Artifact ${artifactName} downloaded to ${destinationPath}.` }],
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
// Otherwise, return binary content as base64
|
|
364
|
+
const chunks = [];
|
|
365
|
+
await new Promise((resolve, reject) => {
|
|
366
|
+
fileStream.on("data", (chunk) => chunks.push(Buffer.from(chunk)));
|
|
367
|
+
fileStream.on("end", () => resolve());
|
|
368
|
+
fileStream.on("error", (err) => reject(err));
|
|
369
|
+
});
|
|
370
|
+
const buffer = Buffer.concat(chunks);
|
|
371
|
+
const base64Data = buffer.toString("base64");
|
|
372
|
+
return {
|
|
373
|
+
content: [
|
|
374
|
+
{
|
|
375
|
+
type: "resource",
|
|
376
|
+
resource: {
|
|
377
|
+
uri: `data:application/zip;base64,${base64Data}`,
|
|
378
|
+
mimeType: "application/zip",
|
|
379
|
+
text: base64Data,
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
],
|
|
383
|
+
};
|
|
384
|
+
});
|
|
318
385
|
}
|
|
319
386
|
export { PIPELINE_TOOLS, configurePipelineTools };
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageVersion = "2.4.0-nightly.
|
|
1
|
+
export const packageVersion = "2.4.0-nightly.20260115";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-devops/mcp",
|
|
3
|
-
"version": "2.4.0-nightly.
|
|
3
|
+
"version": "2.4.0-nightly.20260115",
|
|
4
4
|
"mcpName": "microsoft.com/azure-devops",
|
|
5
5
|
"description": "MCP server for interacting with Azure DevOps",
|
|
6
6
|
"license": "MIT",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"jest": "^30.0.2",
|
|
61
61
|
"jest-extended": "^7.0.0",
|
|
62
62
|
"lint-staged": "^16.2.7",
|
|
63
|
-
"prettier": "3.7.
|
|
63
|
+
"prettier": "3.7.4",
|
|
64
64
|
"shx": "^0.4.0",
|
|
65
65
|
"ts-jest": "^29.4.6",
|
|
66
66
|
"tsconfig-paths": "^4.2.0",
|