使用说明
Azure DevOps MCP服务器
用于Azure DevOps工作项跟踪集成的MCP(模型上下文协议)服务器。使Claude等AI助手能够在Azure DevOps中搜索、创建、更新和管理工作项。
特性
- 搜索工作项:使用WIQL(工作项查询语言)进行查询
- 获取工作项:按ID检索详细的工作项信息
- 创建工作项:创建Bug、任务、用户故事、功能等。
- 更新工作项:修改字段、更改状态、更新分配
- 添加注释:向工作项添加讨论评论
安装
npm install @bugzy-ai/azure-devops-mcp-server
或者直接使用npx运行:
npx @bugzy-ai/azure-devops-mcp-server
配置
环境变量
| 变量 | 必填 | 描述 |
|---|---|---|
AZURE_DEVOPS_ORG_URL |
是 | 组织URL(例如。, https://dev.azure.com/myorg) |
AZURE_DEVOPS_PAT |
是 | 个人访问令牌 |
AZURE_DEVOPS_MCP_DEBUG |
否 | 启用调试日志记录 .azure-devops-mcp/mcp.log |
注: 项目名称是根据请求指定的,而不是通过环境变量指定的。AI代理从上下文中发现项目(例如。,
.bugzy/runtime/project-context.md)或使用azuredevops_list_projects查找可用项目。
创建个人访问令牌(PAT)
- 转到Azure DevOps→ 用户设置→ 个人访问令牌
- 点击“新建令牌”
- 设置所需的范围:
vso.work-读取工作项vso.work_write-创建和更新工作项
- 复制令牌并将其设置为
AZURE_DEVOPS_PAT
MCP配置
添加到您的MCP配置文件中(例如。, claude_desktop_config.json):
{
"mcpServers": {
"azure-devops": {
"command": "npx",
"args": ["@bugzy-ai/azure-devops-mcp-server"],
"env": {
"AZURE_DEVOPS_ORG_URL": "https://dev.azure.com/your-org",
"AZURE_DEVOPS_PAT": "your-pat-token"
}
}
}
}
工具
azure devops_list_项目
列出Azure DevOps组织中的所有项目。使用此功能可发现可用项目。
{
top?: number, // Max projects to return (default: 100, max: 100)
skip?: number // Number to skip for pagination (default: 0)
}
azuredevops_search_work_items
使用WIQL查询搜索工作项。
{
project: string, // Azure DevOps project name (required)
wiql: string, // WIQL query
maxResults?: number // Max results (default: 50, max: 200)
}
WIQL查询示例:
-- Find open bugs
SELECT [System.Id], [System.Title], [System.State]
FROM WorkItems
WHERE [System.WorkItemType] = 'Bug'
AND [System.State] <> 'Closed'
ORDER BY [System.CreatedDate] DESC
-- Find work items assigned to me
SELECT [System.Id], [System.Title]
FROM WorkItems
WHERE [System.AssignedTo] = @Me
AND [System.State] = 'Active'
-- Find recent items in a specific area
SELECT [System.Id], [System.Title], [System.WorkItemType]
FROM WorkItems
WHERE [System.AreaPath] UNDER 'Project\Team'
AND [System.CreatedDate] >= @Today - 7
azure devops_getwork_item
获取有关工作项的详细信息。
{
project: string, // Azure DevOps project name (required)
id: number, // Work item ID
fields?: string[], // Specific fields to retrieve
expand?: "None" | "Relations" | "Fields" | "Links" | "All"
}
azuredevops_create_work_item
创建新工作项。
{
project: string, // Azure DevOps project name (required)
type: string, // "Bug", "Task", "User Story", etc.
title: string, // Work item title
description?: string, // Description (HTML supported)
areaPath?: string, // Area path
iterationPath?: string,// Iteration/sprint path
assignedTo?: string, // User email or display name
priority?: number, // 1-4 (1=Critical, 4=Low)
severity?: string, // For bugs: "1 - Critical", "2 - High", etc.
tags?: string, // Semicolon-separated tags
parentId?: number // Parent work item ID
}
azuredevops_update_work_item
使用JSON补丁操作更新现有工作项。
{
project: string, // Azure DevOps project name (required)
id: number,
operations: Array<{
op: "add" | "remove" | "replace",
path: string, // e.g., "/fields/System.State"
value?: any
}>
}
示例-将状态更改为“活动”:
{
"id": 123,
"operations": [
{ "op": "replace", "path": "/fields/System.State", "value": "Active" }
]
}
azuredevops_add_注释
向工作项添加注释。
{
project: string, // Azure DevOps project name (required)
id: number, // Work item ID
text: string // Comment text (HTML supported)
}
发展
# Install dependencies
npm install
# Build
npm run build
# Run with MCP Inspector (for testing)
npm run dev
# Watch mode
npm run build:watch
调试
通过设置启用调试日志记录 AZURE_DEVOPS_MCP_DEBUG=true。日志将写入 .azure-devops-mcp/mcp.log.
许可证
麻省理工学院