
Maple
io.github.maple-kitv0.17.1更新於 Oct 3, 2026
Review comments pinned to a running frontend, read and resolved by your coding agent.
概覽
讓編碼代理讀取、等待並解決釘在執行中前端預覽上的視覺審查評論。
- 功能
- Maple 把在預覽部署上收集到的審查評論交給編碼代理。工具可以列出某個分支上的評論、阻塞等待新評論送達、取得單一評論的完整脈絡(錨點、視埠、周邊標記、重播連結),並把評論標記為已解決、記錄修好它的提交。搭配的 Stop 勾子會阻止代理在仍有未關閉評論時宣稱已完成,start_solo 則把已部署的預覽橋接到本機儲存。
- 適用情境
- 當團隊在預覽部署上留下視覺審查評論,並希望編碼代理接手處理並標記為已解決時使用。在沒有拉取請求的筆電上也能用,此時讀取 .maple/ 下的評論。
- 執行需求
- 透過 npx 從 npm 套件 @maple-kit/mcp 啟動的本機 Node.js 程序。github 儲存需要 GITHUB_TOKEN、MAPLE_GITHUB_OWNER 和 MAPLE_GITHUB_REPO;file 儲存則都不需要。選用變數包括 MAPLE_GITHUB_API、MAPLE_STORE、MAPLE_BRANCH、MAPLE_URL、MAPLE_GATE_TOKEN、MAPLE_GATE_APP_ID 和 MAPLE_REQUIRE_APPROVAL。缺少必要值時會在啟動階段失敗。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Maple,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
@maple-kit/mcp
The Model Context Protocol server that hands a coding agent the review comments Maple collected on a preview deployment.
Pre-release. Every package here is 0.x and makes no compatibility promise.
The agent waits for a comment, reads it with its context — file:line from
the tagger, the viewport, the screenshot, the mock it was written under — makes
the change, and resolves it against the commit that fixed it. The reviewer's
half is the overlay; the two meet in the store.
Install
Two binaries ship: maple-mcp, the server, and maple-stop-hook, which stops
an agent from calling itself finished while comments are still open.
Connect an agent
A client starts the server with no arguments, so it is configured through the
environment. In Claude Code's .mcp.json:
and run the client under op run --env-file so GITHUB_TOKEN never lands in a
file. A missing value fails at startup rather than on the first tool call.
With no forge
Set none of GITHUB_TOKEN, MAPLE_GITHUB_OWNER and MAPLE_GITHUB_REPO and the
server reads and writes the comments fileStore() keeps under .maple/ in its
working directory's repository, so the loop works on a laptop with no pull
request. MAPLE_STORE=file says so explicitly. It is a laptop's store, not a
preview pod's: docs/connectors.md has the argument. The Stop hook reads the
same folder for the branch checked out in the session's working directory, and
stays silent where there is no .maple/ folder, no comments for the branch or
no repository.
Tools
wait_for_comments is clamped to 55 seconds because every coding client cuts a
tool call off at 60, and it emits notifications/progress every 15 seconds. A
timeout is a result: an agent that treats one as an error stops looping the
first time nobody is looking. Its cursor is a timestamp; omit it on the first
call to drain whatever is already waiting.
The Stop hook
MCP gives a server no way to interrupt a client, so the loop is closed from the
other end. Claude Code's Stop hook runs when the agent believes it is
finished, and Maple's answers with the comments still open:
The Maple Claude Code plugin registers it for you. It blocks while a comment
is open or needs_reverify, at most eight stops in a row per session; on the
ninth it lets the session end and says what is still open, which beats an agent
resolving comments to escape. The count is kept per session_id in the system
temp directory, and a stop no block caused starts it again.
The hook does not see .mcp.json's env. That block is handed to the MCP
server alone; a hook runs in the client's own environment. So
MAPLE_GITHUB_OWNER, MAPLE_GITHUB_REPO and GITHUB_TOKEN have to be set
where the client itself starts — under the same op run --env-file — or the
hook fails naming the one missing. With neither of the first two set, it reads
the comments under .maple/ for the current branch instead, and lets every
stop through where there are none. MAPLE_BRANCH defaults to the branch checked out in the
session's working directory.
Resolving clears the gate
With MAPLE_URL set to a deployed route's mount URL, such as
https://web-482.preview.acme.dev/api/maple, resolve_comment asks that route
to republish maple/visual-review, so an agent that resolves the last comment
with nothing left to push does not leave the check holding on finished work.
The request carries the branch and GITHUB_TOKEN, which must be able to push
to the repository. The route decides the verdict and publishes with the gate
App's own credentials, which never leave it. A failed refresh is logged to
stderr and the resolve is still recorded.
MAPLE_GATE_TOKEN is the other way, for CI: a gate App installation token the
server publishes with directly. It expires an hour after it is minted, so it
suits a job, not a session. Setting both fails at startup.
Documentation
- The agent loop
- The merge gate
- The
maple-reviewskill turns a pull request's```maplecomments into a worklist without the server.
Licence
Apache-2.0. See LICENSE and NOTICE.
來源:packages/mcp/README.md,提交 7da3500
工具
0版本歷史
1- v0.17.1最新Oct 3, 2026

