remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Integrations
Utilizes environment variables for configuration of organization URL, Personal Access Token, and default project settings.
Enables interaction with Git repositories in Azure DevOps, including accessing repository details and branch information.
Runs on Node.js to provide a server implementation for communicating with Azure DevOps resources via the Model Context Protocol.
Azure DevOps MCP 服务器
Azure DevOps 的模型上下文协议 (MCP) 服务器实现,允许 AI 助手通过标准化协议与 Azure DevOps API 进行交互。
概述
该服务器实现了 Azure DevOps 的模型上下文协议 (MCP) ,使 Claude 等 AI 助手能够安全地与 Azure DevOps 资源交互。该服务器充当 AI 模型和 Azure DevOps API 之间的桥梁,提供了一种标准化的方式:
- 访问和管理项目、工作项、存储库等
- 创建和更新工作项、分支和拉取请求
- 通过自然语言执行常见的 DevOps 工作流程
- 通过标准化资源 URI 访问存储库内容
- 安全地验证并与 Azure DevOps 资源交互
服务器结构
该服务器围绕模型上下文协议 (MCP) 构建,用于与 AI 助手进行通信。它提供了与 Azure DevOps 资源交互的工具,包括:
- 项目
- 工作项目
- 存储库
- 拉取请求
- 分支
- 管道
核心组件
- AzureDevOpsServer :初始化 MCP 服务器并注册工具的主服务器类
- 工具处理程序:每个 Azure DevOps 操作的模块化功能
- 配置:基于环境的组织 URL、PAT 等配置。
入门
先决条件
- Node.js(v16+)
- npm 或 yarn
- 具有适当访问权限的 Azure DevOps 帐户
- 身份验证凭证(详情请参阅身份验证指南):
- 个人访问令牌 (PAT),或
- Azure 身份凭据,或
- Azure CLI 登录
使用 NPX 运行
与 Claude Desktop/Cursor AI 一起使用
要与 Claude Desktop 或 Cursor AI 集成,请将以下配置之一添加到您的配置文件中。
Azure 身份验证
确保您已使用az login
登录到 Azure CLI,然后添加以下内容:
个人访问令牌 (PAT) 身份验证
有关详细的配置说明和更多身份验证选项,请参阅身份验证指南。
身份验证方法
此服务器支持多种用于连接到 Azure DevOps API 的身份验证方法。有关详细的设置说明、配置示例和故障排除提示,请参阅身份验证指南。
支持的身份验证方法
- 个人访问令牌(PAT) ——基于令牌的简单身份验证
- Azure Identity(DefaultAzureCredential) - 使用 Azure Identity SDK 进行灵活的身份验证
- Azure CLI - 使用 Azure CLI 登录名进行身份验证
每种身份验证方法的示例配置文件都可以在示例目录中找到。
环境变量
有关环境变量及其描述的完整列表,请参阅身份验证指南。
关键环境变量包括:
多变的 | 描述 | 必需的 | 默认 |
---|---|---|---|
AZURE_DEVOPS_AUTH_METHOD | 身份验证方法( pat 、 azure-identity 或azure-cli )- 不区分大小写 | 不 | azure-identity |
AZURE_DEVOPS_ORG_URL | 您的 Azure DevOps 组织的完整 URL | 是的 | - |
AZURE_DEVOPS_PAT | 个人访问令牌(用于 PAT 身份验证) | 仅限 PAT 授权 | - |
AZURE_DEVOPS_DEFAULT_PROJECT | 如果未指定,则使用默认项目 | 不 | - |
AZURE_DEVOPS_API_VERSION | 要使用的 API 版本 | 不 | 最新的 |
AZURE_TENANT_ID | Azure AD 租户 ID(用于服务主体) | 仅限服务主体 | - |
AZURE_CLIENT_ID | Azure AD 应用程序 ID(用于服务主体) | 仅限服务主体 | - |
AZURE_CLIENT_SECRET | Azure AD 客户端机密(用于服务主体) | 仅限服务主体 | - |
LOG_LEVEL | 日志级别(调试、信息、警告、错误) | 不 | 信息 |
身份验证故障排除
有关每种身份验证方法的详细故障排除信息,请参阅身份验证指南。
常见问题包括:
- 凭证无效或过期
- 权限不足
- 网络连接问题
- 配置错误
身份验证实现细节
有关如何在 Azure DevOps MCP 服务器中实现身份验证的技术细节,请参阅身份验证指南和src/auth
目录中的源代码。
可用工具
Azure DevOps MCP 服务器提供了多种用于与 Azure DevOps 资源交互的工具。有关每个工具的详细文档,请参阅相应的文档。
用户工具
get_me
:获取已验证用户的详细信息(id、displayName、email)
组织工具
list_organizations
:列出所有可访问的组织
项目工具
list_projects
:列出组织中的所有项目get_project
:获取特定项目的详细信息get_project_details
:获取项目的全面详细信息,包括流程、工作项类型和团队
存储库工具
list_repositories
:列出项目中的所有存储库get_repository
:获取特定存储库的详细信息get_repository_details
:获取有关存储库的详细信息,包括统计信息和参考get_file_content
:从存储库获取文件或目录的内容
工作项工具
get_work_item
:通过 ID 检索工作项create_work_item
:创建一个新的工作项update_work_item
:更新现有工作项list_work_items
:列出项目中的工作项manage_work_item_link
:添加、删除或更新工作项之间的链接
搜索工具
search_code
:在项目中的存储库中搜索代码search_wiki
:在项目中的 wiki 页面中搜索内容search_work_items
:在 Azure DevOps 中跨项目搜索工作项
有关所有工具的综合文档,请参阅工具文档。
贡献
欢迎贡献!贡献指南请参阅CONTRIBUTING.md 。
星史
执照
麻省理工学院
You must be authenticated.
Tools
模型上下文协议服务器,使 AI 助手能够通过标准化协议与 Azure DevOps 资源(包括项目、工作项、存储库、拉取请求、分支和管道)进行交互。
- Overview
- Server Structure
- Getting Started
- Authentication Methods
- Environment Variables
- Troubleshooting Authentication
- Authentication Implementation Details
- Available Tools
- Contributing
- Star History
- License
Related Resources
Appeared in Searches
- A server for information about Jenkins (automation server)
- A system for monitoring and operating terminals
- Azure DevOps and Azure Repos Integration for Developer Workflows
- A platform for hosting and collaborating on software projects
- A tool or assistant to review and suggest changes for GitHub pull requests