@slorenzot/mcp-azure
@slorenzot/mcp-azure
用于 Azure DevOps 的 MCP (Model Context Protocol) 服务器。它允许从任何兼容的 MCP 客户端与工作项、Git 仓库、Pull Request、冲刺、区域、评论和附件进行交互。
安装
npm install -g @slorenzot/mcp-azure或者直接使用 npx:
npx @slorenzot/mcp-azureRelated MCP server: devops-wrangler
配置
环境变量
服务器使用以下环境变量自动配置:
变量 | 替代方案 | 描述 | 必需 |
|
| 组织 URL (例如: | 是 |
|
| 个人访问令牌 (Personal Access Token) | 是 |
|
| 项目名称 | 否 |
在 Claude Desktop 中配置
在你的 claude_desktop_config.json 文件中添加以下配置:
{
"mcpServers": {
"azure-devops": {
"command": "npx",
"args": ["-y", "@slorenzot/mcp-azure"],
"env": {
"AZURE_DEVOPS_ORG": "https://dev.azure.com/tu-organizacion",
"AZURE_DEVOPS_PAT": "tu-pat-aqui",
"AZURE_DEVOPS_PROJECT": "tu-proyecto"
}
}
}
}在 OpenCode 中配置
OpenCode 使用相同的 MCP,但可以通过两种方式进行配置:
选项 1:使用环境变量进行初始配置
在你的系统或 OpenCode 配置中设置环境变量:
export AZURE_DEVOPS_ORG="https://dev.azure.com/tu-organizacion" export AZURE_DEVOPS_PAT="tu-pat-aqui" export AZURE_DEVOPS_PROJECT="tu-proyecto"或者在你的 OpenCode 配置中添加 MCP 服务器:
{ "mcpServers": { "azure-devops": { "command": "npx", "args": ["-y", "@slorenzot/mcp-azure"], "env": { "AZURE_DEVOPS_ORG": "https://dev.azure.com/tu-organizacion", "AZURE_DEVOPS_PAT": "tu-pat-aqui", "AZURE_DEVOPS_PROJECT": "tu-proyecto" } } } }
选项 2:使用 ado_configure 进行动态配置
OpenCode 允许在会话期间使用 ado_configure 命令直接配置连接:
{
"organization": "https://dev.azure.com/tu-organizacion",
"project": "tu-proyecto",
"pat": "tu-pat-aqui"
}此选项适用于在不同组织或项目之间切换,而无需修改配置文件。
注意:当你使用 ado_configure 时,连接在当前的 OpenCode 会话期间保持有效。
获取个人访问令牌 (PAT)
前往你的 Azure DevOps 组织
点击你的头像(右上角)
选择 Personal Access Tokens
创建一个具有以下权限的新令牌:
Work Items: Read & Write
Code: Read & Write (用于仓库和 Pull Request 操作)
Project and Team: Read (可选)
可用工具
身份验证
工具 | 描述 |
| 配置组织、项目和 PAT 的连接 |
工作项 (Work Items)
工具 | 描述 |
| 通过 ID 获取工作项 |
| 创建新的工作项 (用户故事、Bug、任务等) |
| 更新现有的工作项 |
| 获取类型的可用/必需字段 |
查询
工具 | 描述 |
| 查询特定冲刺的工作项 |
| 查询特定区域的工作项 |
| 执行自定义 WIQL 查询 |
项目结构
工具 | 描述 |
| 列出项目的迭代/冲刺 |
| 列出项目的区域 |
Git 仓库
工具 | 描述 |
| 列出项目的所有 Git 仓库 |
| 通过名称或 ID 获取特定仓库的详细信息 |
| 列出仓库的分支 |
Pull Requests
工具 | 描述 |
| 列出带有可选过滤器 (状态、分支、创建者、审阅者) 的 Pull Request |
| 获取 Pull Request 的完整详细信息 |
| 创建新的 Pull Request |
| 更新 Pull Request 的属性 (标题、描述、草稿) |
| 使用可配置策略完成 (合并) Pull Request |
| 放弃 Pull Request |
Pull Request 审阅
工具 | 描述 |
| 批准 Pull Request (投票: 10) |
| 拒绝 Pull Request (投票: -10) |
| 获取 Pull Request 的所有审阅者及其投票 |
| 向 Pull Request 添加审阅者 |
Pull Request 评论
工具 | 描述 |
| 获取 Pull Request 的所有评论线程 |
| 创建新的评论线程 (通用或代码相关) |
| 回复现有的评论线程 |
Pull Request 信息
工具 | 描述 |
| 获取 Pull Request 的所有提交 |
| 获取链接到 Pull Request 的工作项 |
| 更新评论线程的状态 (Fixed, WontFix 等) |
评论与讨论
工具 | 描述 |
| 向工作项添加评论 (支持 Markdown) |
| 获取工作项的评论 |
附件
工具 | 描述 |
| 上传文件并返回附件 URL |
| 将附件添加到工作项 |
| 列出工作项的附件 |
使用示例
创建用户故事
{
"title": "Implementar login con OAuth",
"type": "User Story",
"description": "Como usuario quiero poder iniciar sesión con mi cuenta de Google",
"areaPath": "MiProyecto\\Backend",
"iterationPath": "MiProyecto\\Sprint 5",
"fields": {
"Custom.OKR": "Seguridad",
"Custom.Prioridad": "Alta"
}
}自定义 WIQL 查询
{
"wiql": "SELECT [System.Id], [System.Title] FROM WorkItems WHERE [System.State] = 'Active' AND [System.AssignedTo] = @Me ORDER BY [System.CreatedDate] DESC",
"getDetails": true
}添加 Markdown 评论
{
"id": 12345,
"comment": "## Análisis completado\n\n- Revisado el código\n- Identificados 3 issues\n\n**Próximo paso:** Corregir validaciones"
}上传并附加文件
{
"workItemId": 12345,
"filePath": "/ruta/al/archivo.pdf",
"comment": "Documento de especificaciones",
"name": "Especificaciones Funcionales v2.0"
}链接现有附件
{
"workItemId": 12345,
"attachmentUrl": "https://dev.azure.com/org/proj/_apis/wit/attachments/abc123",
"comment": "Diseño de arquitectura",
"name": "Arquitectura del Sistema"
}列出仓库
{
"includeHidden": false,
"top": 50
}列出活跃的 Pull Request
{
"status": "Active",
"top": 20
}创建 Pull Request
{
"repositoryId": "mi-repo",
"sourceRefName": "refs/heads/feature-login",
"targetRefName": "refs/heads/main",
"title": "Implementar login con OAuth",
"description": "Esta PR agrega soporte para login con Google OAuth",
"reviewerIds": ["12345678-1234-1234-1234-1234567890ab"],
"isDraft": false
}批准 Pull Request
{
"pullRequestId": 12345,
"repositoryId": "mi-repo"
}完成 (合并) Pull Request
{
"pullRequestId": 12345,
"repositoryId": "mi-repo",
"mergeStrategy": "Squash",
"deleteSourceBranch": true,
"mergeCommitMessage": "Merge de feature-login"
}创建代码评论
{
"pullRequestId": 12345,
"repositoryId": "mi-repo",
"content": "Por favor extraer esto en una función separada",
"filePath": "/src/components/Login.tsx",
"startLine": 45,
"endLine": 52
}可用提示词 (Prompts)
服务器包含预定义的提示词,以简化常见任务:
提示词 | 描述 |
| 连接到 Azure DevOps 的指南 |
| 分析冲刺状态 |
| 创建结构化的用户故事 |
| 生成每日站会报告 |
| 协助规划冲刺 |
| 批量更新工作项 |
| 生成项目报告 |
| 创建结构化的 Bug 报告 |
资源
资源 | URI | 描述 |
连接状态 |
| 当前连接状态信息 |
开发
要求
Node.js 18+
npm 或 yarn
本地安装
git clone https://github.com/slorenzot/mcp-azure.git
cd mcp-azure
npm install
npm run build可用脚本
npm run build # Compila TypeScript
npm run start # Inicia el servidor
npm run dev # Modo desarrollo con watch许可证
MIT
作者
Soulberto Lorenzo - @slorenzot
版本
2.4.1 - 34 个可用于 Azure DevOps 的工具 (工作项、Git 仓库、Pull Request 等)
Available Tools
36 toolsado_abandon_pull_requestC
Abandona un Pull Request (cambia estado a Abandoned).
Inputs: pullRequestId (required), repositoryId.
ado_add_attachmentB
Agrega un adjunto a un Work Item existente. Maneja automáticamente concurrencia cuando múltiples adjuntos se agregan al mismo WI.
Inputs: workItemId (required), name, comment, filePath, +1 more.
ado_add_commentB
Agrega un comentario/entrada de discusión a un Work Item. Soporta formato Markdown.
Inputs: id (required), comment (required).
ado_add_pull_request_reviewerB
Agrega un revisor a un Pull Request.
Inputs: reviewerId (required), pullRequestId (required), vote, repositoryId.
ado_approve_pull_requestB
Aprueba un Pull Request (voto: 10).
Inputs: pullRequestId (required), reviewerId, repositoryId.
ado_complete_pull_requestC
Completa (merge) un Pull Request.
Inputs: pullRequestId (required), repositoryId, mergeStrategy, deleteSourceBranch, +2 more.
ado_configureB
Configura la conexión a Azure DevOps con token de acceso personal (PAT).
Inputs: pat (required), project (required), organization (required).
ado_create_pull_requestC
Crea un nuevo Pull Request.
Inputs: title (required), repositoryId (required), sourceRefName (required), targetRefName (required), +3 more.
ado_create_pull_request_threadB
Crea un nuevo hilo de comentarios (comentario general o comentario de código).
Inputs: content (required), pullRequestId (required), endLine, filePath, +2 more.
ado_create_work_itemA
Crea un nuevo Work Item en Azure DevOps. Usa ado_get_work_item_type_fields para ver campos requeridos.
Inputs: type (required), title (required), fields, areaPath, +3 more.
ado_delete_attachmentB
Elimina un adjunto de un Work Item removiendo su relación. Maneja automáticamente concurrencia cuando múltiples cambios afectan el mismo WI.
Inputs: workItemId (required), comment, attachmentUrl, attachmentName.
ado_delete_work_itemA
Elimina un Work Item en Azure DevOps. Por defecto realiza borrado lógico; usa destroy=true solo para eliminación permanente.
Inputs: id (required), confirm (required), destroy, expectedType.
ado_get_attachmentsB
Obtiene la lista de adjuntos de un Work Item
Inputs: id (required).
ado_get_commentsB
Obtiene los comentarios/historial de discusión de un Work Item
Inputs: id (required), top.
ado_get_pull_requestC
Obtiene detalles completos de un Pull Request.
Inputs: pullRequestId (required), repositoryId, includeCommits, includeWorkItems.
ado_get_pull_request_commitsC
Obtiene todos los commits de un Pull Request.
Inputs: pullRequestId (required), top, repositoryId.
ado_get_pull_request_reviewersA
Obtiene todos los revisores y sus votos de un Pull Request.
Inputs: pullRequestId (required), repositoryId.
ado_get_pull_request_threadsB
Obtiene todos los hilos de comentarios de un Pull Request.
Inputs: pullRequestId (required), repositoryId.
ado_get_pull_request_work_itemsB
Obtiene los work items vinculados a un Pull Request.
Inputs: pullRequestId (required), repositoryId.
ado_get_repositoryB
Obtiene detalles de un repositorio específico por nombre o ID.
Inputs: repositoryId (required).
ado_get_work_itemB
Obtiene un Work Item de Azure DevOps por su ID
Inputs: id (required), full.
ado_get_work_item_type_fieldsB
Obtiene los campos disponibles y requeridos para un tipo de Work Item
Inputs: workItemType (required).
ado_list_areasA
Lista las áreas disponibles en el proyecto
Inputs: no named parameters.
ado_list_branchesB
Lista las ramas (branches) de un repositorio.
Inputs: repositoryId (required), filter, includeStatuses.
ado_list_iterationsA
Lista las iteraciones/sprints disponibles en el proyecto
Inputs: no named parameters.
ado_list_pull_requestsA
Lista Pull Requests con filtros opcionales. Busca por repositorio o en todo el proyecto.
Inputs: top, status, creatorId, reviewerId, +3 more.
ado_list_repositoriesA
Lista todos los repositorios Git del proyecto.
Inputs: top, includeHidden.
ado_query_areaC
Consulta User Stories de un área específica en Azure DevOps
Inputs: areaPath (required), workItemType.
ado_query_sprintA
Consulta User Stories de un sprint específico en Azure DevOps
Inputs: iterationPath (required), state.
ado_query_wiqlC
Ejecuta una consulta WIQL personalizada en Azure DevOps
Inputs: wiql (required), getDetails.
ado_reject_pull_requestC
Rechaza un Pull Request (voto: -10).
Inputs: pullRequestId (required), reviewerId, repositoryId.
ado_reply_to_pull_request_threadC
Responde a un hilo de comentarios existente.
Inputs: content (required), threadId (required), pullRequestId (required), repositoryId.
ado_update_pull_requestC
Actualiza propiedades de un Pull Request (título, descripción, estado de borrador).
Inputs: pullRequestId (required), title, isDraft, description, +1 more.
ado_update_pull_request_thread_statusC
Actualiza el estado de un hilo de comentarios (ej: marcar como Fixed, WontFix, etc.).
Inputs: status (required), threadId (required), pullRequestId (required), repositoryId.
ado_update_work_itemC
Actualiza un Work Item existente en Azure DevOps
Inputs: id (required), state, title, fields, +2 more.
ado_upload_attachmentC
Sube un archivo como adjunto a Azure DevOps y devuelve la URL del adjunto
Inputs: filePath (required), fileName.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 36 tools
Each tool targets a distinct action and resource (e.g., create vs update vs delete work items, add vs upload attachments). No two tools have ambiguous purposes, ensuring clear agent selection.
All tools follow the consistent pattern 'ado_verb_noun' (e.g., ado_create_work_item, ado_list_repositories). The prefix and verb-noun structure are uniform, making it easy to predict tool names.
36 tools is slightly above the typical range, but the Azure DevOps domain is broad. Each tool covers a necessary operation (work items, PRs, repositories, queries, etc.), so the count feels justified rather than bloated.
The tool surface covers the main workflows: CRUD for work items and pull requests, attachments, comments, threads, repositories, and queries. Minor gaps exist (e.g., no create/delete branch or build pipeline tools), but core operations are present.
Maintenance
Related MCP Connectors
The MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.
Devopness MCP server for DevOps happiness! Empower AI Agents to deploy apps and infra, to any cloud.
MCP server for building and testing AI agents with multi-model experimentation and insights.
One MCP server for the services your AI needs: memory, files, Microsoft 365, kanban and more.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP server that enables AI assistants to manage Azure DevOps resources including Work Items, Git repositories, pipelines, and user identities.20 npmMIT
- AlicenseAqualityDmaintenanceAn MCP server for Azure DevOps work item management that enables AI assistants to create, query, update, and manage work items, sprints, and more.129 npmISC
- AlicenseNot gradedqualityDmaintenanceMCP server for Azure DevOps Server 2022 (on-premises) that enables AI assistants to interact with work items, repositories, builds, and sprints through 29 tools.33 npmMIT
- AlicenseNot gradedqualityDmaintenanceA focused MCP server for Azure DevOps work item administration, enabling AI agents to create, update, query, and manage work items with full CRUD operations and advanced WIQL querying.MIT