@azure-devops/mcp 2.5.0-nightly.20260408 → 2.5.0-nightly.20260409

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.
@@ -4,6 +4,8 @@ import { WorkItemExpand } from "azure-devops-node-api/interfaces/WorkItemTrackin
4
4
  import { QueryExpand } from "azure-devops-node-api/interfaces/WorkItemTrackingInterfaces.js";
5
5
  import { z } from "zod";
6
6
  import { batchApiVersion, markdownCommentsApiVersion, getEnumKeys, safeEnumConvert, encodeFormattedValue } from "../utils.js";
7
+ import { elicitProject } from "../shared/elicitations.js";
8
+ import { createExternalContentResponse } from "../shared/content-safety.js";
7
9
  const WORKITEM_TOOLS = {
8
10
  my_work_items: "wit_my_work_items",
9
11
  list_backlogs: "wit_list_backlogs",
@@ -27,6 +29,7 @@ const WORKITEM_TOOLS = {
27
29
  work_item_unlink: "wit_work_item_unlink",
28
30
  add_artifact_link: "wit_add_artifact_link",
29
31
  get_work_item_attachment: "wit_get_work_item_attachment",
32
+ query_by_wiql: "wit_query_by_wiql",
30
33
  };
31
34
  function getLinkTypeFromName(name) {
32
35
  switch (name.toLowerCase()) {
@@ -1034,6 +1037,35 @@ function configureWorkItemTools(server, tokenProvider, connectionProvider, userA
1034
1037
  };
1035
1038
  }
1036
1039
  });
1040
+ server.tool(WORKITEM_TOOLS.query_by_wiql, "Execute a WIQL (Work Item Query Language) query and return the matching work items. If a project is not specified, you will be prompted to select one.", {
1041
+ wiql: z.string().max(32768).describe('The WIQL query string to execute, e.g., "SELECT [System.Id], [System.Title] FROM WorkItems WHERE [System.TeamProject] = @project"'),
1042
+ project: z.string().optional().describe("The name or ID of the Azure DevOps project. Reuse from prior context if already known. If not provided, a project selection prompt will be shown."),
1043
+ team: z.string().optional().describe("The name or ID of the Azure DevOps team. If not provided, the default team context will be used."),
1044
+ timePrecision: z.boolean().optional().describe("Whether to include time precision in date fields. Defaults to false."),
1045
+ top: z.coerce.number().default(50).describe("The maximum number of results to return. Defaults to 50."),
1046
+ }, async ({ wiql, project, team, timePrecision, top }) => {
1047
+ try {
1048
+ const connection = await connectionProvider();
1049
+ let resolvedProject = project;
1050
+ if (!resolvedProject) {
1051
+ const result = await elicitProject(server, connection, "Select the Azure DevOps project to run the WIQL query against.");
1052
+ if ("response" in result)
1053
+ return result.response;
1054
+ resolvedProject = result.resolved;
1055
+ }
1056
+ const workItemApi = await connection.getWorkItemTrackingApi();
1057
+ const teamContext = { project: resolvedProject, team };
1058
+ const queryResult = await workItemApi.queryByWiql({ query: wiql }, teamContext, timePrecision, top);
1059
+ return createExternalContentResponse(queryResult, "wiql query results");
1060
+ }
1061
+ catch (error) {
1062
+ const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
1063
+ return {
1064
+ content: [{ type: "text", text: `Error executing WIQL query: ${errorMessage}` }],
1065
+ isError: true,
1066
+ };
1067
+ }
1068
+ });
1037
1069
  server.tool(WORKITEM_TOOLS.get_work_item_attachment, "Download a work item attachment by its ID and return the content as a base64-encoded resource. Useful for viewing images (e.g. screenshots) attached to work items such as bugs.", {
1038
1070
  project: z.string().describe("The name or ID of the Azure DevOps project."),
1039
1071
  attachmentId: z.string().describe("The GUID of the attachment. Found in the attachment URL: https://dev.azure.com/{org}/{project}/_apis/wit/attachments/{attachmentId}"),
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const packageVersion = "2.5.0-nightly.20260408";
1
+ export const packageVersion = "2.5.0-nightly.20260409";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-devops/mcp",
3
- "version": "2.5.0-nightly.20260408",
3
+ "version": "2.5.0-nightly.20260409",
4
4
  "mcpName": "microsoft.com/azure-devops",
5
5
  "description": "MCP server for interacting with Azure DevOps",
6
6
  "license": "MIT",