GuidesAI agents

How to run an SEO audit with Codex, and check the fixes worked

Connect the Codex CLI to an SEO audit tool in two commands, run the audit, fix issues by cause and audit again. Includes headless sign-in, the config file, and what Codex gets wrong.

6 min readUpdated 2026-11-08By the Auditmatic team
On this page

Codex can read and edit your code, but it cannot see how search engines see your live site. An SEO audit tool connected over MCP gives it that view: the tool crawls the deployed site, Codex reads the findings and changes the code, and you audit again to confirm. This guide covers the Codex-specific parts, which are the install commands, the sign-in, the config file and the checks, and links to the general workflow for the rest.

  1. 1Addcodex mcp add writes the server into your config.
  2. 2Sign incodex mcp login opens the browser.
  3. 3Checkcodex mcp list shows it is registered.
  4. 4AuditAsk for the report, then fix and re-audit.
The setup sequence for Codex. Each step has a command you can check.

What you need before you start

  • The Codex CLI installed and working in your project folder.
  • An Auditmatic account to sign in with. The free audit works without one, but the agent connection needs it.
  • A site that is live on the internet. The crawler reads the public site, so a server on your laptop cannot be audited.

1. Add the server

codex mcp add auditmatic --url https://auditmatic.app/mcp

The --url flag registers a remote server that speaks streamable HTTP, as opposed to a local program. We ran this command with Codex CLI 0.167.0 and it wrote this entry to the config file:

[mcp_servers.auditmatic]
url = "https://auditmatic.app/mcp"

The file is ~/.codex/config.toml. OpenAI's documentation also describes a project-level .codex/config.toml, which Codex only reads for projects you have marked as trusted. Use the global file for a tool you want everywhere and the project file for one site only.

2. Sign in

codex mcp login auditmatic

This opens your browser so you can approve the connection. If you are working over SSH or in a container with no browser, add --no-browser. Codex prints a link, you open it on any machine, sign in, and paste the full address you land on back into the terminal. That works even if the page at that address fails to load, because the code you need is in the address itself.

3. Check that it is connected

codex mcp list

That lists the configured servers. Inside a Codex session, type /mcp to see the active ones. If the server is missing, the usual cause is that the add command ran against a different config than the one Codex is reading, so check which folder you started it in. For the other agents and the full tool list see the MCP docs.

4. Ask for the report, not just the issues

Audit example.com. Start a site audit with a limit of 50 pages,
wait for it to finish, then read the audit report. List only the
errors and warnings, grouped by cause, with the pages affected.
Do not change any code yet.

Naming the report matters. A crawl produces raw issues; the report groups them and adds page speed and homepage checks. In our own testing an agent once read only the raw list and called the site nearly clean while the report showed five errors. Saving the first result gives you a baseline to compare with later.

5. Fix one cause at a time

Most findings share a root cause, such as one template, one missing header or one setting. Ask Codex to fix a single cause and to explain the change before applying it:

Fix the pages missing a canonical tag. Show me the diff first and
explain what the tag does. Do not touch pages that should stay out
of search results.

Read the diff. Codex is good at finding the right file and cannot know your intent, so say which pages must stay private. A signed-in page with no links is not broken, and a model may still add links to it. Commit each fix on its own so a bad one is easy to undo.

6. Deploy, audit again, then check by hand

A fix in the code is not a fix in production until it is live. After you deploy, run the audit again and ask for a comparison:

Run the audit again and compare it with the last one. Which issues
are gone, which remain, and did any new ones appear?

Then spot-check the claims that matter. A header or a redirect takes ten seconds to confirm yourself:

curl -sI https://example.com | grep -i -E "^HTTP|x-robots-tag|strict-transport"

Settings worth knowing about

OpenAI documents several per-server options in the same config block. These are the ones that matter for an audit workflow:

SettingWhat it doesWhen to use it
tool_timeout_secHow long Codex waits for one tool call. Default 60.If a call times out, raise it. We have not needed to.
startup_timeout_secHow long Codex waits for the server to start. Default 10.On a slow connection.
enabled_tools / disabled_toolsLimits which tools Codex may call.To keep an agent read-only or on one task.
bearer_token_env_varReads a token from an environment variable.Headless or CI use, instead of the browser sign-in.

Check the current names against OpenAI's MCP documentation before relying on them, since a CLI can change between versions.

What Codex gets wrong

  • It reads the wrong output. Raw issues and the report differ. Name the report in every prompt.
  • It overfixes. Not every notice needs action. Tell it to stop after errors and warnings.
  • It trusts its own edit. It may report a fix as done before the change is deployed. Only the second audit settles it.

Where this fits

The steps after the connection are the same in every agent. The full loop, with the prompts and the reasoning behind each, is in how to run an SEO audit with Claude Code, and the Cursor version is in SEO audit with Cursor. If you are new to audits, start with the technical SEO audit checklist. The agent feature page lists what the connection can do beyond audits, and pricing explains what each audit costs in credits.

Frequently asked questions

Can Codex run an SEO audit by itself?

Not without a tool. It can read your repository but cannot crawl your deployed site, so it needs an audit server connected over MCP.

How do I connect Codex to an MCP server with no browser?

Run codex mcp login with --no-browser, open the printed link on another machine, and paste the final address back into the terminal.

Does this work in the Codex desktop app as well?

OpenAI documents adding a server through the app's settings, as a streamable HTTP server, then choosing Authenticate. We only tested the command line, so follow OpenAI's page for the app.

Is it safe to let Codex change my site?

Treat it like any contributor: read each diff, commit fixes separately and deploy yourself. The audit tool only reads your public site and reports.

Run the audit first

You can try a free audit without connecting anything, then connect Codex once you want it to fix what is found.