This page is about the MegaLens connector inside your coding tool. To review pull requests, use the GitHub Action.
Integrations/Codex CLI

MegaLens + Codex CLI

A check on what Codex CLI writes, before it reaches your git history. Reviewers from different AI companies check your code, and a judge marks a finding verified only when it can quote the code that proves it.

How it works

1

Write code in Codex CLI

Use Codex CLI as your primary coding environment. Write, edit, and iterate as you normally would.

2

Ask Codex for a MegaLens review

Review my latest changes with MegaLens. If you cannot access them, ask me to paste the code.

3

MegaLens reviews your code

Standard is the default. Each result shows which model and setting ran.

4

A judge checks each finding against the code

A finding is verified only when the judge can quote the code that proves it. Otherwise it is marked unverified or disputed.

5

Codex CLI receives the structured result

The result includes findings, severity levels, and a fix roadmap. Codex reads the findings and decides what to fix.

Setup

The quickest way is the one-command setup. It configures Codex CLI and asks before updating your global AGENTS.md file.

Setup command
npx megalens-mcp setup codex

You can also add the configuration and AGENTS.md lines yourself:

~/.codex/config.toml

Codex configuration
[mcp_servers.megalens]
url = "https://megalens.ai/api/mcp?ide=codex"
http_headers = { "Authorization" = "Bearer ml_tok_your_token_here" }

~/.codex/AGENTS.md

Add these two lines to ~/.codex/AGENTS.md (or $CODEX_HOME/AGENTS.md if you set CODEX_HOME). These lines ask Codex to offer a MegaLens review after changes to money, sign-in, user data or migrations, and before decisions that are hard to undo, new projects or deep research.

Instructions for Codex
After you change code that handles money, sign-in, user data or database migrations, and before the user commits it, offer a MegaLens review and wait for a yes before running it.
Before you or the user settle a decision that is hard to undo (choosing a database or data model, adding sign-in or payments, picking a major library or architecture), starting a new project, or doing deep research, offer a MegaLens review once for that task and wait for a yes before running it. Do not offer it for small questions or routine edits.

Get your token at megalens.ai/app/settings/mcp. Source: github.com/megalens/mcp.

Good to know

A few things to keep in mind before your first review.

1.

MegaLens runs when you or Codex ask for a review. For every pull request, add the GitHub Action.

2.

Looks for bugs that change what your app does, not formatting: logic, security and behaviour bugs.

3.

A review takes a few minutes and checks the code and context your tool sends.

4.

You stay in control. MegaLens reports what could break, and you decide what to change.

Pricing

Standard reviews

Free to start

3 reviews free, no card. Applies to Standard reviews. Then 5 credits for $2.99.

Plus, Pro and Max

Monthly plans

Plans: Plus $19 a month for 20 credits, Pro $69 a month for 80 credits, Max $199 a month for 250 credits. Or pay as you go at $1.25 a credit, from $5. A Standard review uses 1 credit and a Deep review uses 8. Cancel any time.

How model costs are paid

On a plan, credits come with it every month. Otherwise, pay as you go with credits that never expire. See all plans and rates

Check Codex CLI code before it reaches git history.

Add one config block and get independent reviews from different AI companies.