Skip to content

feat: Add review tool for code review functionality#6

Open
Lies188 wants to merge 1 commit intocexll:mainfrom
Lies188:feature/add-review-tool
Open

feat: Add review tool for code review functionality#6
Lies188 wants to merge 1 commit intocexll:mainfrom
Lies188:feature/add-review-tool

Conversation

@Lies188
Copy link

@Lies188 Lies188 commented Jan 22, 2026

Summary

This PR adds a new review tool to the Codex MCP server that enables automated code review using the Codex CLI's codex review command.

Changes

New Files

  • src/tools/review-codex.tool.ts: New review tool implementation

Modified Files

  • src/tools/index.ts: Register the review tool in the tool registry
  • src/utils/commandExecutor.ts: Add cwd parameter support for executing commands in specific working directories

Features

The review tool supports all codex review CLI options:

Parameter Description
uncommitted Review staged, unstaged, and untracked changes
commit Review changes from a specific commit SHA
base Review changes against a base branch
title Optional commit title for review summary
prompt Custom review instructions
config Configuration overrides (key=value)
enableFeatures Enable feature flags
disableFeatures Disable feature flags
workingDir Specify the git repository directory
timeout Custom execution timeout (ms)
debug Return raw output for troubleshooting

Usage Examples

// Review uncommitted changes
{ "uncommitted": true, "workingDir": "/path/to/repo" }

// Review a specific commit
{ "commit": "abc1234", "workingDir": "/path/to/repo" }

// Review changes against main branch
{ "base": "main", "workingDir": "/path/to/repo" }

// With custom review instructions
{ "commit": "abc1234", "prompt": "Focus on security issues", "workingDir": "/path/to/repo" }

Testing

Tested with:

  • --commit scenario
  • --uncommitted scenario
  • --base scenario
  • Custom prompt scenario
  • Debug mode

via HAPI

This PR adds a new `review` tool to the Codex MCP server that enables
automated code review using the Codex CLI's `codex review` command.

## Changes

### New Files
- `src/tools/review-codex.tool.ts`: New review tool implementation

### Modified Files
- `src/tools/index.ts`: Register the review tool in the tool registry
- `src/utils/commandExecutor.ts`: Add `cwd` parameter support for
  executing commands in specific working directories

## Features

The review tool supports:
- `--uncommitted`: Review staged, unstaged, and untracked changes
- `--commit <SHA>`: Review changes from a specific commit
- `--base <branch>`: Review changes against a base branch
- `--title`: Optional commit title for review summary
- `--prompt`: Custom review instructions
- `-c/--config`: Configuration overrides
- `--enable/--disable`: Feature flag controls
- `workingDir`: Specify the git repository directory
- `timeout`: Custom execution timeout
- `debug`: Return raw output for troubleshooting

## Usage Examples

```json
{ "uncommitted": true, "workingDir": "/path/to/repo" }
{ "commit": "abc1234", "workingDir": "/path/to/repo" }
{ "base": "main", "workingDir": "/path/to/repo" }
```

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant