How it works
Write code in Codex CLI
Use Codex CLI as your primary coding environment. Write, edit, and iterate as you normally would.
Trigger megalens_debate
Call the megalens_debate MCP tool from within Codex CLI. Your code and prompt are sent to the MegaLens review pipeline.
MegaLens selects up to four AI models from different companies to review your code
Two by default. Paid reviews can select three or four depending on the review. Free is capped at two. Each result names the models that actually took part.
A final check reviews their findings
It reads the findings and removes weak ones.
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 setup wizard. It detects Codex CLI and writes the config for you.
npx megalens-mcp setupThe wizard asks for your token and writes the config shown below. You can also add it yourself:
~/.codex/config.toml
[mcp_servers.megalens]
url = "https://megalens.ai/api/mcp?ide=codex"
http_headers = { "Authorization" = "Bearer ml_tok_your_token_here" }Get your token at megalens.ai/app/settings/mcp. Source: github.com/megalens/mcp.
Limitations
Here is what the integration cannot do today.
MegaLens only runs when you or Codex ask for a review.
A review takes a few minutes. It is not for autocomplete.
Advisory only. MegaLens does not change your code, merge, push, or run tests.
Pricing
Free
$0
Your first review is free, with no card. MegaLens selects two reviewing models for it. After that, pay as you go: $9 per 1M blended tokens, never more than $3 for one review.
Plus and Pro
From $19 a month
A monthly allowance of reviews with model usage included: up to 100 reviews on Plus, 300 on Pro. MegaLens selects up to four reviewing models. Cancel any time.
How model costs are paid
On a plan, model usage is part of your monthly allowance. Otherwise, pay-as-you-go credits: $9 per 1M blended tokens, capped at $3 per review, prepaid from $20. See all plans
Multi engine review inside Codex CLI.
Add one config block and get an independent AI review.