Getting started
You can go from nothing to a reviewed merge request in about five minutes. You need a GitLab token, credentials for one LLM, and a Linux or macOS machine.
What mrsentry does
mrsentry is a command-line tool that you usually run in GitLab CI. It does two jobs:
- AI merge request review. It clones the repository at the MR head, reviews the change with full-repository context, and posts inline comments on the exact lines, plus one overview note.
- Container vulnerability fixing. It reads High/Critical findings for your image from Amazon ECR and maps each one to the dependency that brings it in, direct or transitive, across Java, Python and Node.js/TypeScript. Then it fixes it, either in a new MR or inside the MR being reviewed.
Five-minute setup
- Install
On Debian, Ubuntu, Amazon Linux, RHEL or macOS:
curl -fsSL https://raw.githubusercontent.com/devops-monk/mrsentry/main/install.sh | shThe installer brings its own Python 3.12, so the system Python doesn't matter. Other options, including Docker images, are in Installation.
- Create a GitLab token
Use a project or group access token, or a bot user's personal access token, with scopes
apiandwrite_repositoryand the Developer role or higher. The built-inCI_JOB_TOKENcan't post comments or push, so it won't work.export GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxxIf your company already keeps the token under a different variable name, point mrsentry at it with
gitlab.token_env. See GitLab token. - Give it an LLM
The default profile is Anthropic's Claude. Any LiteLLM model string works:
export ANTHROPIC_API_KEY=sk-ant-xxxx # or: --model azure/my-deployment, bedrock/…, openai/gpt-4.1, litellm_proxy/…Recipes for every provider are in LLM providers.
- Check everything
mrsentry doctorThis checks tools, GitLab reachability, token identity, scopes and project access, sends a one-word prompt to your LLM, and, if AWS credentials are present, checks your AWS identity and ECR scanning configuration.
- Review a merge request
mrsentry review --mr-url https://gitlab.example.com/group/app/-/merge_requests/42 --dry-run--dry-runwrites the overview tomrsentry-out/without touching GitLab. Remove it to post the comments.
Then automate it. Add one include: to your .gitlab-ci.yml and every merge request gets reviewed. Fixes and scheduled fix MRs are optional. See GitLab pipelines.