An AI-powered code review assistant for AzureRM Terraform Provider using the Model Context Protocol.
This tool provides automated code review capabilities for new resources of AzureRM Terraform Provider. It integrates with Visual Studio Code through the Model Context Protocol to analyze pull requests or local files for common issues and best practices based on the AzureRM Provider Contributor Guides.
- This is an auxiliary tool that supplements, but does not replace, manual code review
- This tool only reviews newly added files in a pull request
- May produce false positives or miss certain types of errors
- Should be used in conjunction with human review and testing
Before getting started, ensure you have the following installed:
- Visual Studio Code - The primary development environment
- UV Package Manager - For dependency management
- GitHub Personal Access Token - For accessing GitHub repositories
git clone https://github.com/ms-zhenhua/azurerm-reviewer-mcp
cd azurerm-reviewer-mcpFollow the official documentation to enable MCP support in VS Code.
Create a .vscode/mcp.json file in your workspace following the MCP server configuration guide.
Use the template below and replace the placeholder values:
File: .vscode/mcp.json
📋 Reference: See example configuration for a complete example.
| Parameter | Description |
|---|---|
<replace_with_your_absolute_path> |
The absolute path to your cloned azurerm-reviewer-mcp repository |
MAX_TOKENS |
Maximum token limit for the LLM (e.g., 200000) |
RESULT_DIRECTORY |
Directory path where review results will be stored. Make sure this directory can be accessed by both the MCP client and MCP server |
MAX_RULE_LENGTH_PER_PROMPT |
(Optional) Maximum character limit for rules included in each prompt (e.g., 10000). Smaller values improve LLM accuracy by reducing context complexity but require more prompt calls to process all rules. Defaults to half of the MAX_TOKENS value |
{
"inputs": [
{
"type": "promptString",
"id": "github-token",
"description": "GitHub token for azurerm code reviewer MCP",
"password": true
}
],
"servers": {
"azurerm-code-reviewer-mcp": {
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"<replace_with_your_absolute_path>/azurerm-reviewer-mcp",
"run",
"server.py"
],
"env": {
"GITHUB_TOKEN": "${input:github-token}",
"MAX_TOKENS": "<replace_with_your_max_token>",
"RESULT_DIRECTORY": "${workspaceFolder}/<replace_with_your_result_directory>"
}
}
}
}-
Open
.vscode/mcp.jsonin VS Code and start the azurerm-code-reviewer-mcp server -
Enter your GitHub Personal Access Token when prompted
The tool provides two main review capabilities:
Analyze entire pull requests from GitHub repositories.
-
Open Copilot Chat: Type
/in the copilot chatbox -
Select Command: Choose
mcp.azurerm-code-reviewer-mcp.review_pull_request -
Enter PR URL: Input the GitHub pull request link
-
Start Review: Send the prompt to begin the automated review until the final result is generated in
review_result.md.
Analyze individual files on your local system.
-
Open Copilot Chat: Type
/in the copilot chatbox -
Select Command: Choose
mcp.azurerm-code-reviewer-mcp.review_file -
Enter File Path: Input the absolute path to the file you want to review
-
Start Review: Send the prompt to begin the file analysis until the final result is generated in
review_result.md.
We welcome contributions to improve the azurerm-reviewer-mcp tool. Please feel free to:
- Report issues
- Suggest new features
- Submit pull requests
- Improve documentation
This project is licensed under the terms specified in the LICENSE file.







