MCP Azure DevOps 服务
一种模型上下文协议服务器, enables AI助手与Azure DevOps服务进行交互,允许用户查询工作项,并计划支持创建/更新项目、管理管道、处理拉取请求以及管理冲刺和分支策略。
服务介绍
MCP Azure DevOps Server
一个模型上下文协议(MCP)服务器,使AI助手能够与Azure DevOps服务进行交互。
概览
此项目实现了一个模型上下文协议(MCP)服务器,允许AI助手(如Claude)与Azure DevOps互动,为自然语言交互和Azure DevOps REST API之间提供了桥梁。
功能
目前已实现的功能:
工作项管理
- 查询工作项:使用WIQL查询搜索工作项
- 获取工作项详情:查看完整的工作项信息
- 创建工作项:添加新的任务、错误、用户故事等工作项类型
- 更新工作项:修改现有工作项的字段和属性
- 添加评论:在工作项上发布评论
- 查看评论:检索工作项的评论历史记录
- 父子关系:建立工作项之间的层次结构
项目管理
- 获取项目:查看组织中所有可访问的项目
- 获取团队:列出组织内的所有团队
- 团队成员:查看团队成员信息
- 团队区域路径:检索分配给团队的区域路径
- 团队迭代:访问团队迭代/冲刺配置
计划中的功能:
- 管道操作:查询管道状态并触发新的管道运行
- 拉取请求处理:创建、更新和审查拉取请求
- 冲刺管理:规划和管理冲刺和迭代
- 分支策略管理:配置和管理分支策略
入门指南
前提条件
- Python 3.10+
- 具有适当权限的Azure DevOps账户
- 用于访问Azure DevOps API的个人访问令牌(PAT),且具备必要的范围
安装
# Clone the repository
git clone https://github.com/Vortiago/mcp-azure-devops.git
cd mcp-azure-devops
# Install in development mode
uv pip install -e ".[dev]"
# Install from PyPi
pip install mcp-azure-devops
配置
在项目根目录下创建一个.env文件,并包含以下变量:
AZURE_DEVOPS_PAT=your_personal_access_token
AZURE_DEVOPS_ORGANIZATION_URL=https://your-organization.visualstudio.com or https://dev.azure.com/your-organisation
注意:请确保提供您Azure DevOps组织的完整URL。
运行服务器
# Development mode with the MCP Inspector
mcp dev src/mcp_azure_devops/server.py
# Install in Claude Desktop
mcp install src/mcp_azure_devops/server.py --name "Azure DevOps Assistant"
使用示例
查询工作项
Show me all active bugs assigned to me in the current sprint
创建工作项
Create a user story in the ProjectX with the title "Implement user authentication" and assign it to john.doe@example.com
更新工作项
Change the status of bug #1234 to "Resolved" and add a comment explaining the fix
团队管理
Show me all the team members in the "Core Development" team in the "ProjectX" project
查看项目结构
List all projects in my organization and show me the iterations for the Development team
开发
该项目按照功能模块结构化,每个模块实现了特定的Azure DevOps功能:
features/work_items:工作项管理功能features/projects:项目管理能力features/teams:团队管理特性utils:通用工具和客户端初始化
有关开发的更多信息,请参阅CLAUDE.md文件。
贡献
欢迎贡献!请随时提交Pull Request。
许可证
本项目根据MIT许可证许可 - 详情见LICENSE文件。