Token导航 LogoToken导航TokenDH.com
Simple Azure Devops MCP logo
运维云端未说明官方级别未说明来源级核验

Simple Azure Devops MCP

MCP Server

一个使用Azure CLI审查Azure DevOps Pull Request评论的模型上下文协议(MCP)服务器,提供评论检索、状态过滤和Azure CLI验证功能。

工具数

2

提示词数

0

GitHub Stars

0

资源数

0
Azure DevOps开发工具TypeScriptClaudeClaude DesktopClaudeClineVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

tacone

提供方

tacone

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

Azure PR MCP服务器

模型上下文协议(MCP)服务器,用于使用Azure CLI查看Azure DevOps Pull Request注释。

🔒 只读。

🤖 由AI为AI制造。

特性

  • Azure CLI验证 -自动检查Azure CLI的可用性
  • 🔐 身份验证处理 -验证Azure CLI身份验证状态
  • 💬 PR评论检索 -获取带有完整元数据的PR评论
  • 🔍 状态筛选 -按状态(活动、固定、关闭等)过滤评论
  • 🧪 单元测试 -使用Vitest的全面测试覆盖率

先决条件

  1. Node.js >= 18
  2. pnpm >= 9.0.0
  3. Azure命令行界面 - 安装指南
  4. Azure DevOps组织 -通过pull请求访问Azure DevOps组织

安装

安装依赖项

pnpm install

构建项目

pnpm build

Azure CLI安装程序

  1. 安装Azure命令行界面 (如果尚未安装):

- macOS: brew install azure-cli - Windows:从下载 微软文档 - Linux:关注 Linux安装指南

  1. 登录Azure:
   az login
  1. Azure DevOps扩展将自动安装 当你第一次使用服务器时。

用法

运行MCP服务器

服务器在stdio上运行,设计用于MCP客户端:

node dist/index.js

可用工具

1. check_azure_cli

检查是否安装了Azure CLI以及用户是否经过身份验证。

输入:无

输出:

{
  "cli_installed": true,
  "cli_version": "2.50.0",
  "authenticated": true,
  "account": "user@example.com",
  "devops_extension": true,
  "status": "ready"
}

2. get_pr_comments

使用可选的状态筛选从Azure DevOps Pull Request中检索注释。

输入:

  • pr_url (必填):完整的Azure DevOps PR URL

- 格式: https://dev.azure.com/{org}/{project}/_git/{repo}/pullrequest/{id} - 传统格式: https://{org}.visualstudio.com/{project}/_git/{repo}/pullrequest/{id}

  • status_filter (可选):按评论状态筛选

- 选项: active, fixed, closed, wontfix, pending, bydesign, unknown, system

输出:

{
  "pr_url": "https://dev.azure.com/myorg/myproject/_git/myrepo/pullrequest/123",
  "status_filter": "active",
  "total_comments": 5,
  "comments": [
    {
      "id": 1,
      "thread_id": 100,
      "author": "John Doe",
      "author_email": "john.doe@example.com",
      "content": "Please add error handling here",
      "status": "active",
      "thread_status": "active",
      "comment_type": "text",
      "published_date": "2025-11-20T10:30:00Z",
      "last_updated_date": "2025-11-20T10:30:00Z"
    }
  ]
}

PR URL格式示例

https://dev.azure.com/myorg/myproject/_git/myrepo/pullrequest/123

https://myorg.visualstudio.com/myproject/_git/myrepo/pullrequest/456

MCP客户端配置

VS代码与GitHub副本(用户级全局配置)

要跨所有工作区进行全局访问,请将服务器添加到用户级MCP配置中:

文件位置: ~/.config/Code/User/mcp.json (Linux/macOS)或 %APPDATA%\Code\User\mcp.json (Windows)

将此条目添加到 servers 对象:

{
  "servers": {
    "simple-azure-devops-mcp": {
      "command": "node",
      "type": "stdio",
      "args": ["/absolute/path/to/azure-mcp/dist/index.js"]
    }
  }
}

重要:替换 /absolute/path/to/azure-mcp/dist/index.js 使用构建项目的实际路径。

设置步骤:

  1. 构建项目: pnpm build
  2. 编辑 ~/.config/Code/User/mcp.json 并添加服务器配置
  3. 重新加载VS代码窗口(Cmd/Ctrl+Shift+P→ “开发人员:重新加载窗口”)
  4. 打开GitHub Copilot聊天
  5. MCP工具将在所有工作区中可用

VS代码与GitHub副本(工作区级别)

创建或编辑 .vscode/settings.json 为当前工作区自动启用MCP服务器:

