prforge

prforge

PRForge is an agentic PR bot that reads a GitHub issue, understands the codebase, writes a fix, runs tests in a sandbox, and opens a human-reviewed pull request. It can also run as an MCP server to provide tools for Claude Desktop or Cursor.

Category
访问服务器

README

PRForge 🔨

An agentic PR bot that reads a GitHub issue, understands the codebase, writes a fix, runs the tests in a sandbox, and opens a human-reviewed pull request. Built as a GSoC 2026 co-pilot and an AI-engineering portfolio centerpiece.

flowchart TD
    A[Issue URL] --> B[fetch_issue]
    B --> C[clone + repo map]
    C --> D[localize files]
    D --> E[plan]
    E --> F[edit SEARCH/REPLACE]
    F --> G[run tests in sandbox]
    G --> H{pass?}
    H -- no, retries left --> F
    H -- yes / max --> I[review diff — HUMAN APPROVES]
    I -- approved --> J[push + open PR]
    I -- rejected --> END[abort]
    J --> END

Why

  • For GSoC 2026: point it at an org's issue → it reads the codebase, drafts a fix you review. Cuts ramp-up time and turns a 4-hour issue into a 30-minute reviewed PR.
  • For internships: "I built a human-in-the-loop agentic coding agent with sandboxed execution, evaluated on SWE-bench" is a top-1% resume line.
  • For clubs: AI Club / Open Source Club / GDG talk material.

It is a co-pilot, not an autopilot — every push passes a human approval gate. (GSoC mentors want to see your understanding, not spam PRs.)

Install

git clone https://github.com/daksh1403/prforge.git
cd prforge
python -m venv .venv && source .venv/bin/activate
pip install -e '.[anthropic,dev]'      # or [openai] or [ollama]
cp .env.example .env                    # fill in your API key

Configure

.env (one provider only):

PRFORGE_LLM_PROVIDER=anthropic          # anthropic | openai | ollama
ANTHROPIC_API_KEY=sk-ant-...
PRFORGE_MODEL=claude-sonnet-4-5-20250929
PRFORGE_MAX_ITERATIONS=3
PRFORGE_AUTO_APPROVE=false

For local/free runs with Ollama: ollama pull qwen2.5-coder:7b, set PRFORGE_LLM_PROVIDER=ollama.

Usage

# fetch an issue (no LLM, no writes)
prforge fetch https://github.com/owner/repo/issues/42

# clone + map a repo (no LLM)
prforge map https://github.com/owner/repo.git

# solve end-to-end, dry run (local clone + diff, NO push, NO PR)
prforge solve https://github.com/owner/repo/issues/42 --dry-run

# inspect the generated diff
prforge diff https://github.com/owner/repo/issues/42

# go live: review the diff, approve, PR opens
prforge solve https://github.com/owner/repo/issues/42 --no-dry-run

# skip the gate (CI / batch) — use with care
prforge solve https://github.com/owner/repo/issues/42 --no-dry-run --yes

The sandbox

Tests run inside a Docker container with no network and resource limits, so the agent can't exfiltrate data or run wild. Build it once:

docker build -t prforge-sandbox:latest -f sandbox/Dockerfile .

If the image is missing, PRForge falls back to running tests locally (with a warning) so you can still iterate.

How it works

Stage What happens
fetch_issue gh CLI fetches the issue (falls back to the public API)
clone_and_map shallow clone + a compact repo map (file tree + line counts)
localize LLM picks the 2–6 most relevant files from the map
plan LLM writes a concrete step-by-step plan
edit LLM emits Aider-style SEARCH/REPLACE blocks; applied exactly
test repo's test command runs in the sandbox
review shows the git diff; you approve before anything is pushed
push_and_pr branch → commit → push → gh pr create with an LLM-written body

The loop retries edit → test up to PRFORGE_MAX_ITERATIONS times, feeding test failures back to the LLM.

More commands

# eval harness — no API key needed
prforge eval --self-test
# eval harness — real LLM over instances.jsonl
prforge eval eval/instances.jsonl
# batch solve many issues from a file
prforge batch issues.txt --dry-run
# run as an MCP server (tools for Claude Desktop / Cursor)
prforge mcp
# run the web dashboard
prforge dashboard

Safety

Risk Mitigation
Pushing broken code human approval gate before every push
Dangerous shell Docker sandbox, --network none, allowlisted commands
Spamming repos --dry-run default, never auto-PR repos you don't own
Cost runaway iteration cap + token truncation + local Ollama fallback
Secret leakage your GitHub token never reaches the LLM; sandbox has no network

Project layout

prforge/
├── src/prforge/
│   ├── cli.py              # Typer + Rich CLI
│   ├── config.py           # env-driven config
│   ├── llm.py              # Anthropic / OpenAI / Ollama abstraction
│   ├── utils.py            # run(), json parsing, truncation
│   ├── agent/
│   │   ├── state.py        # LangGraph TypedDict
│   │   ├── prompts.py       # localize/plan/edit/PR prompts
│   │   ├── nodes.py         # the Agent class + node functions
│   │   └── graph.py         # the StateGraph wiring
│   └── tools/
│       ├── github.py        # gh CLI wrapper (fetch/branch/push/PR)
│       ├── codebase.py      # clone, repo map, read/grep, diff
│       ├── editor.py        # SEARCH/REPLACE parse + apply
│       └── sandbox.py       # Docker test runner (+ local fallback)
├── sandbox/Dockerfile
├── tests/                   # editor, codebase, github, utils
└── examples/

Roadmap

  • [x] Phase 0–1: fetch, clone, map, single/multi-file edit, dry-run diff
  • [x] Phase 2: sandboxed tests + iterate-on-failure loop
  • [x] Phase 3: human approval + auto open PR
  • [x] Phase 4: SWE-bench-style eval harness + --self-test resolve rate
  • [x] Phase 5: batch mode, MCP-server mode, React + FastAPI dashboard

Evaluation

Run on SWE-bench-lite (or a 20-issue subset) and record the resolve rate. Even 10–20% is a legitimate, citable result for a student project.

References (study + contribute — these are GSoC orgs)

License

MIT © Daksh Agarwal

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选