Copilot Leecher
# ๐ง Copilot Leecher
**English** | [ไธญๆ](#ไธญๆ่ฏดๆ)
> Squeeze every drop out of your GitHub Copilot premium requests โ turn follow-up prompts into free MCP tool calls.
## Why This Exists
GitHub Copilot charges by **premium requests** (300/month on Pro; each Claude Opus 4.6 call costs 3 requests), *not* by tokens. Through experimentation, we discovered:
| Action | Costs a Premium Request? |
|---|---|
| New user prompt | โ
Yes |
| Follow-up in the same session | โ
Yes |
| Tool call / MCP call | โ **No** |
So the most cost-effective way to use Copilot is: **pack as much work as possible into a single premium request**.
The problem? Humans rarely express everything perfectly in one shot. Follow-up questions ("wait, also do Xโฆ") are inevitable โ and each one burns another request.
**Copilot Leecher** solves this by providing a `request_review` MCP tool. When the agent finishes a task, it calls this tool and *blocks* โ waiting for your feedback via a local web UI. Your feedback is returned as a **tool call result** (free!), not a new user prompt. The agent then acts on your feedback within the *same* request.
One prompt โ review โ refine โ review โ approve. **All for the price of a single premium request.**
## How It Works
```
You (1 prompt) Copilot Agent
โ โ
โโโโ "Implement feature X" โโโโโโโโโบ (works on itโฆ)
โ โ
โ request_review() โ โ MCP tool call (FREE)
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ Web UI (localhost:3456) โ
โ โ "Also handle edge case Y" โ โ your feedback
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ (improves workโฆ) โ
โ โ
โ request_review() โ โ still FREE
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ "ok" โ โ approved
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โ
Done โโโโโโโโโโโโโโโโค
โ โ
Total premium requests used: 1
```
## Quick Start
### 1. Install & Build
```bash
git clone https://github.com/user/copilot-leecher.git
cd copilot-leecher
npm install
npm run build
```
### 2. Configure VS Code
Add to your VS Code `settings.json`:
```json
{
"github.copilot.chat.mcp.servers": {
"copilot-leecher": {
"command": "node",
"args": ["/absolute/path/to/copilot-leecher/dist/index.js"]
}
}
}
```
> Replace the path with your actual absolute path.
### 3. Restart VS Code & Open Dashboard
Restart VS Code. The MCP server auto-starts an HTTP dashboard at **http://127.0.0.1:3456**.
### 4. Use It
In your Copilot Chat prompt or Agent Contract, instruct the agent:
```
After completing your work, call the request_review tool with a taskId and summary.
Wait for feedback. If approved, finish. Otherwise, improve and request review again.
```
Then open http://127.0.0.1:3456 to review and provide feedback.
## Architecture
```
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ VS Code #1 โ โ VS Code #2 โ โ Browser โ
โ Copilot Agent โ โ Copilot Agent โ โ 127.0.0.1:3456 โ
โโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ
โ MCP โ MCP โ HTTP
โโโโโโผโโโโโ โโโโโโผโโโโโ โ
โMCP+HTTP โ โMCP only โ โ
โServer #1โ โServer #2โ โ
โ(:3456) โ โ(skipped)โ โ
โโโโโโฌโโโโโ โโโโโโฌโโโโโ โ
โโโโโโโโโโฌโโโโโโโโโโโโโ โ
โผ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ /tmp/copilot-reviewer-sessions/ โโโโโโโโโโโโโโโโ
โ (file-system persistence) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
- The first MCP process binds port 3456 for the web dashboard.
- Subsequent instances skip the HTTP server but share session data via the filesystem.
## MCP Tool: `request_review`
| Parameter | Type | Required | Description |
|---|---|---|---|
| `taskId` | string | โ
| Unique task identifier (e.g. `task-20260217-001`) |
| `summary` | string | โ
| Brief summary of work done (2-3 sentences) |
**Returns**: `{ status, feedback, sessionId, reviewerUrl }`
- `status`: `"approved"` or `"needs_revision"`
- `feedback`: The reviewer's text
## HTTP API
| Method | Endpoint | Description |
|---|---|---|
| GET | `/api/sessions` | List all sessions |
| GET | `/api/sessions/pending` | List pending sessions |
| GET | `/api/sessions/:id` | Get session details |
| POST | `/api/sessions/:id/feedback` | Submit feedback `{ "feedback": "..." }` |
| GET | `/api/health` | Health check |
## Agent Contract Template
Add this to your prompt / system instructions:
```markdown
After completing all tasks, you MUST call the `request_review` tool.
- taskId: a unique identifier for the task
- summary: 2-3 sentences describing what you did
Then wait for expert feedback:
- "ok" / "approved" / "lgtm" โ task complete, stop working
- anything else โ improve your work based on the feedback, then call request_review again
NEVER finish without an approved review.
```
<details>
<summary><strong>Full Agent Contract Example (click to expand)</strong></summary>
```markdown
# Agent Contract
## Review Requirements
### When to Request Review
After completing all task steps, you MUST call `request_review`.
### How to Call
- **taskId**: Use format `[type]-[date]-[seq]` (e.g. `feature-20260217-001`)
- **summary**: 2-3 sentences summarizing your work
### Handling Feedback
1. **Approved** ("ok" / "approved" / "lgtm"): Stop working, confirm completion
2. **Needs revision**: Read feedback, improve, call request_review again
3. **Timeout**: Inform user, offer to retry
### Rules
- โ NEVER finish without approved review
- โ NEVER skip the review step
- โ
Always request review after completing work
- โ
Keep improving until approved
```
</details>
## Project Structure
```
src/
โโโ index.ts # MCP server entry (auto-starts HTTP server)
โโโ reviewer-server.ts # Express HTTP server + Web UI
โโโ types.ts # TypeScript type definitions
โโโ shared-state.ts # File-system-based session persistence
```
## Development
```bash
npm run watch # watch mode
npm run dev # build + run MCP server
```
## Troubleshooting
**MCP Server won't connect?**
Ensure an absolute path in `settings.json` and that `dist/index.js` exists. Check VS Code Output panel โ "MCP Server" logs.
**Port 3456 in use?**
A second MCP instance auto-skips HTTP startup. Sessions are shared via `/tmp/copilot-reviewer-sessions/` โ one dashboard shows all.
**Agent doesn't call request_review?**
Make sure your Agent Contract / prompt explicitly requires it.
## License
MIT
---
# ไธญๆ่ฏดๆ
> ่
GitHub Copilot Premium Request ็พๆฏ็ๅคไฟญ็ฉๆณ โโ ๆ่ฟฝ้ฎๅๆๅ
่ดน็ MCP tool callใ
## ไธบไปไนๅ่ฟไธช
GitHub Copilot ๆ **premium request ๆฌกๆฐ**่ฎก่ดน๏ผPro ๅฅ้คๆฏๆ 300 ๆฌก๏ผไธๆฌก Claude Opus 4.6 ่ฐ็จ็ฎ 3 ๆฌก๏ผ๏ผ่**ไธๆฏ**ๆ token ่ฎก่ดนใ็ป่ฟๅฎ้ช๏ผๆไปฌๅ็ฐ๏ผ
| ๆไฝ | ๆถ่ Premium Request๏ผ |
|---|---|
| ๆฐ็ user prompt | โ
ๆฏ |
| ๅ session ไธญ็่ฟฝ้ฎ/ๅ็ปญๆ้ฎ | โ
ๆฏ |
| Tool call / MCP ่ฐ็จ | โ **ๅฆ** |
ๆไปฅๆๅ็ฎ็็จๆณๆฏ๏ผ**่ฎฉไธๆฌก premium request ๅๅฐฝๅฏ่ฝๅค็ไบๆ
**ใ
้ฎ้ขๆฏ๏ผไบบๅพ้พไธๆฌกๆงๆ้ๆฑ่กจ่พพๆธ
ๆฅ๏ผ่ฟฝ้ฎๅจๆ้พๅ
โโไฝๆฏๆฌก่ฟฝ้ฎ้ฝไผ้ขๅคๆถ่ไธไธช requestใ
**Copilot Leecher** ๆไพไบไธไธช `request_review` MCP toolใAgent ๅฎๆไปปๅกๅ่ฐ็จๆญคๅทฅๅ
ท๏ผ่ฟๅ
ฅ*้ปๅก็ญๅพ
*็ถๆ๏ผไฝ ๅจๆฌๅฐ Web UI ไธ็ปๅบๅ้ฆใๅ้ฆไปฅ **tool call result**๏ผๅ
่ดน๏ผ๏ผ็ๅฝขๅผ่ฟๅ็ป Agent๏ผ่ไธๆฏๆฐ็ user promptใAgent ๅจ*ๅไธไธช request* ๅ
็ปง็ปญๅทฅไฝใ
ไธๆฌก prompt โ ๅฎกๆฅ โ ๆน่ฟ โ ๅฎกๆฅ โ ้่ฟใ**ๅ
จ็จๅชๆถ่ไธไธช premium requestใ**
็ฎๅๆฅ่ฏด๏ผ่ฟไธช MCP ๆๅก"้ช"ๅคงๆจกๅๆไฝ ไบๅฎไธ็่ฟฝ้ฎๅฝๆ tool call result ๆฅๅค็ใ
## ๅทฅไฝๅ็
```
ไฝ (1 ๆก prompt) Copilot Agent
โ โ
โโโโ "ๅฎ็ฐๅ่ฝ X" โโโโโโโโโโโโโโโโโโบ ๏ผๅผๅงๅนฒๆดปโฆ๏ผ
โ โ
โ request_review() โ โ MCP tool call๏ผๅ
่ดน๏ผ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ Web UI (localhost:3456) โ
โ โ "่พน็ๆ
ๅต Y ไนๅค็ไธไธ" โ โ ไฝ ็ๅ้ฆ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ ๏ผ็ปง็ปญๆน่ฟโฆ๏ผ โ
โ โ
โ request_review() โ โ ไป็ถๅ
่ดน
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ "ok" โ โ ้่ฟ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โ
ๅฎๆ โโโโโโโโโโโโโโโโค
โ โ
ๆถ่็ premium request ๆปๆฐ: 1
```
## ๅฟซ้ๅผๅง
### 1. ๅฎ่ฃ
& ๆๅปบ
```bash
git clone https://github.com/user/copilot-leecher.git
cd copilot-leecher
npm install
npm run build
```
### 2. ้
็ฝฎ VS Code
ๅจ `settings.json` ไธญๆทปๅ ๏ผ
```json
{
"github.copilot.chat.mcp.servers": {
"copilot-leecher": {
"command": "node",
"args": ["/ไฝ ็็ปๅฏน่ทฏๅพ/copilot-leecher/dist/index.js"]
}
}
}
```
### 3. ้ๅฏ VS Code & ๆๅผ Dashboard
้ๅฏ VS Code ๅ๏ผMCP Server ไผ่ชๅจๅจ **http://127.0.0.1:3456** ๅฏๅจ Web ๅฎกๆฅ็้ขใ
### 4. ไฝฟ็จ
ๅจ Copilot Chat ๆ็คบ่ฏๆ Agent Contract ไธญ๏ผๆ็คบ Agent๏ผ
```
ๅฎๆๆๆๅทฅไฝๅ๏ผ่ฐ็จ request_review ๅทฅๅ
ท๏ผ้ไธ taskId ๅๅทฅไฝๆ่ฆใ
็ญๅพ
ๅฎกๆฅๅ้ฆ๏ผ่ฅๅ้ฆไธบ "ok" / "approved"๏ผ็ปๆไปปๅก๏ผๅฆๅๆ นๆฎๅ้ฆๆน่ฟๅ้ๆฐ่ฏทๆฑๅฎกๆฅใ
ๆช้่ฟๅฎกๆฅไธๅพ็ปๆๅทฅไฝใ
```
็ถๅๆๅผ http://127.0.0.1:3456 ่ฟ่กๅฎกๆฅๅนถๆไบคๅ้ฆใ
## Agent Contract ๆจกๆฟ
```markdown
ๅฎๆๆๆไปปๅกๅ๏ผไฝ **ๅฟ
้กป**่ฐ็จ `request_review` tool๏ผ
- taskId: ไปปๅกๅฏไธๆ ่ฏ๏ผๅฆ feature-20260217-001๏ผ
- summary: 2-3 ๅฅ็ฎ่ฆๆ่ฟฐๅฎๆไบไปไน
็ถๅ็ญๅพ
ไธๅฎถๅ้ฆ๏ผ
- "ok" / "approved" / "lgtm" / "้่ฟ" โ ็ปๆๅทฅไฝ
- ๅ
ถไปๅ
ๅฎน โ ๆ นๆฎๅ้ฆๆน่ฟ๏ผ็ถๅๅๆฌก่ฐ็จ request_review
**้่ฆ๏ผๆช้่ฟๅฎกๆฅไธๅพ็ปๆๅทฅไฝ๏ผ**
```
<details>
<summary><strong>ๅฎๆด Agent Contract ็คบไพ๏ผ็นๅปๅฑๅผ๏ผ</strong></summary>
```markdown
# Agent Contract
## ๅฎกๆฅ่ฆๆฑ
### ไฝๆถ่ฏทๆฑๅฎกๆฅ
ๅฎๆๆๆไปปๅกๆญฅ้ชคๅ๏ผ**ๅฟ
้กป**่ฐ็จ `request_review`ใ
### ่ฐ็จๆนๅผ
- **taskId**: ๆ ผๅผ `[็ฑปๅ]-[ๆฅๆ]-[ๅบๅท]`๏ผๅฆ `feature-20260217-001`๏ผ
- **summary**: 2-3 ๅฅๆ่ฟฐไฝ ๅฎๆ็ๅทฅไฝ
### ๅ้ฆๅค็
1. **้่ฟ**๏ผ"ok" / "approved" / "lgtm" / "้่ฟ"๏ผ๏ผๅๆญขๅทฅไฝ๏ผ็กฎ่ฎคๅฎๆ
2. **้่ฆๆน่ฟ**๏ผ้
่ฏปๅ้ฆ๏ผๆน่ฟๅทฅไฝ๏ผๅๆฌก่ฐ็จ request_review
3. **่ถ
ๆถ**๏ผๅ็ฅ็จๆท๏ผ่ฏข้ฎๆฏๅฆ้ๆฐ่ฏทๆฑ
### ่งๅ
- โ ๆช็ปๅฎกๆฅ้่ฟไธๅพ็ปๆไปปๅก
- โ ไธๅพ่ทณ่ฟๅฎกๆฅๆญฅ้ชค
- โ
ๅฎๆๅทฅไฝๅ็ซๅณ่ฏทๆฑๅฎกๆฅ
- โ
ๆ็ปญๆน่ฟ็ดๅฐ่ทๆน
```
</details>
## ๅธธ่ง้ฎ้ข
**Q: MCP Server ๆ ๆณ่ฟๆฅ๏ผ**
็กฎไฟ `settings.json` ไธญไฝฟ็จ็ปๅฏน่ทฏๅพ๏ผไธ `dist/index.js` ๅญๅจใๆฅ็ VS Code ่พๅบ้ขๆฟ โ "MCP Server" ๆฅๅฟใ
**Q: ็ซฏๅฃ 3456 ่ขซๅ ็จ๏ผ**
็ฌฌไบไธช MCP ๅฎไพไผ่ชๅจ่ทณ่ฟ HTTP ๅฏๅจใSession ้่ฟ `/tmp/copilot-reviewer-sessions/` ๆไปถๅ
ฑไบซ๏ผๅไธไธช Dashboard ๅฏ่งๆๆๅฎไพ็ไผ่ฏใ
**Q: Agent ไธ่ฐ็จ request_review๏ผ**
ๆฃๆฅ Agent Contract ๆ็คบ่ฏไธญๆฏๅฆๆ็กฎ่ฆๆฑไบใ
## ่ฎธๅฏ่ฏ
MIT
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion or overlap between tools. The single tool 'request_review' has a clear, distinct purpose that cannot be mistaken for any other functionality.
A single tool inherently exhibits perfect naming consistency as there are no other tools to compare against. The name 'request_review' follows a clear verb_noun pattern that would be consistent if more tools existed.
One tool is generally too few for most server purposes, as it severely limits functionality and scope. While the tool's purpose is clear, a single tool feels thin and incomplete for handling complex workflows, suggesting an extreme mismatch with typical server design.
The server appears to focus on review workflows, but with only one tool for requesting reviews, there are severe gaps. Missing are tools for submitting work, checking review status, handling feedback, or managing the review process, making the surface incomplete and likely to cause agent failures.