Angular PR Review MCP
# Angular PR Review MCP
Reusable MCP server for automated pull-request review workflows across multiple Angular repositories.
This package exposes three MCP tools:
- `get_pr_review_template`
- `generate_pr_diff`
- `read_pr_diff`
- `save_pr_review`
It runs in the target repository context (the current working directory), so one published package can be reused by any Angular app.
## Requirements
- Node.js 20+
- Git installed and available in PATH
- VS Code with Copilot Chat MCP support
## Local Development
```bash
npm install
npm run build
npm run dev
```
## Publish To npm
If publishing publicly:
```bash
npm login
npm publish --access public
```
If publishing under a scoped package (recommended for account/org ownership):
1. Change the `name` field in package.json to your scope, for example `@your-scope/angular-pr-review-mcp`.
2. Publish:
```bash
npm login
npm publish --access public
```
## Create Separate GitHub Repository
From this folder, create and push to a dedicated repository in your account:
```bash
git init
git branch -M main
git remote add origin https://github.com/<your-username>/angular-pr-review-mcp.git
git add .
git commit -m "Initial reusable Angular PR review MCP package"
git push -u origin main
```
## Use From Any Angular Repository
Add or update `.vscode/mcp.json` in each Angular repository:
```json
{
"servers": {
"angular-pr-review": {
"type": "stdio",
"command": "npx",
"args": ["-y", "angular-pr-review-mcp"],
"cwd": "${workspaceFolder}",
"env": {
"PR_REVIEW_BASE_BRANCH": "main",
"PR_REVIEW_OUTPUT_DIR": "pr_review"
}
}
}
}
```
For a scoped package, replace `angular-pr-review-mcp` with your published name.
## Environment Variables
- `PR_REVIEW_BASE_BRANCH`: target base branch for comparison (default `main`)
- `PR_REVIEW_OUTPUT_DIR`: review artifacts directory (default `pr_review` under repo root)
- `PR_REVIEW_REPO_ROOT`: override repository root (default current working directory)
- `PR_REVIEW_SERVER_NAME`: MCP server name (default `angular-pr-review`)
## Tool Workflow
1. `generate_pr_diff` with commit SHA.
2. `read_pr_diff` to retrieve diff content.
3. `save_pr_review` to persist markdown review comments.
Recommended flow:
1. `get_pr_review_template` first, to load the local review rubric and avoid re-deriving rules each run.
2. `generate_pr_diff` and `read_pr_diff` for evidence collection.
3. `save_pr_review` for the final report.
Generated files are written into the configured output folder in each consuming repository.
## Local Template Artifact
The repository includes [pr_review_prompt_template.md](pr_review_prompt_template.md) so teams can version review guidance in source control.
The `get_pr_review_template` tool returns the same policy text (with optional commit token replacement), which helps keep reviews deterministic and reduces token consumption.
TDQS
Scored across 4 tools
Each tool serves a distinct purpose: fetching the review template, generating a diff, reading a diff, and saving a review. There is no overlap or ambiguity in their functionalities.
All tools follow a consistent verb_noun pattern (get, generate, read, save) with clear object references. The only minor deviation is that 'get_pr_review_template' and 'generate_pr_diff' could be seen as slightly more specific verbs, but they are still consistent with the overall style.
With 4 tools, the server is well-scoped for a focused PR review workflow. Each tool covers an essential step: template retrieval, diff generation, diff reading, and saving results, without unnecessary extras.
The tool surface covers the core workflow of generating and reviewing a PR diff. However, a minor gap might be the lack of a tool to fetch PR metadata or commit details beyond the diff, but the current set is sufficient for the stated purpose.