Skip to main content
Glama

Angular PR Review MCP

可复用的 MCP 服务器,用于跨多个 Angular 仓库的自动化拉取请求审查工作流。

此包公开了三个 MCP 工具:

  • get_pr_review_template

  • generate_pr_diff

  • read_pr_diff

  • save_pr_review

它在目标仓库上下文(当前工作目录)中运行,因此一个已发布的包可被任何 Angular 应用复用。

要求

  • Node.js 20+

  • 已安装 Git 并可在 PATH 中使用

  • 支持 Copilot Chat MCP 的 VS Code

Related MCP server: @droplinkperformance/bitbucket-mcp-server

本地开发

npm install
npm run build
npm run dev

发布到 npm

如果公开发布:

npm login
npm publish --access public

如果以作用域包发布(推荐用于账户/组织所有权):

  1. 将 package.json 中的 name 字段改为你的作用域,例如 @your-scope/angular-pr-review-mcp。

  2. 发布:

npm login
npm publish --access public

创建独立的 GitHub 仓库

从此文件夹创建并推送到你账户中的专用仓库:

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

在任何 Angular 仓库中使用

在每个 Angular 仓库中添加或更新 .vscode/mcp.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"
      }
    }
  }
}

对于作用域包,请将 angular-pr-review-mcp 替换为你发布的名称。

环境变量

  • PR_REVIEW_BASE_BRANCH:用于比较的目标基础分支(默认 main)

  • PR_REVIEW_OUTPUT_DIR:审查产物目录(默认仓库根目录下的 pr_review)

  • PR_REVIEW_REPO_ROOT:覆盖仓库根目录(默认当前工作目录)

  • PR_REVIEW_SERVER_NAME:MCP 服务器名称(默认 angular-pr-review)

工具工作流

  1. 使用提交 SHA 调用 generate_pr_diff。

  2. 调用 read_pr_diff 获取 diff 内容。

  3. 调用 save_pr_review 保存 Markdown 审查评论。

推荐流程:

  1. 首先调用 get_pr_review_template,加载本地审查规范,避免每次运行都重新推导规则。

  2. 调用 generate_pr_diff 和 read_pr_diff 收集证据。

  3. 调用 save_pr_review 生成最终报告。

生成的文件会写入每个使用方仓库中配置的输出文件夹。

本地模板产物

该仓库包含 pr_review_prompt_template.md,以便团队可以在版本控制中对审查指南进行版本管理。

get_pr_review_template 工具返回相同的策略文本(支持可选的提交令牌替换),这有助于保持审查结果确定性并减少令牌消耗。

Available Tools

4 tools
generate_pr_diffB

Generate a PR review diff for a validated Git commit hash and return the resulting diff file path.

Inputs: commitHash (required).

get_pr_review_templateB

Return the local Angular PR review template used to keep review rules consistent and token-efficient.

Inputs: commitHash.

read_pr_diffA

Read the most recently generated PR diff file, or a specific diff by commit hash/file path.

Inputs: filePath, commitHash.

save_pr_reviewB

Save a completed review as a markdown report inside the configured output folder.

Inputs: content (required), commitHash (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 4 tools

    Disambiguation5/5

    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.

    Naming Consistency4/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables deterministic behavioral regression review of pull-request diffs by checking changed code against approved incident-derived contracts. It exposes read-only tools to assess diffs and pull requests, list and fetch contracts, and report outcomes over stdio without mutating repositories.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to review GitHub pull requests and GitLab merge requests by fetching PR/MR details and diffs, with optional file-type filtering, and posting inline, general, or batched review comments. Supports self-hosted GitLab and custom project-specific review rules through stdio, SSE, or WebSocket transports.
      MIT