Azure DevOps PR Reviewer MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Azure DevOps PR Reviewer MCP ServerReview pull request #123 in the azdo-code-review-mcp repo"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Azure DevOps PR Reviewer MCP Server
A Model Context Protocol (MCP) server for automated code reviews on Azure DevOps Pull Requests. This server enables AI assistants like Claude and Kiro to review PRs, validate requirements, post inline comments, and manage the review workflow automatically.
Features
Get PR Information: Fetch complete PR details including changed files with full content
Validate PRs: Run comprehensive validation checks (status, reviewers, checklist, work items)
Post Findings: Create inline comments on specific lines in PR files
Set Review Votes: Approve, reject, or request changes on PRs
List PRs: Browse open pull requests in repositories
Related MCP server: pr-mcp-server
Installation
Prerequisites
Python 3.10 or higher
Azure DevOps Personal Access Token (PAT) with Code (Read & Write) permissions
Git installed on your system
Setup
Clone this repository:
git clone https://github.com/MalinduDilshan/azdo-code-review-mcp.git
cd azdo-code-review-mcpInstall dependencies:
pip install -r requirements.txtCreate a
.envfile in the project root:
# Azure DevOps Configuration
AZURE_DEVOPS_ORG=your-organization
AZURE_DEVOPS_PROJECT=your-project
AZURE_DEVOPS_PAT=your-personal-access-token
AZURE_DEVOPS_URL=https://dev.azure.com
AZURE_DEVOPS_USER_DISPLAY_NAME=Your Name
AZURE_DEVOPS_USER_EMAIL=your.email@example.com
# Optional: Skip specific reviewer groups
SKIP_REVIEWER_GROUPS=Group1,Group2
# Optional: Skip validations and jump directly to code review
SKIP_VALIDATIONS=falseUsage
With Kiro AI Assistant
Add to your .kiro/settings/mcp.json:
{
"mcpServers": {
"azure-devops-reviewer": {
"command": "python",
"args": ["-m", "mcp.server"],
"cwd": "/path/to/azdo-code-review-mcp",
"env": {
"AZURE_DEVOPS_ORG": "your-org",
"AZURE_DEVOPS_PROJECT": "your-project",
"AZURE_DEVOPS_PAT": "your-pat"
}
}
}
}With Claude Desktop
Add to your Claude Desktop configuration:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"azure-devops-reviewer": {
"command": "python",
"args": ["-m", "src.mcp.server"],
"cwd": "/path/to/azdo-code-review-mcp",
"env": {
"AZURE_DEVOPS_ORG": "your-org",
"AZURE_DEVOPS_PROJECT": "your-project",
"AZURE_DEVOPS_PAT": "your-pat"
}
}
}
}Standalone Usage
from src.azure_devops import AzureDevOpsConnector
# Initialize connector
connector = AzureDevOpsConnector(
organization="my-org",
project="my-project",
pat="my-personal-access-token"
)
# Get PR information
pr_info = connector.get_pr_info(pr_number=123, repo_name="my-repo")
# Post a comment
connector.post_inline_comment(
pr_number=123,
repo_name="my-repo",
file_path="/src/main.py",
line_number=42,
comment_text="Consider adding error handling here"
)
# Set review vote
connector.set_pr_review_vote(
pr_number=123,
repo_name="my-repo",
vote=10 # 10 = Approved, -5 = Waiting for Author
)Available Tools
get_pr
Fetch PR information and all changed files with content in one call.
Parameters:
pr_url(optional): Full Azure DevOps PR URLorganization,project,repository,pr_number(alternative to pr_url)
validate_pr
Run comprehensive PR validation checks including status, reviewers, checklist items, and linked work items.
Parameters:
Same as
get_pr
post_findings
Post code review findings as inline comments on specific lines.
Parameters:
PR identification (same as
get_pr)findings: Array of objects with:file_path: Path to file in PRline_number: Line number for commentcomment: Review comment textseverity: (optional) "error", "warning", or "info"
set_vote
Set your review vote on the PR.
Parameters:
PR identification (same as
get_pr)vote: -10 (Rejected), -5 (Waiting for Author), 0 (No Vote), 5 (Approved with Suggestions), 10 (Approved)
list_prs
List open pull requests in a repository.
Parameters:
organization,project,repository
Configuration Options
Environment Variable | Required | Default | Description |
| Yes | - | Your Azure DevOps organization name |
| Yes | - | Default project name |
| Yes | - | Personal Access Token with Code (Read & Write) permissions |
| No |
| Base URL for Azure DevOps |
| No | - | Display name for review comments |
| No | - | Email for review comments |
| No | - | Comma-separated list of reviewer groups to skip |
| No |
| Skip validation checks and go directly to review |
Creating an Azure DevOps PAT
Go to your Azure DevOps organization
Click on User Settings (top right) → Personal Access Tokens
Click "New Token"
Set a name and expiration
Under "Scopes", select:
Code: Read & Write
Work Items: Read (if using work item validation)
Click "Create" and copy the token immediately
Project Structure
azdo-code-review-mcp/
├── src/
│ ├── azure_devops/ # Core Azure DevOps integration
│ │ ├── base.py # Base connector with auth
│ │ ├── connector.py # Main connector class
│ │ ├── models.py # Data models
│ │ ├── pr_info.py # PR information retrieval
│ │ ├── pr_diff.py # Diff analysis
│ │ ├── pr_comments.py # Comment posting
│ │ └── pr_review.py # Review and voting
│ ├── mcp/ # MCP server implementation
│ │ ├── server.py # Main MCP server
│ │ ├── schemas.py # Tool schemas
│ │ └── tools/ # Tool handlers
│ │ ├── get_pr.py
│ │ ├── validate_pr.py
│ │ ├── post_findings.py
│ │ ├── set_vote.py
│ │ └── list_prs.py
│ └── config.py # Configuration management
├── tests/
│ └── test_server.py # Component tests
├── .github/ # GitHub Actions and templates
├── .env.example # Example environment file
├── requirements.txt # Python dependencies
└── README.md # This fileContributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/AmazingFeature)Commit your changes (
git commit -m 'Add some AmazingFeature')Push to the branch (
git push origin feature/AmazingFeature)Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Troubleshooting
Common Issues
"Authentication failed"
Verify your PAT is correct and hasn't expired
Ensure the PAT has Code (Read & Write) permissions
Check that the organization and project names are correct
"Line number out of range"
The server validates line numbers against the actual diff
Ensure you're commenting on lines that were actually changed in the PR
"Cannot find PR"
Verify the PR number, repository name, and project are correct
Check that the PR exists and is accessible with your PAT
Support
For issues, questions, or contributions, please use the GitHub Issues page.
Acknowledgments
Built with the Model Context Protocol by Anthropic.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/MalinduDilshan/azdo-code-review-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server