IntegrationsGitHub App Setup

GitHub App Installation

Configure Mesrai’s GitHub integration to enable automatic AI-powered code reviews on your repositories.

Prerequisites

Before installing the Mesrai GitHub App, ensure you have:

  • A Mesrai account (Sign up)
  • Admin access to the GitHub organization or repositories
  • Active subscription plan (View plans)

Installation Steps

1. Install the GitHub App

Navigate to the Mesrai GitHub App installation page:

  1. Click Install or Configure
  2. Select the organization or account
  3. Choose repositories:
    • All repositories (recommended for teams)
    • Only select repositories (for testing)

2. Grant Permissions

The Mesrai GitHub App requires the following permissions:

PermissionAccess LevelPurpose
Pull requestsRead & WritePost review comments and suggestions
Repository contentsReadAnalyze code changes and file structure
Commit statusesRead & WriteReport review status on PRs
Repository metadataReadAccess repository information

3. Configure Repository Settings

After installation, configure per-repository settings via the Mesrai Dashboard:

  1. Go to Repositories → Select your repo → Settings
  2. Configure review options:
    • Auto-review: Enable automatic reviews on PRs
    • Review triggers: Pull requests, push to main
    • Ignore patterns: *.md, docs/**, test/fixtures/**
    • Context settings: Include dependencies, max files (50)
    • Feedback style: Conversational with medium severity threshold

4. Test the Integration

Create a test pull request to verify the setup:

  1. Make a small code change
  2. Create a pull request
  3. Mesrai will automatically analyze and comment within 30 seconds

Repository Configuration

Enable/Disable Reviews

Toggle AI reviews per repository in your Mesrai Dashboard:

  • Go to Repositories → Select repo → Settings
  • Enable/disable Automatic Reviews
  • Configure review triggers

Custom Review Rules

Create custom rules for your team’s workflow via the dashboard:

  1. Go to SettingsCustom Rules
  2. Configure rule categories:
    • Security: Enable and block on critical issues
    • Performance: Monitor complexity metrics
    • Style: Enforce coding conventions

Webhook Configuration

Mesrai automatically configures webhooks. If you need to manually verify:

  1. Go to Repository SettingsWebhooks
  2. Find the Mesrai webhook
  3. Verify Recent Deliveries show successful responses

Webhook Events

Mesrai listens to these GitHub events:

  • pull_request (opened, synchronized, reopened)
  • pull_request_review (submitted)
  • push (to protected branches)
  • issue_comment (for manual review triggers)

Manual Review Triggers

Trigger reviews manually by commenting on a PR:

@mesrai review
@mesrai review --full
@mesrai review security

Troubleshooting

Reviews Not Appearing

Symptom: No comments from Mesrai on new PRs

Solutions:

  1. Verify webhook deliveries in repository settings
  2. Check Mesrai dashboard for repository status
  3. Verify auto-review is enabled in dashboard settings
  4. Confirm subscription is active

Permission Errors

Symptom: “Mesrai doesn’t have access to this repository”

Solutions:

  1. Reinstall the GitHub App with correct permissions
  2. Verify repository is included in app installation
  3. Check organization permissions if using GitHub Enterprise

Slow Review Times

Symptom: Reviews take longer than 2 minutes

Solutions:

  1. Check Status Page
  2. Reduce context size in dashboard settings
  3. Contact support if issue persists

Advanced Configuration

Branch Protection Rules

Integrate Mesrai with GitHub branch protection:

  1. Go to Repository SettingsBranches
  2. Edit protection rule for main
  3. Enable Require status checks to pass
  4. Select mesrai/review check

Custom Workflow Integration

Use Mesrai in GitHub Actions:

name: Code Review
on: [pull_request]
 
jobs:
  mesrai:
    runs-on: ubuntu-latest
    steps:
      - uses: mesrai/review-action@v1
        with:
          api-key: ${{ secrets.MESRAI_API_KEY }}
          pr-number: ${{ github.event.pull_request.number }}

Uninstallation

To remove Mesrai from your repositories:

  1. Go to GitHub SettingsApplicationsInstalled GitHub Apps
  2. Find Mesrai → Click Configure
  3. Scroll down and click Uninstall

Your data will be retained for 30 days as per our privacy policy.

Next Steps

Need Help?