Repository: microsoft/azure-devops-mcp

Issue:
[Feature request] Add source branch ref to PR summary 
Please include the raw branch refs from Azure DevOps (sourceRefName, targetRefName) in all PR-returning tools in src/tools/repos.ts. This makes it possible for agents/clients to reason about branch provenance such as "What is the the pull request for the current branch"   

Example patch:
// repos.ts
-const toSummary = (pr: GitPullRequest) => ({
+const toSummary = (pr: GitPullRequest) => ({
   id: pr.pullRequestId,
   title: pr.title,
   status: pr.status,
   createdBy: pr.createdBy?.displayName,
   creationDate: pr.creationDate?.toISOString?.(),
+  sourceRefName: pr.sourceRefName,
+  targetRefName: pr.targetRefName,
   url: pr._links?.web?.href ?? pr.url,
});


Discussion:

Solution patch:
diff --git a/src/tools/repos.ts b/src/tools/repos.ts
index 66d252f..311e71e 100644
--- a/src/tools/repos.ts
+++ b/src/tools/repos.ts
@@ -323,6 +323,8 @@ function configureRepoTools(server: McpServer, tokenProvider: () => Promise<Acce
         creationDate: pr.creationDate,
         title: pr.title,
         isDraft: pr.isDraft,
+        sourceRefName: pr.sourceRefName,
+        targetRefName: pr.targetRefName,
       }));
 
       return {
@@ -390,6 +392,8 @@ function configureRepoTools(server: McpServer, tokenProvider: () => Promise<Acce
         creationDate: pr.creationDate,
         title: pr.title,
         isDraft: pr.isDraft,
+        sourceRefName: pr.sourceRefName,
+        targetRefName: pr.targetRefName,
       }));
 
       return {



Test patch:
diff --git a/test/src/tools/repos.test.ts b/test/src/tools/repos.test.ts
index acc3e41..a9364a9 100644
--- a/test/src/tools/repos.test.ts
+++ b/test/src/tools/repos.test.ts
@@ -499,6 +499,8 @@ describe("repos tools", () => {
           creationDate: "2023-01-01T00:00:00Z",
           title: "Feature PR",
           isDraft: false,
+          sourceRefName: "refs/heads/feature-branch",
+          targetRefName: "refs/heads/main",
         },
       ];
       mockGitApi.getPullRequests.mockResolvedValue(mockPRs);
@@ -561,6 +563,8 @@ describe("repos tools", () => {
           creationDate: "2023-01-01T00:00:00Z",
           title: "Feature PR",
           isDraft: false,
+          sourceRefName: "refs/heads/feature-branch",
+          targetRefName: "refs/heads/main",
         },
       ];
       mockGitApi.getPullRequestsByProject.mockResolvedValue(mockPRs);
@@ -586,6 +590,8 @@ describe("repos tools", () => {
           creationDate: "2023-01-01T00:00:00Z",
           title: "Feature PR",
           isDraft: false,
+          sourceRefName: "refs/heads/feature-branch",
+          targetRefName: "refs/heads/main",
         },
       ];