Skip to main content
Glama

LGTMCP

A Model Context Protocol (MCP) server that provides AI-powered code review using Google Gemini 3.6 Flash. 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%. Those figures were measured with the previous default model, gemini-3.1-pro-preview; they have not been remeasured on Gemini 3.6 Flash, which is priced lower per token. You should decide whether that is slow and expensive or fast and cheap.

Features

  • AI Code Review: Leverages Google Gemini 3.6 Flash for intelligent code analysis

  • Automatic Commit: Commits changes when code passes review (optional)

  • Security Scanning: Built-in secret detection using Gitleaks

  • Gitignore Protection: Prevents access to gitignored files during review

  • Project Guidelines: Discovers AGENTS.md and REVIEW.md for project-specific review rules

  • MCP Integration: Works seamlessly with Claude Desktop and other MCP clients

  • Review-Only Mode: Option to get feedback without automatic commits

Related MCP server: MCP Code Crosscheck

Installation

Build from source

git clone https://msrl.dev/lgtmcp.git
cd lgtmcp
make build

Install to ~/bin

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"

Configuration

  1. Get a Google API key from Google AI Studio.

  2. Create configuration directory:

    mkdir -p ~/.config/lgtmcp
  3. Create configuration file from example:

    cp config.example.yaml ~/.config/lgtmcp/config.yaml
  4. Edit the configuration file with your settings:

    google:
      api_key: "your-gemini-api-key-here"
    gemini:
      model: "gemini-3.6-flash"
      # fallback_model: "gemini-2.5-pro" # Optional; disabled by default
    logging:
      level: "info"

The optional fallback_model is used when we run into quota exhaustion on the primary model. It is disabled by default (none); Gemini 3.6 Flash is generally available with generous daily rate limits, so a fallback is rarely needed. Set fallback_model to a model name (e.g. gemini-2.5-pro) if you want a safety net.

Claude Code configuration

  1. Set up configuration file as described above

  2. Configure LGTMCP with Claude Code:

claude mcp add lgtmcp -- lgtmcp

Usage

Basic Usage

The MCP server exposes two tools:

review_only

Reviews code changes and returns feedback without committing.

Parameters:

  • directory: Path to the git repository

review_and_commit

Reviews 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 repository

  • commit_message: Message for the commit if approved

Example Workflows

Review only (no commit):

review_only("/path/to/repo")

Review and commit if approved:

review_and_commit("/path/to/repo", "Add new feature")

What Happens

  1. Security check: Scans files for secrets using Gitleaks

  2. Diff generation: Creates diff of all staged and unstaged changes

  3. AI review: Sends diff to Gemini 3.6 Flash for analysis

    • Gemini can request file contents for context

    • Gitignored files are automatically blocked from access

  4. Decision:

    • If approved (LGTM): Returns approval message (review_only) or commits changes (review_and_commit)

    • If not approved: Returns detailed feedback

Project-Specific Review Guidelines

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).

Configuration

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.

Logging

LGTMCP logs are written to platform-specific default locations:

  • macOS: ~/Library/Logs/lgtmcp/lgtmcp.log

  • Linux: ~/.local/share/lgtmcp/logs/lgtmcp.log (or $XDG_DATA_HOME/lgtmcp/logs/lgtmcp.log)

  • Windows: %LOCALAPPDATA%\lgtmcp\logs\lgtmcp.log

You can configure logging in your config.yaml:

logging:
  output: "directory" # Options: none, stderr, directory
  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

Development

Building

make build

Testing

make test

Linting

make lint

Coverage

make coverage

Troubleshooting

"Not a git repository" error

  • Ensure you're in a git repository with a .git directory

"Secrets detected" error

  • Review and remove any exposed secrets from your changes

"Gemini API error"

  • Verify your API key is valid and has quota remaining

  • Check network connectivity

"No changes to review"

  • Make sure you have staged or unstaged changes in your repository

Install Server
A
license - permissive license
A
quality
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables automated GitHub Pull Request reviews using local Ollama, Cursor CLI, or Gemini CLI as AI providers. Supports customizable review prompts, comprehensive PR analysis, and optional auto-posting of reviews to GitHub.
    10
    5
    MIT
  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables AI-assisted code review with bias mitigation strategies through cross-model evaluation and bias-aware prompting. Detects AI-generated code from commit authors and provides structured reviews with security, performance, and maintainability analysis.
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI-powered, zero-trust code review with multiple models, supporting single files, git diffs, and multiple files, with security, performance, and architecture checks across 10+ languages.
    13
    MIT

View all related MCP servers

Related MCP Connectors

  • Agentic code review, no signup to try: reality gates + frontier-model review, with veto.

  • Risk-scan a diff, flag AI-generated-code tells, find secrets. 5 of 7 tools need no account.

  • Screens public GitHub repos and PRs to generate risk maps, findings, and merge-readiness signals.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shields/lgtmcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server