RepoPilot
This server manages RepoPilot's auditable repository maintenance: it tracks agent skill steps, appends immutable evidence, requests and consumes human approvals, searches/archives runbooks, and performs read-only or PR-only GitHub operations (issue/PR reads, PR creation, checks, proof/review comment publishing, and approval-gated merge).
Run & Step Management: Start/finish Agent Skill steps with idempotency keys and terminal statuses (succeeded/failed/blocked/skipped).
Immutable Evidence Ledger: Append SHA-256 hash-chained evidence records (decisions, tool results, CI, approvals, publications) with append-only semantics.
Human Approval Workflow: Request approval for high-risk actions (merge, delete branch, rollback, permission/secret changes); merge requires exact approval ID+version and is atomically consumed.
Runbook Knowledge Base: Search verified runbooks by repository/query and archive new verified outcomes after independent verification.
GitHub Issue & PR Reads: Fetch issue details and PR metadata (including immutable head SHA) with repository allowlist enforcement.
PR Diff & Checks: Paginate changed-file patches (100/page) and read combined checks/statuses, appending CI evidence.
Repair PR Creation: Create a pull request from an existing branch (
pull_request_onlypolicy—never auto-merge).Proof & Review Publishing: Create/update managed comments (proof bundle or review findings) tied to a fixed head SHA, with stale-revision rejection.
Read-only Review Support: Tools for reviewers to inspect PRs and publish structured findings (severity, location) without approving or modifying code.
Provides tools for managing GitHub issues, pull requests, checks, and controlled merges, with full audit trail and approval workflows.
Enables monitoring failed GitHub Actions CI runs and driving them through reproduction, fix, verification, and pull request creation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@RepoPilot Investigate the failing CI build and open a verified PR"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
RepoPilot is built on AgentTeams
v1.2.2and focuses on safe, auditable repository maintenance automation. The default policy ispull_request_only: Agents may create branches, commits, and Pull Requests, but cannot auto-merge, delete branches, or modify permissions or secrets.
Two Automation Closed Loops
The PR review pipeline listens for opened, reopened, synchronize, and
ready_for_review. Before every publication, the current head SHA is re-checked; if new commits
arrive during review, the old Run is rejected. Comments carry a fixed <!-- repopilot-review --> marker,
so each PR maintains exactly one RepoPilot comment without spamming duplicates.
Related MCP server: gts-repo-guardian
Flow Demo
The online Demo needs no model service or admin account. It replays the real delivery of
repopilot-testbed#3by default: the failing baseline reliably reproduces a concurrency race, RepoPilot fixes it with aTypes + Store + Processor + Tests + Docsfive-file patch, and createsPR #4after GitHub Actions passes. The PR stays open; merge authority remains with humans.
<!-- repopilot-review -->
## RepoPilot PR Review
**Verdict:** NEEDS ATTENTION
**Reviewed revision:** `b504cec7c05cd2f3b84ee9c6ad7a3d3db6eead5c`
### Findings
| Severity | Finding | Location |
| -------- | -------------------------------------- | --------------------------------- |
| HIGH | 发布前没有重新校验当前 head SHA | `src/reviews/publisher.ts:19` |
| MEDIUM | 固定只扫描前 100 条评论 | `src/reviews/github-client.ts:43` |
| HIGH | GitHub 写入失败仍记录“已发布” Evidence | `src/reviews/publisher.ts:31` |The following results come from public PR #5 with 5 files and 373 added lines; GitHub Actions CI has passed. RepoPilot still found 2 HIGH and 1 MEDIUM semantic issues from the real Diff and published a public Review Comment. The comment is generated by repopilot-reviewer using the pull-request-review Skill and published via repopilot_publish_review_comment. The tool validates the Run, repository, PR number, the running Reviewer Step, and the immutable head SHA, then appends review_publication Evidence on success. You can download the sanitized Run Proof JSON to verify the Run ID, Step, 8 Evidence entries, and the chain-head hash.
Maintenance Closed Loop
GitHub Issue / Failed CI
│
▼
Repo Lead 分诊与拆解
│
▼
Locator 根因定位 ──► Fixer 最小修复 ──► Verifier 独立验证
│
人工审批 ◄── 高风险门禁 ◄─────┤
│
▼
Archivist 沉淀 Runbook
GitHub Pull Request
│
▼
Reviewer 固化 head SHA ──► 分页读取 Diff / Checks ──► 更新托管 Review CommentEvery key stage writes decisions, tool calls, Git references, CI results, and approval events into a PostgreSQL append-only SHA-256 evidence chain, and supports replay through OpenTelemetry Traces and the evidence console.
Proof-Carrying Pull Request
RepoPilot does not treat "auto-generated PR" as the end point; instead, every PR carries a machine-verifiable Proof Bundle:
Run 身份 + AgentTeams Step 时间线 + Skill 版本
+ 工具与决策 Evidence + Git / CI 引用
+ 审批历史 + SHA-256 链根 + 确定性质量门禁curl http://127.0.0.1:3000/api/v1/runs/<run-id>/proof \
--output artifacts/proof-bundle.json
pnpm build
pnpm evaluate artifacts/proof-bundle.json artifacts/evaluation-report.jsonThe Proof Score measures proof completeness and does not pass off control-plane tests as model fix quality; patch correctness is still judged by the public testbed, the independent Verifier, and GitHub Checks.
After the Runbook archive completes, the Archivist calls repopilot_publish_proof_comment to idempotently publish the sanitized
completeness results, Agent/Skill execution results, and the SHA-256 chain root to the corresponding PR. Repeated runs update
the same comment, so the Proof is truly delivered with the PR rather than existing only in the control-plane API.
Why RepoPilot
AgentTeam
The full Agent Identity definitions live in
deploy/agentteams/repopilot-team.yaml,
and the Skill contracts live in skills/.
Core Capabilities
MCP Registry
RepoPilot provides a reproducible entry point for the MCP Registry's static checks and hosted publication:
Check item | Verifiable implementation in the repository |
License | The root directory contains the full standard Apache License 2.0 text |
Ownership |
|
Buildability |
|
Tool definitions | All 15 tools provide call boundaries, parameter semantics, and standard MCP security annotations |
Anti-regression | Release verification runs |
MCP tool discovery needs no model or GitHub credentials; only database or GitHub read/write tools depend on the corresponding runtime
services and Secrets at call time. The full deployment contract is in docs/deployment.md.
System Architecture
flowchart LR
GH[GitHub Issue / Failed CI / Pull Request] --> CP[RepoPilot Control Plane]
CP --> DB[(PostgreSQL + pgvector)]
CP --> MX[Matrix Admin → Manager DM]
MX --> M[AgentTeams Manager]
M --> TL[Repo Lead]
TL --> L[Locator]
TL --> F[Fixer]
TL --> V[Verifier]
TL --> A[Archivist]
M --> R[Reviewer]
L & F & V & A --> MCP[RepoPilot MCP via Higress]
R --> MCP
MCP --> GHAPI[GitHub REST API]
MCP --> DB
DB --> UI[Evidence Console]
CP --> OTEL[OTLP / AgentLoop / LoongSuite]More design details are in docs/architecture.md.
Project Structure
RepoPilot/
├── apps/
│ ├── control-plane/ # Fastify REST / Webhook / MCP / 审批 / 证据账本
│ └── console/ # 飞行记录器风格 React 证据控制台
├── packages/contracts/ # Zod Schema、共享类型和显式状态机
├── deploy/agentteams/ # AgentTeams v1.2.2 Worker / Team 清单
├── skills/ # 6 个可复用 RepoPilot Skills
├── evaluation/ # Proof Bundle 协议与可靠性 Benchmark
├── scripts/ # Skill 校验、可靠性基线与离线评测
├── docs/ # 架构、安全、部署和 Demo 文档
├── CONTRIBUTING.md # 开发流程、质量门禁与贡献规范
├── Dockerfile # Streamable HTTP Control Plane 生产容器
├── glama.json # Glama MCP Registry 维护者声明
├── API.md # REST / Webhook / MCP 出入参
├── Method.md # 外部 SDK、HTTP Method 与调用契约
└── docker-compose.yml # PostgreSQL 16 + pgvectorQuick Start
Prerequisites
Node.js
20+pnpm
9+Docker Desktop / Docker Engine
Model credentials are not a prerequisite for building, testing, or running the local control plane.
git clone https://github.com/wellkilo/RepoPilot.git
cd RepoPilot
cp .env.example .env
docker compose up -d postgres
pnpm install --registry=https://registry.npmjs.org
pnpm build
pnpm --filter @repopilot/control-plane startOpen the console:
http://127.0.0.1:3000You can also use one-click initialization:
./init.shProduction Container
The root Dockerfile builds the Console, shared contracts, and Control Plane, and starts
the same production process as a non-root user:
docker build -t repopilot:local .
docker run --rm -p 3000:3000 \
-e DATABASE_URL=postgres://repopilot:repopilot@host.docker.internal:5432/repopilot \
-e GITHUB_ALLOWED_REPOSITORIES=wellkilo/repopilot-testbed \
repopilot:localMCP clients connect to http://127.0.0.1:3000/mcp. When GitHub reads or writes are needed, inject
GITHUB_TOKEN via runtime Secrets; the image contains no credentials.
stdio MCP
When a Registry or local MCP client needs stdio, first generate the standalone runtime package, then start the root entry point:
pnpm glama:build
pnpm glama:verify
node mcp-server.mjsglama:verify performs a real MCP initialization and validates the
15 tools in an environment without database or GitHub credentials. Tool discovery does not connect to external services; real services
and credentials are still required when actually executing data or GitHub operations.
Creating Your First Run
curl -X POST http://127.0.0.1:3000/api/v1/runs \
-H 'Content-Type: application/json' \
-d '{
"source": {
"type": "github_issue",
"repository": "wellkilo/repopilot-testbed",
"issueNumber": 1
},
"executionPolicy": "pull_request_only"
}'To read GitHub Issues, configure GITHUB_TOKEN in the local .env. If no
AgentTeams Matrix is configured, the Run stops at awaiting_dispatch and does not fake execution results with Mock Agents.
After binding the repository Webhook's Pull requests events, creating, reopening, pushing new
commits to, or marking a non-Draft PR as ready for review all trigger an independent review Run. The Reviewer reads the PR, paginated diff, and
Checks, and idempotently creates or updates a single RepoPilot PR Review comment; if the PR gains new commits
during review, the old Run is rejected for publication due to a head SHA mismatch.
Real AgentTeams Collaboration
Real Agent reasoning requires an OpenAI-compatible model endpoint, such as:
Managed services like Alibaba Cloud Bailian;
Other OpenAI-compatible APIs;
Local compatible endpoints like Ollama.
Model keys are only given to AgentTeams/Higress; they never enter RepoPilot source code, the database, or deployment manifests.
Deployment docs:
Reproducible Testbed
The testbed contains a deterministic concurrency defect: two requests for the same GitHub delivery can simultaneously pass through the find / save window, creating two tasks and executing dispatch twice. RepoPilot consolidates create-or-reuse into DeliveryTaskStore.getOrCreate, so the same delivery shares a single in-flight Promise, and adds sequential retries plus a negative control for different deliveries. The PR remains open for review and does not trigger auto-merge.
The PR Review Demo uses the separate public
PR #5: the code compiles, and all 5 tests plus GitHub Actions pass, but the Reviewer does not equate green CI with correct code. It reads the 5 changed files page by page, identifies three semantic defects on the pinned revision b504cec — stale SHA, comment pagination, and failed Evidence — and publishes the same hosted comment through the real GitHub REST API. The review_publication record of that Run and the 8-entry hash-chained Evidence have been redacted and exported to
docs/assets/demo/pr-review-run.json.
Verification
pnpm typecheck
pnpm benchmark:reliability
pnpm skills:validate
pnpm lint
pnpm format:check
pnpm buildThe current control-plane reliability baseline is 52/52. Tests cover state machines, webhook signature verification, evidence hashing, database immutability triggers, delivery concurrency idempotency, approval versions with single-use consumption, Agent Skill Step lifecycle, Proof Bundle integrity checks, PR Review provenance with stale SHA protection, HTTP conflict semantics, and console labels. CI generates structured JSON reports.
Security Boundaries
The detailed threat model and production hardening items are in docs/security.md.
Documentation Navigation
Document | Content |
REST, Webhook, and MCP Schema | |
AgentTeams, Matrix, GitHub, PostgreSQL, and OTel method contracts | |
Architecture, state machines, and deployment profiles | |
Permissions, approvals, credentials, and evidence integrity | |
Local, AgentTeams, Webhook, and observability deployment | |
Public reproduction flow, run evidence, and failure branches | |
Reliability layering, Proof Bundle, and Benchmark | |
Engineering roadmap and capabilities to be completed | |
Development environment, quality gates, and contribution flow |
Current Boundaries
Without a configured model service, real AgentTeams inference cannot complete; build, tests, control plane, and testbed are unaffected.
The Runbook defaults to PostgreSQL full-text search;
vector(1536)is reserved for semantic recall.AgentLoop Recall is an optional capability and degrades automatically to the local Runbook when no credentials are available.
Console approval identity is currently demonstrated via a trusted reverse-proxy Header; production must integrate OIDC/SSO.
Available Tools
14 toolsgithub_create_pull_requestA
Create a GitHub pull request from an existing repair branch for a maintenance run. Use only after the patch and focused verification are complete; this is the highest automatic repository write allowed by pull_request_only. It creates an external PR and appends a git_reference evidence record, but never merges it.
Inputs: base (required), body (required), head (required), runId (required), +2 more.
github_get_issueARead-onlyIdempotent
Read the current title, body, labels, state, and URL of one GitHub issue in an allowed repository. Use this to establish source requirements before triage; do not use it for pull requests. This performs a read-only GitHub API request and requires GITHUB_TOKEN.
Inputs: repository (required), issueNumber (required).
github_get_pull_requestARead-onlyIdempotent
Read current metadata for the pull request bound to a RepoPilot review run, including its immutable head SHA and change totals. Use before reviewing files or publishing a review. The run, repository, and pull request must match, and the call fails if the GitHub head changed.
Inputs: runId (required), pullNumber (required), repository (required).
github_get_pull_request_checksA
Read GitHub combined commit statuses and Actions check runs for a pull request, then append the result as ci_result evidence. Use during verification or read-only review after a PR exists. For review runs, the PR number and current head SHA must still match the run.
Inputs: runId (required), pullNumber (required), repository (required).
github_list_pull_request_filesARead-onlyIdempotent
Read one 100-file page of changed-file metadata and GitHub-provided text patches for the pull request bound to a review run. Use consecutive page values until hasNextPage is false. The tool verifies the head SHA before and after reading and returns null patch values for binary or unavailable diffs.
Inputs: runId (required), pullNumber (required), repository (required), page.
github_merge_pull_requestADestructive
Squash-merge a GitHub pull request only after a human approved this exact merge for the same maintenance run. Do not call for pull-request review runs or without the matching approval ID and version. The approval is atomically consumed before the external merge, so it cannot authorize another action.
Inputs: runId (required), approvalId (required), pullNumber (required), repository (required), +2 more.
repopilot_append_evidenceA
Append one immutable, SHA-256 hash-chained evidence record to an existing RepoPilot run. Use after each material decision, tool result, Git reference, CI result, or error; never include credentials or raw secrets. This is append-only and repeated calls create distinct evidence records.
Inputs: runId (required), payload (required), evidenceType (required), stepId.
repopilot_finish_stepAIdempotent
Finish a running RepoPilot Step with an explicit terminal outcome and evidence-backed summary. Use only after the associated Skill has stopped; do not use it to update a Step that is still running. Repeating the same status and summary is idempotent, while a conflicting terminal result is rejected.
Inputs: status (required), stepId (required), summary (required).
repopilot_publish_proof_commentAIdempotent
Build a redacted Proof Bundle from a terminal maintenance run, verify its evidence chain, and create or update the run-scoped managed GitHub PR comment. Use only for the PR recorded in that run's create_pull_request evidence. Repeating the call updates the same marked comment instead of posting duplicates.
Inputs: runId (required), pullNumber (required), repository (required).
repopilot_publish_review_commentAIdempotent
Create or update one managed GitHub review summary comment for the exact pull request head SHA bound to an active read-only review run. Call after reading all relevant diff pages and checks, while the Reviewer Step is running. This publishes findings but never approves, requests changes, modifies code, or merges.
Inputs: runId (required), headSha (required), summary (required), verdict (required), +3 more.
repopilot_request_approvalA
Create a human approval request for one high-risk action on a maintenance run. Use before merge, branch deletion, rollback, permission changes, secret changes, or another explicitly gated action. This records the request and may pause the run, but it never executes the requested action.
Inputs: runId (required), action (required), details (required), riskLevel (required).
repopilot_search_runbooksARead-onlyIdempotent
Search verified historical RepoPilot runbooks for a target repository using failure symptoms or repair terms. Call during triage before selecting a repair strategy; do not use it as proof that a current defect is identical. Returns ranked stored runbooks and does not modify repository or run state.
Inputs: query (required), repository (required), limit.
repopilot_start_stepAIdempotent
Start one durable Agent Skill execution Step for an existing RepoPilot run. Call this immediately before executing the named Skill, then pass the returned Step ID to repopilot_finish_step. Reusing the same idempotency key within a run returns the existing Step instead of creating a duplicate.
Inputs: runId (required), agentName (required), skillName (required), idempotencyKey (required).
repopilot_write_runbookA
Archive a verified maintenance outcome as a reusable repository runbook. Call only after independent verification for the source run; do not archive an unverified hypothesis or a pull-request review run. This inserts a new runbook and appends runbook evidence.
Inputs: title (required), content (required), summary (required), repository (required), +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool has a clearly distinct purpose with detailed descriptions. The two publish comment tools are distinguished by run type (proof vs review), and the start/finish step pair is unambiguous. GitHub tools cover specific resource actions with no overlap.
Tools follow a consistent prefix-verb-noun pattern (repopilot_ and github_ prefixes). Minor inconsistency: get vs list for PR checks vs files, but overall convention is predictable and readable.
14 tools is within the ideal 3-15 range and well-scoped for maintenance automation integrating RepoPilot orchestration and GitHub operations. Each tool fills a specific role without redundancy.
Core lifecycles are covered: step start/finish, evidence chain, approval, runbook search/write, and GitHub PR review/merge flow. Minor gaps exist (no explicit step abort, no runbook listing or evidence query), but agents can complete primary workflows without dead ends.
Maintenance
Related MCP Connectors
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
MCP-native AI SRE: ask what's broken in production, get a reviewed GitHub fix PR.
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that diagnoses GitHub Actions workflow failures and automatically creates repair pull requests using LLM-generated unified diffs. It includes a governance layer to orchestrate autonomous fixes or human-reviewed repairs based on risk assessment thresholds.-
- AlicenseAqualityDmaintenanceMCP server for automated GitHub repository quality management, enabling review, README generation, cleanup, and monitoring.6MIT
- AlicenseAqualityDmaintenanceAn MCP server that provides operational tooling over the GitHub API — issue triage, PR review monitoring, repo health audits, and team access reviews.111MIT
- AlicenseCqualityDmaintenanceA policy-aware MCP server for GitHub and GitHub Actions that enables safe AI-assisted infrastructure workflows—inspecting repositories, preparing branches and pull requests, and constrained remote mutations behind explicit preview-bound approval tokens.18MIT