azure-devops-cli-mcp
This MCP server bridges Claude Desktop/Cowork to Azure DevOps CLI and REST APIs, enabling full management of Azure DevOps resources (repos, boards, pipelines, artifacts) and GitHub-like operations on the host machine.
Run Azure DevOps CLI commands (
az_devops) restricted todevops,repos,boards,pipelines,artifactsgroups, auto-fills org/project/repo defaults and JSON output.Query CLI help (
az_devops_help) for command syntax.Attach files to work items (
az_workitem_attach) up to 100MB, with optional comments.Pull request operations via REST: show PR details (
az_pr_show), list changes (az_pr_changes), list linked work items (az_pr_workitems), and comment/reply on PRs (az_pr_comment).Work item management via REST: view relations (
az_workitem_relations) and update fields or add discussion history (az_workitem_update).Generic REST calls (
az_rest) for endpoints not covered by dedicated tools.Host-side git operations (
az_git_fetch,az_git_ls_remote) to fetch refs or list remote branches, useful when sandbox network is restricted.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@azure-devops-cli-mcp list my active pull requests"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
azure-devops-cli-mcp
A local MCP server that bridges Claude Desktop / Cowork to the local Azure DevOps CLI.
Through it, Claude can fully use az devops, az repos, az boards, az pipelines, az artifacts.
Prerequisites
Node.js >= 20
Azure CLI (with the azure-devops extension):
az extension add --name azure-devopsaz logincompletedNo need for
az devops configure --defaults: the server automatically supplies default organization / project / repository (see "Startup parameters" below).
Related MCP server: Azure DevOps MCP Server
Installation (team members)
npm install -g git+https://github.com/A016098Tony/azure-devops-cli-mcp.gitThe repo already contains a compiled dist/, so no compilation is needed at install time. To update to a new version, just re-run the same command.
Note: the script is deliberately not named
build/prepare— when npm 11 installs a git package globally, anybuild/prepare/prepack/installscript in package.json triggers compilation on the installing side, which fails becausenpm_config_globalleaks into the inner npm. Naming itcompilelets the install flow skip compilation entirely.
Claude Desktop configuration
Open claude_desktop_config.json (full Windows path:
C:\Users\<你的帳號>\AppData\Roaming\Claude\claude_desktop_config.json; you can also open it from
Claude Desktop → Settings → Developer → Edit Config) and add to mcpServers:
{
"mcpServers": {
"azure-devops-cli": {
"command": "npx",
"args": ["azure-devops-cli-mcp", "--project", "MS", "--repository", "MS-Web"]
}
}
}This config file shares the same format between Claude Desktop (including Cowork) and Claude Code. The claude.ai web version does not support local stdio MCP servers.
Startup parameters
All three parameters are optional; built-in defaults are used when not specified:
Parameter | Default value | Description |
|
| A short name (e.g. |
|
| Default project |
|
| Only applies to |
When a command does not specify --org / --project (or repos pr does not specify --repository),
the server automatically fills in these defaults; when a command explicitly specifies them, the command wins.
If an az subcommand does not accept a filled-in parameter, the server automatically removes that parameter and retries once.
Windows + nvm note: the PATH inherited by desktop applications (GUI processes) may differ from the terminal's. If you see "npx not found", change
commandto the absolute path ofnpx.cmd(find it with(Get-Command npx.cmd).Source, e.g.C:\nvm4w\nodejs\npx.cmd);argsstays unchanged.
You must fully quit and restart Claude Desktop (closing the tab is not enough; quit entirely and reopen) for it to load.
After startup, you can see azure-devops-cli and its tools under the "+" → Connectors in the bottom-left of the chat box.
Tools
Tool | Purpose |
| Run any DevOps family command, e.g. |
| Look up command syntax; equivalent to |
| Upload a local file as a work item attachment and create a link (text and binary both supported, up to 100MB). For example, attach a code review report or error screenshot to a work item. |
| Get full PR information (REST), including source/target branch and status. |
| Get the list of files changed in a PR (REST iterations/changes), automatically using the latest iteration. |
| Get the list of work items linked to a PR (REST). |
| Get a work item including relations (REST, $expand=relations); can check for duplicate attachment names. |
| Post a comment in a PR discussion thread or reply to an existing thread (REST). |
| Update work item fields / write to Discussion (REST json-patch, only /fields/* allowed). |
| Generic Azure DevOps REST calls (GET/POST/PATCH) for endpoints not covered. |
| Run |
| Query remote refs on the host ( |
REST tools use the same authentication as az_workitem_attach: the AZURE_DEVOPS_EXT_PAT
environment variable takes priority, otherwise the az login credentials are used. All REST URLs are locked
to the default organization; requests cannot be sent to other hosts.
Only the five command groups devops, repos, boards, pipelines, and artifacts are allowed;
all other az commands (e.g. vm, account) are rejected. Authentication relies on the local az login
(az_workitem_attach internally runs az account get-access-token to obtain a token;
if the AZURE_DEVOPS_EXT_PAT environment variable is set, that PAT takes priority).
The server stores no credentials.
Security protection
Commands are executed via a shell, so commands containing shell control characters outside double quotes
(& | ; < > ( ) \ ^or newlines) or with unmatched double quotes are rejected, to prevent concatenations likerepos list & <任意命令>from bypassing the group restrictions and running arbitrary local commands. Parameter values containing special characters (e.g. WIQL or JMESPath expressions for--query) work fine when wrapped in double quotes, for example: boards query --wiql "SELECT [System.Id] FROM WorkItems WHERE [System.State] <> 'Closed'"`.
Git tools
az_git_fetch / az_git_ls_remote perform read-only git network operations on the host;
repoPath must be an absolute path on the host. az_git_ls_remote's patterns
accepts multiple patterns; refs matching any of them are listed (same as native git ls-remote).
Parameters are strictly validated: remote accepts only a name (not a URL), and refspec/patterns
must not start with - (blocking dangerous options like --upload-pack). No push, pull, or any write
operations are provided. Authentication uses the host's git credentials (e.g. Git Credential Manager).
Development
git clone https://github.com/A016098Tony/azure-devops-cli-mcp.git
npm install
npm test # vitest 單元 + 整合測試(不需要 az)
node scripts/smoke.mjs # 實機煙霧測試(需要 az login)After changing src/, be sure to run npm run compile and commit dist/ along with it —
the installing side uses the dist/ in the repo directly, and forgetting to recompile will give users the old behavior.
Available Tools
12 toolsaz_devopsAzure DevOps CLIA
執行 Azure DevOps CLI 命令(az 前綴由 server 自動加上,command 請勿包含)。允許的命令群組:devops、repos、boards、pipelines、artifacts。預設 organization 為 https://dev.azure.com/SKMHHIS、project 為 MS,repos pr 命令預設 repository 為 MS-Web(未指定時 server 會自動補上,通常不需要帶 --org/--project/--repository)。未指定 -o/--output 時自動使用 --output json。範例:"repos pr list --status active"、"boards work-item show --id 123"。不確定語法時,先用 az_devops_help 查詢。
Inputs: command (required), timeout.
az_devops_helpAzure DevOps CLI 說明查詢A
查詢 Azure DevOps CLI 命令的官方說明(等同 az --help)。在不確定子命令或參數語法時先用這個工具,再用 az_devops 執行。範例:command 傳 "boards work-item update" 會回傳該命令的完整參數說明。
Inputs: command (required).
az_git_fetchGit Fetch (host-side)A
在主機端對本機 repo 執行 git fetch(唯讀網路操作,不動工作目錄)。典型情境:Cowork sandbox 內 git fetch 被 proxy 擋下(403)時,用此工具在主機端代跑;完成後 sandbox 內即可用本機 git 操作 origin/。不提供 push/pull 等寫入操作。
Inputs: repoPath (required), prune, remote, refspec, +1 more.
az_git_ls_remoteGit Ls-Remote (host-side)A
在主機端查詢本機 repo 的遠端 refs(git ls-remote,不下載物件)。適合在 fetch 前快速確認遠端分支是否存在,例如確認 releases/s116/rc-092 存在於 origin。
Inputs: repoPath (required), tags, heads, remote, +2 more.
az_pr_changesList Pull Request ChangesA
以 REST API 取得 PR 的異動檔案清單(iteration changes)。未指定 iterationId 時自動使用最新 iteration,並在輸出開頭註明。預設 organization/project/repository 同 az_pr_show。
Inputs: prNumber (required), project, repository, iterationId.
az_pr_commentCreate Pull Request CommentA
在 PR 上留言。未指定 threadId 時建立新的討論串(可用 filePath/line 錨定到檔案行);指定 threadId 時回覆該討論串(此時忽略 filePath/line/status)。預設 organization/project/repository 同 az_pr_show。
Inputs: content (required), prNumber (required), line, status, +4 more.
az_pr_showShow Pull RequestB
以 REST API 取得 PR 完整資訊(title、sourceRefName、targetRefName、status 等)。預設 organization 為 https://dev.azure.com/SKMHHIS、project 為 MS、repository 為 MS-Web。
Inputs: prNumber (required), project, repository.
az_pr_workitemsList Pull Request Work ItemsB
以 REST API 取得 PR 關聯的 work item 清單(id 與 url)。預設 organization/project/repository 同 az_pr_show。
Inputs: prNumber (required), project, repository.
az_restAzure DevOps REST (generic)A
對 Azure DevOps 發送任意 REST 請求(GET/POST/PATCH)。優先使用專用工具(az_pr_show、az_pr_changes、az_pr_workitems、az_workitem_relations、az_pr_comment、az_workitem_update、az_workitem_attach);此工具僅供未涵蓋的端點使用。path 為 organization(https://dev.azure.com/SKMHHIS)之後的相對路徑,未帶 api-version 時自動補 7.1。
Inputs: path (required), method (required), body, timeout, +1 more.
az_workitem_attachAttach File to Work ItemA
將本機檔案上傳為 Azure DevOps work item 附件並建立連結(純文字與 binary 檔皆可,上限 100MB)。預設 organization 為 https://dev.azure.com/SKMHHIS、project 為 MS。認證優先使用 AZURE_DEVOPS_EXT_PAT 環境變數,否則使用 az login 的憑證。
Inputs: filePath (required), workItemId (required), comment, fileName.
az_workitem_relationsShow Work Item RelationsB
以 REST API 取得 work item 的完整資訊含 relations($expand=relations),可用於檢查附件(AttachedFile 的 attributes.name)是否已存在。預設 organization 為 https://dev.azure.com/SKMHHIS。
Inputs: workItemId (required).
az_workitem_updateUpdate Work Item FieldsA
以 REST API 更新 work item 欄位(json-patch 由 server 組裝,僅允許 /fields/*)。fields 的 key 為欄位參考名稱,例如 {"System.State": "Resolved"};historyComment 會寫入 System.History(等同在 Discussion 留言)。fields 與 historyComment 至少要提供一個。預設 organization 為 https://dev.azure.com/SKMHHIS。
Inputs: workItemId (required), fields, historyComment.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Tools are mostly distinct: the dedicated az_pr_* and az_workitem_* tools target specific resources and are clearly differentiated from the generic az_devops CLI passthrough and az_rest fallback. Minor ambiguity exists between az_devops (which can also run PR/workitem commands) and the dedicated REST tools, though the descriptions explicitly advise using the dedicated tools first. The az_git_fetch vs az_git_ls_remote pair is well-separated by read-only scope.
There are two conventions mixed: a non-prefixed 'az_devops'/'az_devops_help' pair and a prefixed 'az_rest', 'az_git_fetch', 'az_git_ls_remote', plus camelCase-free hyphenated domain tools (az_pr_show, az_workitem_attach). The az_* prefix is consistent but the grouping/casing is inconsistent—some use domain_verb (az_pr_show), some use verb placement like az_git_fetch. Not chaotic, but not a single predictable pattern.
12 tools for an Azure DevOps MCP server is reasonable. Each dedicated tool earns its place by covering a commonly-needed operation with the REST API, while the generic az_devops passthrough and az_rest fallbacks consolidate the remaining surface. Slightly on the higher end but justified by the breadth of Azure DevOps domains covered.
The tool surface covers a broad set of Azure DevOps operations: CLI passthrough for the main command groups, help lookup, PR inspection (show/changes/workitems/comment), work item management (attach/update/relations), generic REST passthrough, and git helpers. Notable gaps: no dedicated tool for creating a PR (relies on az_devops CLI), and the git tools are read-only helpers rather than full git coverage, but these are reasonable trade-offs given the generic az_devops passthrough and az_rest fallback.
Related MCP Connectors
The MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
An MCP server that let you interact with Cycloid.io Internal Development Portal and Platform
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Related MCP Servers
- AlicenseBqualityDmaintenanceA read-only MCP server connecting AI assistants to Azure DevOps Server (on-premises) for browsing projects, repos, builds, work items, releases, pipelines, and test results.391MIT
- AlicenseAqualityDmaintenanceAn MCP server that exposes 41 Azure DevOps tools to AI assistants, enabling management of pipelines, repositories, pull requests, releases, work items, test management, and wikis through natural language.4139 PyPIMIT
- AlicenseBqualityDmaintenanceAzure DevOps MCP tools for Claude Code and Codex CLI, enabling interaction with boards, work items, repos, and pull requests via natural language.1330 PyPIMIT
- FlicenseBqualityDmaintenanceAn MCP server that enables AI assistants to interact with Azure DevOps projects, work items, repositories, pipelines, wikis, and more via 21 tools.21-