You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The app uses a `config.yml` file for core configuration including the AI system prompt and tool definitions. This file contains:
138
+
139
+
#### Key Configuration Sections:
140
+
-**GitHub settings**: API endpoints, bot username, check run names
141
+
-**Queue configuration**: Worker limits and retry settings
142
+
-**Diff processing**: Chunk size limits for large diffs
143
+
-**Amp integration**: Command settings and MCP server configuration
144
+
-**System prompt**: The complete AI prompt template for code reviews
145
+
-**Tool definitions**: Available MCP tools and their usage instructions
146
+
147
+
#### Important Notes:
148
+
- The system prompt in `config.yml` defines how the AI reviews code
149
+
- Tool definitions specify which GitHub operations are available to the AI
150
+
- Environment variables are interpolated using `${VARIABLE_NAME}` syntax
151
+
- Modify the prompt template to customize review behavior and focus areas
152
+
- The configuration supports both development and production deployment modes
153
+
154
+
**Example customization:**
155
+
To adjust review focus, modify the `prompt_template` section in `config.yml` to emphasize specific areas like security, performance, or coding standards.
156
+
113
157
## API Endpoints
114
158
159
+
### Core Endpoints
115
160
-`GET /` - Service information
116
161
-`GET /health` - Health check
162
+
-`GET /queue/status` - Queue status information
163
+
-`GET /jobs/:jobId` - Job status information
164
+
-`POST /test/review` - Test endpoint for review functionality
For development, you'll need to expose your local server to the internet for GitHub webhooks to work:
182
+
183
+
1.**Install ngrok**: `npm install -g ngrok` or download from [ngrok.com](https://ngrok.com)
184
+
185
+
2.**Start your local server**:
186
+
```bash
187
+
npm run dev
188
+
```
189
+
190
+
3.**Expose with ngrok** (in a separate terminal):
191
+
```bash
192
+
ngrok http 5053
193
+
```
194
+
195
+
4.**Update your environment**:
196
+
- Copy the ngrok URL (e.g., `https://abc123.ngrok.io`)
197
+
- Update `CRA_PUBLIC_URL` and `APP_BASE_URL` in your `.env` file
198
+
- Update your GitHub App webhook URL to `{your-ngrok-url}/github/webhook`
199
+
125
200
### Build
126
201
```bash
127
202
npm run build
@@ -137,13 +212,41 @@ npm run type-check
137
212
npm run lint
138
213
```
139
214
215
+
### MCP Server
216
+
Run the standalone MCP server:
217
+
```bash
218
+
npm run mcp
219
+
```
220
+
221
+
Or build and run:
222
+
```bash
223
+
npm run mcp:build
224
+
```
225
+
226
+
## MCP Integration
227
+
228
+
The app includes a Model Context Protocol (MCP) server that exposes GitHub operations as tools for AI agents and code editors like Cursor.
229
+
230
+
### Available MCP Tools
231
+
-`leave_general_comment` - Leave general comments on pull requests
232
+
-`leave_inline_comment` - Leave inline comments on specific lines
233
+
-`create_check_run` - Create or update check run status
234
+
-`get_pr_info` - Get pull request details and optionally the diff
235
+
-`trigger_review` - Start the code review process
236
+
-`get_pr_comments` - Get all comments on a pull request
237
+
238
+
### Usage with AI Agents
239
+
The MCP server can be accessed via HTTP at `/mcp` endpoints or run as a standalone stdio server. See [`src/mcp/README.md`](src/mcp/README.md) for detailed configuration and usage instructions.
240
+
140
241
## Architecture
141
242
142
243
-**Hono.js**: Fast web framework for the server
143
244
-**GitHub API**: Integration with GitHub's REST API
144
245
-**GitHub Apps**: Secure app installation and JWT authentication
145
246
-**Job Queue**: Background processing for code reviews
146
247
-**Amp**: AI-powered code analysis engine
248
+
-**MCP Server**: Model Context Protocol server for AI agent integration
249
+
-**Installation Management**: Persistent storage for GitHub App installations
Copy file name to clipboardExpand all lines: src/mcp/README.md
+37-1Lines changed: 37 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,10 +104,15 @@ npm run mcp:build
104
104
105
105
The server uses the same configuration as the main application. Make sure your `config.yml` and environment variables are properly set:
106
106
107
+
### Environment Variables
108
+
-`GITHUB_APP_ID` - GitHub App ID
109
+
-`GITHUB_APP_PRIVATE_KEY` or `GITHUB_APP_PRIVATE_KEY_PATH` - GitHub App private key
107
110
-`GITHUB_BASE_URL` - GitHub API URL (default: https://api.github.com)
108
-
-`GITHUB_TOKEN` - GitHub access token
109
111
-`MCP_AUTH_TOKEN` - Token for MCP server authentication (optional)
110
112
113
+
### GitHub App Integration
114
+
The MCP server works with GitHub App installations for authentication. When accessing repositories, it uses the GitHub App's installation tokens rather than personal access tokens.
115
+
111
116
## Integration with AI Agents
112
117
113
118
### Cursor Configuration
@@ -131,6 +136,25 @@ Add to your Cursor settings:
131
136
}
132
137
```
133
138
139
+
### Amp Integration
140
+
141
+
The MCP server is automatically configured for use with Amp in `config.yml`:
142
+
143
+
```yaml
144
+
amp:
145
+
settings:
146
+
amp.mcpServers:
147
+
github:
148
+
command: "sh"
149
+
args: ["-c", "cd ${GITHUB_APP_CWD} && pnpm run mcp"]
0 commit comments