
Gerrit Code Review
team.gaijin由 gaijin.team 发布v1.1.3更新于 Oct 24, 2026
Capability-gated Gerrit code review tools with opt-in review notifications pushed into the session
发布方自己的服务:Review Expert
概览
一个本地 MCP 服务器,为助手提供按能力分组的工具,用于搜索、读取、评论、投票和推进 Gerrit 代码评审变更。
- 可以做什么
- 搜索与读取变更:用 Gerrit 变更查询语法检索,获取变更详情、列出改动文件、查看单个文件差异,并读取带解决状态的评论串。发布评审:一次提交顶层消息以及行内、范围、文件级和回复评论,并可切换评论串的解决状态。投票与状态流转:设置或清除 Code-Review 等标签投票,并执行提交、放弃、恢复、标记进行中或就绪。订阅变更后,新的消息、投票、评论串和状态变化会主动推送到会话中,也可提前取消订阅。
- 适用场景
- 适合让助手参与 Gerrit 评审流程:梳理待评审变更、总结差异和评论串、起草或发布评审意见、投票,以及推进提交或放弃等状态。默认只读,写能力需显式开启。
- 运行要求
- 以本地进程方式通过 stdio 运行(二进制发布、Docker 镜像或 go install),仅限桌面端。需要 Gerrit 3.13 及以上实例,以及三个环境变量:GERRIT_URL、GERRIT_USERNAME 和 GERRIT_TOKEN(在 Gerrit 中生成的 HTTP 凭据)。能力分组、项目白名单和通知设置通过命令行参数或其 GERRIT_MCP_* 镜像变量配置。
安装
在 SourceWeft 中
- 打开 控制台中的 Gerrit Code Review,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
go-gerrit-mcp
An MCP (Model Context Protocol) server that exposes Gerrit code review operations as capability-gated tools. An AI agent can search and read changes, publish review comments, vote, and drive change-state transitions. Every write capability is an explicit operator opt-in.
- Transport: stdio
- Target platform: Gerrit 3.13+, authenticated via HTTP credentials
- Output: llmxml, semantically tagged text meant to be read by a model (see Output format)
Safety posture
Two defaults encode it:
- Zero configuration exposes the
readgroup only. Write capability never appears unless enabled via--groups. - The own-changes restriction is on by default. Even with write groups enabled, trail-leaving operations (comments,
votes, state changes, anything other humans see) are refused on changes the authenticated account does not own,
until the operator explicitly passes
--own-changes-only=false.
An agent leaving unwanted trail on colleagues' changes is an externally visible failure; a missing capability is a locally discoverable inconvenience. The defaults are chosen accordingly. Widen deliberately:
Install
Binary release: download the binary for your platform from
GitHub Releases, make it executable, and put it on
your PATH:
Docker:
go install:
Quick start
The server reads connection identity from environment variables only; credentials never travel through flags:
Generate the credential in Gerrit under Settings → HTTP Credentials (an HTTP password, or an auth token on instances that issue them). All three variables are required; the server exits with an error naming the missing ones.
Claude Code
Any MCP client (JSON configuration)
Docker
Per-project configuration in Claude Code
Everything the server needs is read from the environment: the identity variables above plus a GERRIT_MCP_* mirror
for every flag (see Configuration reference). MCP server processes inherit the session
environment, so in Claude Code one user-level registration turns into per-project configuration, down to different
Gerrit instances with different credentials per repository.
~/.claude.json holds the registration, with no env block:
<project>/.claude/settings.local.json carries the project's environment; every env entry reaches the server
process:
Values shared by most projects can sit one layer down in ~/.claude/settings.json. Settings files merge, with
.claude/settings.local.json over .claude/settings.json over ~/.claude/settings.json, so a project declares only
its deltas. Anything no layer sets falls back to the server's own defaults: read-only, own changes.
The registration's env block stays empty for a reason. A variable named there shadows every settings layer, and
references are no workaround: ${VAR} expands only from the shell environment that launched claude, never from
settings files, and anything unresolved reaches the server as a literal string.
Other MCP clients inherit their launch environment the same way, so per-directory tooling such as direnv achieves the identical split without client support.
Capability groups
Capability is selected at startup via --groups as a comma-separated list. Groups are independent and combinable,
with no privilege ladder: each write-capable group bundles the minimal change-read subset it needs to work on its
own, and enabled groups union.
Tools
search_changes: query changes with Gerrit's change query syntax, paginated.get_change: one change in review-relevant detail: status, owner, labels with votes, current revision, messages.list_change_files: files touched by a revision, with per-file change stats.get_file_diff: the diff of one file in a revision.get_change_comments: comment threads on a change, with resolution state and comment ids. Returns unresolved threads only by default;status=allfetches the full history,status=resolvedthe settled threads.post_comments: publish a review in one call: optional top-level message plus inline, range, file-level, and reply comments. Replies anchor to comment ids fromget_change_comments;resolvedtoggles the thread state.set_vote: set a label vote (e.g.Code-Review) with an optional message; value0clears an own vote.transition_change: move a change's state:submit,abandon,restore,wip, orready, with an optional message (submit accepts none). Gerrit's refusal (a blocked submit, a restore of a merged change) is reported verbatim.
Review notifications
An opt-in push channel for review activity. The agent subscribes to a change with subscribe_change; from then on,
new change messages, votes, inline comment threads, and status transitions arrive in the session on their own as
review_activity blocks. The payload uses the same llmxml vocabulary the read tools emit and carries the activity
whole, so nothing needs fetching afterwards. unsubscribe_change ends a subscription early. A merged or abandoned
change ends its own subscription with a final notification that says so, and a change that becomes unreadable
(deleted, or no longer visible to the account) does the same, with the reason spelled out.
Subscriptions are per-session and in-memory: they leave no trace on the Gerrit instance, end with the session, and after a server restart the agent subscribes again. With the feature off (the default) the server is byte-identical to its pre-feature self, with no extra tools or capabilities and no background polling.
Enabling takes both sides:
- Server side: pass
--review-notifications=true(or its mirror). The server registers both subscription tools and polls Gerrit every--review-notifications-poll-interval(default60s): one batched query per tick over all subscribed changes, with detail fetches only for changes that actually moved. - Client side: delivery uses the Claude Code channels contract (research preview, Claude Code 2.1.80 or newer).
For a server registered plainly under
mcpServers, launch withclaude --dangerously-load-development-channels server:<name>, where<name>is the registration key; it becomes thesourceattribute of the injected<channel>blocks. Allowlisted channel plugins load withclaude --channelsinstead.
Research-preview caveats: organization policy can disable channels entirely; the flag syntax may change between Claude Code releases; and a client without channel support silently drops the events, in which case the server behaves exactly as if the feature were off, with no errors on either side.
Noise control is operator configuration. The server applies no heuristics of its own and filters nothing by message tag, because a bot's verdict is often exactly the outcome the agent is waiting for:
- the authenticated account's own activity is skipped by default (
--review-notifications-include-ownkeeps it); --review-notifications-exclude-accountssilences accounts by username or numeric ID;--review-notifications-exclude-patternsdrops events whose message or comment text matches a regular expression; an invalid pattern fails startup with an error naming it.
Every flag has a GERRIT_MCP_* mirror that follows the same settings layering as the rest of the configuration
(see Per-project configuration), so a project can enable notifications
and pick exclusions in its own settings file.
Configuration reference
Behavior is configured by CLI flags, each mirrored by an environment variable so one configuration style works for binary and Docker invocations alike. Precedence: the flag wins over its mirror, and the mirror wins over the default.
Notes:
--own-changes-onlytakes an explicit boolean value:--own-changes-only=false. A bare flag without a value is a configuration error.- Project scoping (
--projects) is enforced server-side: a project clause is injected into every change query regardless of what the agent composed, and direct operations on out-of-scope changes are refused. - Tool filters only narrow.
--exclude-toolsremoves tools from what the groups resolved;--include-toolskeeps only the listed subset of it. A tool outside the enabled groups can never be activated by a filter, and exclude wins over include. Filter entries naming no known tool fail startup, so misconfigurations surface immediately. - Configuration errors are aggregated: the server reports every problem at once, then exits non-zero.
Output format
Every tool responds in llmxml, an LLM-digestible subset of XML: line-structured, semantically tagged text meant to be read by a model. Attributes carry metadata; element bodies carry content:
There is no XML declaration, no namespaces, and no schema; nothing parses it back. If you need machine-readable Gerrit data, use Gerrit's REST API directly; this format is for model consumption.
License
来源:README.md,提交 9fe60e9
工具
0版本历史
1- v1.1.3最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
其他 Review 集成

Review Expert
expert.review官方发布者
让助手读取、搜索、分析 App Store 和 Google Play 评论并起草回复,需 OAuth 登录。

DECIDE: Migration Discovery Risk Review
由 GitHub 账号 stratus-consulting 发布
一个远程风险评审服务:提交迁移调研发现,按严重程度返回未决风险,并给出下一步该问谁、问什么。

Arch theological review
由 GitHub 账号 tnvolman 发布
Cursor/Grok 插件,为助手提供付费的 Arch 神学审阅(针对信仰文本)以及免费的离线钦定版圣经经文查询。

ReviewBot App Reviews
由 GitHub 账号 fahimk 发布
读取收集到的 App Store 和 Google Play 评论以及有界反馈统计数据。AI 翻译

Khavion Architecture Review
com.khavion
本地 MCP 服务器,为助手提供带原文引用的云最佳实践,并对 Terraform、CloudFormation 和 Kubernetes 文件做基于规则的确定性审查。