{
  "github.copilot.chat.mcp.enabled": true,
  "github.copilot.chat.mcp.servers": {
    "simple-azure-devops-mcp": {
      "command": "node",
      "args": ["${workspaceFolder}/dist/index.js"]
    }
  }
}

设置步骤:

  1. 在VS Code中打开此工作区
  2. 确保项目建成: pnpm build
  3. 重新加载VS代码窗口(Cmd/Ctrl+Shift+P→ “开发人员:重新加载窗口”)
  4. 打开GitHub Copilot聊天
  5. MCP工具将自动可用

备注:确保您启用了GitHub Copilot,并且您的VS Code版本中提供了MCP支持。

VS代码(临床扩展)

  1. 安装Cline延长件 来自VS Code市场
  2. 打开临床设置 (单击Cline面板中的齿轮图标)
  3. 添加MCP服务器 在MCP服务器部分:
{
  "mcpServers": {
    "simple-azure-devops-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/azure-mcp/dist/index.js"]
    }
  }
}

重要:使用项目的绝对路径。例如:

  • Linux/macOS: /home/username/Code/azure-mcp/dist/index.js
  • 窗户: C:\\Users\\username\\Code\\azure-mcp\\dist\\index.js
  1. 重新启动Cline 或重新加载VS代码
  2. 这些工具现在应该出现在Cline的可用工具中

VS代码设置位置

您还可以手动编辑Cline配置文件:

  • Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
  • macOS: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
  • 视窗: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json

克劳德桌面版

将此服务器添加到您的Claude Desktop配置中:

{
  "mcpServers": {
    "simple-azure-devops-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/azure-mcp/dist/index.js"]
    }
  }
}

配置文件位置:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • 视窗: %APPDATA%\Claude\claude_desktop_config.json

发展

此项目使用 作为其官方套餐经理。 请对所有包管理操作使用pnpm,以确保一致性和适当的依赖关系解决。

运行测试

pnpm test

运行覆盖率测试

pnpm test:coverage

装订和格式化

此项目使用ESLint进行linting,使用Prettier进行代码格式化:

# Run linter
pnpm lint

# Fix linting issues automatically
pnpm lint:fix

# Format code with Prettier
pnpm format

# Check formatting without making changes
pnpm format:check

Git挂钩

Husky被配置为在预提交时运行lint stage,它会自动:

  • 在暂存的TypeScript文件上运行ESLint并自动修复
  • 使用Prettier格式化代码

这确保了提交前的代码质量和一致性。

开发观看模式

pnpm dev

项目结构

azure-mcp/
├── src/
│   ├── index.ts              # Main MCP server
│   ├── azure-cli.ts          # Azure CLI utilities
│   ├── pr-comments.ts        # PR comment retrieval logic
│   ├── azure-cli.test.ts     # Tests for Azure CLI utilities
│   └── pr-comments.test.ts   # Tests for PR comment parsing
├── dist/                     # Compiled JavaScript (generated)
├── package.json              # Package configuration
├── tsconfig.json             # TypeScript configuration
├── vitest.config.ts          # Vitest test configuration
└── README.md                 # This file

评论状态类型

  • 活跃的:评论线程处于活动状态,需要关注
  • 固定的:问题已得到解决
  • 关闭:线程已关闭
  • 不予修复:问题不会得到解决
  • 待定:等待行动
  • 故意设计:行为是故意的
  • 未知:状态未确定
  • 系统:系统生成的评论

故障排除

找不到Azure CLI

Error: Azure CLI is not installed or not available in PATH

解决方案:安装Azure CLI并确保它在您的PATH中。

未认证

Error: Not authenticated. Please run: az login

解决方案:运行 az login 并完成认证流程。

Azure DevOps扩展缺失

服务器将自动尝试安装 azure-devops 扩展。如果失败:

az extension add --name azure-devops

PR URL格式无效

Error: Invalid Azure DevOps PR URL format

解决方案:确保您的PR URL与以下格式之一匹配:

  • https://dev.azure.com/{org}/{project}/_git/{repo}/pullrequest/{id}
  • https://{org}.visualstudio.com/{project}/_git/{repo}/pullrequest/{id}

贡献

  1. 复刻仓库
  2. 创建要素分支
  3. 进行更改
  4. 运行测试: pnpm test
  5. 提交拉取请求

许可证

麻省理工学院

资源

目录标签

目录标签

Azure DevOps开发工具TypeScriptClaudeAzureDevOps本地部署PullRequest管理评论分析自动化审核

支持客户端

Claude DesktopClaudeClineVS Code

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

session

工具数量(toolCount,工具数)

2

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明session部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP