Summary
repo_get_branch_by_name (and the underlying Get Branch endpoint) currently only returns basic branch info (name, objectId, creator). The Azure DevOps REST API supports comparing a branch against a base ref via baseVersionDescriptor, returning aheadCount/behindCount. This isn't exposed anywhere in the current MCP tool surface.
Use case
A common cleanup workflow is: "list branches that are already merged into main and have no new commits, so they're safe to delete." Today, doing this through the MCP tools requires cross-referencing repo_list_pull_requests_by_repo_or_project (to find a Completed PR per branch) with commit-level lookups, which is indirect and, in my testing, some of the commit-search tools (repo_search_commits, repo_list_pull_requests_by_commits) timed out/hung repeatedly on a mid-size private org repo.
Suggestion
Either:
- Add optional
baseVersionDescriptor (branch/commit/tag + version) params to repo_get_branch_by_name, returning aheadCount/behindCount when provided, or
- Add a dedicated
repo_compare_branches tool wrapping the "Get Branch" stats/branches endpoint with base comparison.
This would let a single call per branch answer "is this branch merged and up to date with main" directly, instead of needing PR cross-referencing.
Environment
- Package:
@azure-devops/mcp (local/stdio server, via npx @azure-devops/mcp <org>)
- Used via Claude Desktop
Summary
repo_get_branch_by_name(and the underlying Get Branch endpoint) currently only returns basic branch info (name, objectId, creator). The Azure DevOps REST API supports comparing a branch against a base ref viabaseVersionDescriptor, returningaheadCount/behindCount. This isn't exposed anywhere in the current MCP tool surface.Use case
A common cleanup workflow is: "list branches that are already merged into main and have no new commits, so they're safe to delete." Today, doing this through the MCP tools requires cross-referencing
repo_list_pull_requests_by_repo_or_project(to find a Completed PR per branch) with commit-level lookups, which is indirect and, in my testing, some of the commit-search tools (repo_search_commits,repo_list_pull_requests_by_commits) timed out/hung repeatedly on a mid-size private org repo.Suggestion
Either:
baseVersionDescriptor(branch/commit/tag + version) params torepo_get_branch_by_name, returningaheadCount/behindCountwhen provided, orrepo_compare_branchestool wrapping the "Get Branch" stats/branches endpoint with base comparison.This would let a single call per branch answer "is this branch merged and up to date with main" directly, instead of needing PR cross-referencing.
Environment
@azure-devops/mcp(local/stdio server, vianpx @azure-devops/mcp <org>)