azure-pr-mcp
v1.0.0
Published
A Model Context Protocol server for Azure DevOps pull request analysis and code review. Enables AI-powered PR reviews with automated inline comments through GitHub Copilot.
Downloads
21
Maintainers
Readme
ALI Dev MCP Server
Easily install the ALI Dev MCP Server for VS Code:
This TypeScript project provides a local MCP server for Azure DevOps, enabling you to perform Azure DevOps pull request analysis and code review tasks directly from your code editor.
📋 Overview
The ALI Dev MCP Server is a Model Context Protocol (MCP) server that provides Azure DevOps pull request utilities for AI-powered code reviews. It integrates with GitHub Copilot to enable automated PR analysis and inline code review comments directly in Azure DevOps.
Key Capabilities:
- PR File Analysis - Inspect and analyze file changes in Azure DevOps pull requests
- Inline PR Comments - Post automated review comments directly to PR files
- AI-Powered Reviews - Leverage GitHub Copilot for intelligent code analysis
- Iteration Tracking - Track and review changes across PR iterations
⚡ Prerequisites
Before using the ALI Dev MCP Server, ensure you have:
Node.js version 18.0.0 or higher installed
- Download from nodejs.org
- Verify installation:
node --version npm --version
Azure CLI installed and configured (recommended for Azure DevOps authentication):
- Download from Microsoft Azure CLI
- For Windows: Download and run the MSI installer
- Verify installation:
az --version - Login to Azure:
az login
PowerShell (for running the installation script on Windows)
🚀 Installation
For detailed installation instructions, see INSTALLATION.md.
Quick Install
Download or clone this repository:
git clone https://github.com/NSriram27/azure-pr-mcp.git cd Ali_Dev_Mcp_ServerRun the installer:
installer.batAuthenticate with Azure DevOps:
az loginRestart VS Code to load the new MCP configuration
The installer will:
- ✅ Install the server to
%USERPROFILE%\.mcp\servers\ALI_DEV_MCP_Server - ✅ Configure VS Code MCP settings
- ✅ Install the PR Code Review chatmode
- ✅ Set up all dependencies
💻 VS Code GitHub Copilot Configuration
The installer automatically configures the MCP server in VS Code. The configuration is added to:
Configuration file location: %APPDATA%\Code\User\mcp.json
If you already have an existing mcp.json file, the installer will prompt you to manually add the configuration. Add the following servers to your existing configuration:
{
"servers": {
"ado": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@azure-devops/mcp", "${input:ado_org}"]
},
"ali-dev-mcp": {
"type": "stdio",
"command": "npx",
"args": ["tsx", "%USERPROFILE%\\.mcp\\servers\\ALI_DEV_MCP_Server\\src\\index.ts"],
"env": { "NODE_ENV": "production" }
}
},
"inputs": [
{
"id": "ado_org",
"type": "promptString",
"description": "Azure DevOps organization name (e.g. 'contoso')"
}
]
}Note:
- If you already have other MCP servers configured, merge the
ali-dev-mcpandadoentries into your existingserverssection - Add the
ado_orginput to your existinginputsarray if you don't already have it - The
adoserver configuration is included by default for convenience. This is the official Azure DevOps MCP server from Microsoft. For more information, visit: https://github.com/microsoft/azure-devops-mcp
🛠️ Available Tools and Prompts
The ALI Dev MCP Server provides two main MCP providers for Azure DevOps pull request workflows:
PR Files MCP
Tools:
get_pr_latest_iteration: Get the latest iteration ID for a pull request in Azure DevOpsget_pr_iteration_changes: Get file changes for a specific iteration of a pull requestget_pr_file_changes: Get file changes from the latest iteration of a pull request (convenience tool)
Prompts:
analyze-pr-changes: Analyze file changes in a pull request and provide insights (types, patterns, impact)review-pr-files: Review specific files changed in a pull request with optional filtering by pattern
PR Comments MCP
Tools:
add_pr_inline_comment: Add an inline review comment to a specific file and line in a pull request
Prompts:
add-review-comment: Helper prompt to craft and add a single inline review commentreview-pr-with-comments: Comprehensive review prompt that can analyze PR changes and add multiple inline comments
💬 GitHub Copilot Chat Integration
The installer sets up a custom chatmode for PR code reviews:
- File:
%APPDATA%\Code\User\prompts\PR Code Review.chatmode.md - Usage: Select this chatmode in GitHub Copilot Chat to perform automated PR reviews with inline comments
Example Chat Commands:
@copilot Use get_pr_file_changes tool for PR 12345 in project MyProject, repository MyRepo
@copilot Use analyze-pr-changes prompt for PR 12345 in project MyProject, repository MyRepo
@copilot Use review-pr-with-comments prompt for PR 12345 in project MyProject, repository MyRepo🔧 Troubleshooting
Installation Issues
"Node.js not found"
- Install Node.js 18.0.0+ from nodejs.org
- Restart your terminal/command prompt after installation
- Verify installation:
node --version
"PowerShell execution error"
- The batch installer runs PowerShell with
-ExecutionPolicy Bypass - If you encounter issues, run as Administrator
- Alternatively, run PowerShell script directly:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process .\install.ps1
"Failed to install dependencies"
- Check your internet connection
- Verify npm is working:
npm --version - Try manual installation:
cd %USERPROFILE%\.mcp\servers\ALI_DEV_MCP_Server npm install
VS Code Integration Issues
"VS Code doesn't recognize MCP server"
- Verify
mcp.jsonexists at%APPDATA%\Code\User\mcp.json - Check the file content matches the expected configuration
- Restart VS Code completely (close all windows)
- Check VS Code Output panel for MCP-related errors
"GitHub Copilot Chat doesn't show chatmode"
- Verify chatmode file exists at
%APPDATA%\Code\User\prompts\PR Code Review.chatmode.md - Restart VS Code
- Check that GitHub Copilot extension is installed and enabled
Azure DevOps Authentication Issues
"Authentication failed"
- Run
az loginto authenticate with Azure DevOps - Ensure you have access to the target Azure DevOps organization
- Verify your Azure DevOps permissions for the target project/repository
- Check that
@azure/identitycan access Azure credentials
"Cannot access pull request"
- Verify the project, repository, and PR ID are correct
- Ensure you have read permissions for the repository
- Check that the PR exists and is not deleted
Testing the Server
To verify the server is working correctly:
cd %USERPROFILE%\.mcp\servers\ALI_DEV_MCP_Server
npx tsx src\index.tsThe server should start without errors. Press Ctrl+C to stop it.
📚 Additional Resources
- Installation Guide: INSTALLATION.md - Detailed installation instructions
- Development Guide: README-DEV.md - For contributors and developers
- Model Context Protocol: MCP Documentation
- Azure DevOps API: REST API Reference
- Azure DevOps MCP Server: Official Microsoft Server
🤝 Contributing
Contributions are welcome! Please see README-DEV.md for development setup and guidelines.
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes and add tests
- Run tests:
npm test - Commit your changes:
git commit -m "Add your feature" - Push to the branch:
git push origin feature/your-feature-name - Create a Pull Request
©️ Copyright
© 2025, Hexagon AB and/or its subsidiaries and affiliates. All rights reserved.
