loading…
Search for a command to run...
loading…
Gemini-powered code review. Offers review-only and review-and-commit modes with integrated Gitleaks security scanning.
Gemini-powered code review. Offers review-only and review-and-commit modes with integrated Gitleaks security scanning.
A Model Context Protocol (MCP) server that provides AI-powered code review using Google Gemini 3.1 Pro. LGTMCP reviews your code changes and either commits them automatically (if approved) or provides detailed feedback for improvements.
In my usage, the median review takes 1.9 minutes and costs $0.20, with an acceptance rate around 45%. You should decide whether that is slow and expensive or fast and cheap.
AGENTS.md and REVIEW.md for project-specific review rulesgit clone https://msrl.dev/lgtmcp.git
cd lgtmcp
make build
make install
This installs the binary to ~/bin by default. You can customize the installation directory:
make install INSTALL_PATH=/usr/local/bin
Note: Ensure ~/bin is in your shell's PATH. Add this to your shell configuration file if needed:
# For bash/zsh
export PATH="$HOME/bin:$PATH"
Get a Google API key from Google AI Studio.
Create configuration directory:
mkdir -p ~/.config/lgtmcp
Create configuration file from example:
cp config.example.yaml ~/.config/lgtmcp/config.yaml
Edit the configuration file with your settings:
google:
api_key: "your-gemini-api-key-here"
gemini:
model: "gemini-3.1-pro-preview"
fallback_model: "gemini-2.5-pro" # Default; set to "none" to disable
logging:
level: "info"
The fallback_model is use when we run into quota exhaustion on the primary
model. While Gemini 3.1 Pro is in preview, it has very low daily rate limits.
Set up configuration file as described above
Configure LGTMCP with Claude Code:
claude mcp add lgtmcp -- lgtmcp
The MCP server exposes two tools:
review_onlyReviews code changes and returns feedback without committing.
Parameters:
directory: Path to the git repositoryreview_and_commitReviews code changes and commits if approved. This is a separate tool so that
you can set tool permissions on it differently from review.
Parameters:
directory: Path to the git repositorycommit_message: Message for the commit if approvedReview only (no commit):
review_only("/path/to/repo")
Review and commit if approved:
review_and_commit("/path/to/repo", "Add new feature")
review_only) or commits changes (review_and_commit)Repositories can include AGENTS.md and/or REVIEW.md files with project-specific
review guidelines. LGTMCP automatically discovers these files by walking from each
changed file's directory up to the repo root, and injects their contents into the
review prompt. Files are deduplicated and sorted root-first (shallowest depth first).
All configuration is managed through the YAML configuration file located at:
$XDG_CONFIG_HOME/lgtmcp/config.yaml (if XDG_CONFIG_HOME is set)~/.config/lgtmcp/config.yaml (default)See config.example.yaml for all available configuration options.
LGTMCP logs are written to platform-specific default locations:
~/Library/Logs/lgtmcp/lgtmcp.log~/.local/share/lgtmcp/logs/lgtmcp.log (or $XDG_DATA_HOME/lgtmcp/logs/lgtmcp.log)%LOCALAPPDATA%\lgtmcp\logs\lgtmcp.logYou can configure logging in your config.yaml:
logging:
output: "directory" # Options: none, stdout, stderr, directory, mcp
level: "info" # Options: debug, info, warn, error
# directory: "/custom/log/path" # Optional custom directory
To view logs on macOS:
# View the log file
tail -f ~/Library/Logs/lgtmcp/lgtmcp.log
# Or open in Console.app
open ~/Library/Logs/lgtmcp/lgtmcp.log
make build
make test
make lint
make coverage
"Not a git repository" error
.git directory"Secrets detected" error
"Gemini API error"
"No changes to review"
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"lgtmcp": {
"command": "npx",
"args": []
}
}
}