@azure-devops/mcp 2.10.0-nightly.20261005 → 2.10.0-nightly.20261007

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.
@@ -197,7 +197,7 @@ function configureRepoTools(server, tokenProvider, connectionProvider, userAgent
197
197
  .describe("The action to perform. Options: get (get a pull request by ID), list (list pull requests in a repository or project), list_by_commits (find pull requests that contain specific commit IDs)."),
198
198
  repositoryId: z.string().optional().describe("The ID or name of the repository. Required for get. Optional for list. When using a name instead of a GUID, project must also be provided."),
199
199
  pullRequestId: z.coerce.number().min(1).optional().describe("The ID of the pull request. Required for get."),
200
- project: z.string().optional().describe("Project ID or project name. Required for list_by_commits. Optional for get and list."),
200
+ project: z.string().optional().describe("Project ID or name. Required for list_by_commits and when repositoryId is a name. Optional when repositoryId is a GUID."),
201
201
  includeWorkItemRefs: z.boolean().optional().default(false).describe("Whether to include work item references. Used for get."),
202
202
  includeLabels: z.boolean().optional().default(false).describe("Whether to include labels. Used for get."),
203
203
  includeChangedFiles: z
@@ -226,13 +226,19 @@ function configureRepoTools(server, tokenProvider, connectionProvider, userAgent
226
226
  .describe("Type of commit query. Used for list_by_commits."),
227
227
  }, async ({ action, repositoryId, pullRequestId, project, includeWorkItemRefs, includeLabels, includeChangedFiles, top, skip, created_by_me, created_by_user, i_am_reviewer, user_is_reviewer, status, sourceRefName, targetRefName, repository, commits, queryType, }) => {
228
228
  try {
229
- const connection = await connectionProvider();
230
- const gitApi = await connection.getGitApi();
231
229
  if (action === "get") {
232
230
  if (!repositoryId)
233
231
  return { content: [{ type: "text", text: "repositoryId is required for get" }], isError: true };
234
232
  if (!pullRequestId)
235
233
  return { content: [{ type: "text", text: "pullRequestId is required for get" }], isError: true };
234
+ if (!project && !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(repositoryId)) {
235
+ return {
236
+ content: [{ type: "text", text: "When repositoryId is a repository name, project is required. Provide the project name or ID, or use the repository GUID." }],
237
+ isError: true,
238
+ };
239
+ }
240
+ const connection = await connectionProvider();
241
+ const gitApi = await connection.getGitApi();
236
242
  const pullRequest = await gitApi.getPullRequest(repositoryId, pullRequestId, project, undefined, undefined, undefined, undefined, includeWorkItemRefs);
237
243
  let enhancedResponse = { ...pullRequest };
238
244
  if (includeLabels) {
@@ -282,6 +288,8 @@ function configureRepoTools(server, tokenProvider, connectionProvider, userAgent
282
288
  }
283
289
  return createExternalContentResponse(enhancedResponse, "pull request");
284
290
  }
291
+ const connection = await connectionProvider();
292
+ const gitApi = await connection.getGitApi();
285
293
  if (action === "list") {
286
294
  if (!repositoryId && !project) {
287
295
  return { content: [{ type: "text", text: "Either repositoryId or project must be provided." }], isError: true };
@@ -693,7 +701,7 @@ function configureRepoTools(server, tokenProvider, connectionProvider, userAgent
693
701
  targetRefName: z.string().optional().describe("The target branch name (e.g., 'refs/heads/main'). Required for create. Optional for update."),
694
702
  title: z.string().optional().describe("The title of the pull request. Required for create. Optional for update."),
695
703
  description: z.string().max(4000).optional().describe("The description of the pull request. Max 4000 characters. Used for create and update."),
696
- isDraft: z.boolean().optional().default(false).describe("Whether the pull request is a draft. Used for create and update."),
704
+ isDraft: z.boolean().optional().describe("Whether the pull request is a draft. Defaults to false for create. When omitted during update, the existing draft state is preserved."),
697
705
  workItems: z.string().optional().describe("Work item IDs to associate, space-separated. Used for create."),
698
706
  forkSourceRepositoryId: z.string().optional().describe("The ID of the fork repository. Used for create."),
699
707
  labels: z.array(z.string()).optional().describe("Array of label names. Used for create and update."),
@@ -729,7 +737,7 @@ function configureRepoTools(server, tokenProvider, connectionProvider, userAgent
729
737
  "Try the repository GUID from repo_repository (list action) instead of the Project/RepoName slash format.";
730
738
  const forkSource = forkSourceRepositoryId ? { repository: { id: forkSourceRepositoryId } } : undefined;
731
739
  const labelDefinitions = labels ? labels.map((label) => ({ name: label })) : undefined;
732
- let pullRequest = await gitApi.createPullRequest({ sourceRefName, targetRefName, title, description, isDraft, workItemRefs, forkSource, labels: labelDefinitions, supportsIterations: true }, repositoryId, project);
740
+ let pullRequest = await gitApi.createPullRequest({ sourceRefName, targetRefName, title, description, isDraft: isDraft ?? false, workItemRefs, forkSource, labels: labelDefinitions, supportsIterations: true }, repositoryId, project);
733
741
  if (!pullRequest) {
734
742
  const prs = await gitApi.getPullRequests(repositoryId, { sourceRefName, targetRefName, status: PullRequestStatus.Active }, project, undefined, 0, 1);
735
743
  if (prs && prs.length > 0) {
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const packageVersion = "2.10.0-nightly.20261005";
1
+ export const packageVersion = "2.10.0-nightly.20261007";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-devops/mcp",
3
- "version": "2.10.0-nightly.20261005",
3
+ "version": "2.10.0-nightly.20261007",
4
4
  "mcpName": "microsoft.com/azure-devops",
5
5
  "description": "MCP server for interacting with Azure DevOps",
6
6
  "license": "MIT",