Use SEOmatic in Codex
Updated
Before you start
Codex (the CLI, the IDE extension, or Codex inside the ChatGPT desktop app) signed in with your ChatGPT account, and a free SEOmatic account. No API key needed for the browser sign-in.
Connect Codex#
- Add the server. In your terminal, run: codex mcp add seomatic --url https://app.seomatic.ai/api/mcp
- Sign in. Run codex mcp login seomatic. Your browser opens: sign in or create a free SEOmatic account and pick your site.
- Connect Search Console. If your workspace has no Search Console yet, Codex gives you a one-click link the first time it needs your data.
- Ask your first question. Start Codex in your repo and ask “Use SEOmatic to audit my site and find the code behind each issue.”
Codex setup
# Add SEOmatic and sign in (OAuth in the browser) codex mcp add seomatic --url https://app.seomatic.ai/api/mcp codex mcp login seomatic # Saved in ~/.codex/config.toml: # [mcp_servers.seomatic] # url = "https://app.seomatic.ai/api/mcp" # Headless or CI: use a workspace API key instead export SEOMATIC_API_KEY=smk_live_... codex mcp add seomatic --url https://app.seomatic.ai/api/mcp \ --bearer-token-env-var SEOMATIC_API_KEY # Optional: SEOmatic's 20 SEO skills npx -y skills add Minh42/seomatic-mcp --full-depth -a codex
Note
Create a workspace API key in Settings, AI Agents, API Keys. Keep it in an environment variable or your CI secrets, never in the repo.
MCP Server, API Key or Skills: How Should Codex Connect?
| Route | Best for | How |
|---|---|---|
| MCP server with OAuth | Most developers, in the Codex CLI, the IDE extension and the ChatGPT desktop app | codex mcp add seomatic --url https://app.seomatic.ai/api/mcp, then codex mcp login seomatic. Saved in ~/.codex/config.toml. No terminal? In the ChatGPT desktop app or the IDE extension: Settings, MCP servers, Add server, Streamable HTTP, then Authenticate. |
| MCP server with an API key | CI, containers and codex exec on a machine with no browser | Export SEOMATIC_API_KEY, then add the server with --bearer-token-env-var SEOMATIC_API_KEY. |
| Skills | Teaching Codex SEOmatic's playbooks: seo-audit, striking-distance, weekly-brief and three more | npx skills add Minh42/seomatic-mcp --full-depth -a codex. SEOmatic's 20 SEO skills land in ~/.agents/skills. All of them: SEO skills. |
Pick the MCP server with OAuth. Two commands, no key to store, and it works the same in the terminal and the IDE. Add the skills on top when you want Codex to run audits the same way every time.
Try Asking#
- “Use SEOmatic to audit https://example.com, then find the file responsible for each issue.”
- “Which pages have Google not indexed? Check our robots and canonical code for the cause.”
- “Find pages with lots of impressions and few clicks over the last 28 days, and rewrite their title logic.”
- “Audit the preview deploy at https://preview.example.com before I merge, and compare it with production.”
- “We moved from /es/ to /en/. How many old /es/ URLs are still indexed, and which return 404?”
- “Fix every page that ships without a meta description, starting with the ones that get the most impressions.”
What It Costs#
Connecting is free. Reading your own data never uses credits: Search Console performance and insights, index status, rankings, site audits, AI citations, traffic and your tasks. Only live market lookups (keyword metrics, search results, backlinks), AI visibility scans and the fixes you approve use AI credits; every tool is labelled free or billed. On the Free plan, market lookups count against 5 free questions a month. The workspace Owner sees every credit spent, by feature, in Settings > Usage. Codex itself is billed by its maker, not by SEOmatic: nothing on our side counts tokens.
Nothing Changes on Your Site Without Your Approval#
Codex changes your code inside its sandbox, with the approval rules you set, and you review the diff before anything ships. On the SEOmatic side, anything that would change your live site through a connected CMS is staged, never pushed. A staged change is a proposal: it says what will change and why, and nothing touches your site until you approve it. The assistant records your decision, and it is told never to approve anything on its own judgment. Approved fixes start within seconds, the page's previous state is stored, and any applied change can be rolled back. Changes that could take a page out of Google, like a noindex, need an extra explicit confirmation.
- Codex says SEOmatic is connected but answers without my data.
- Start a new chat and check that SEOmatic is enabled for that conversation in the tools menu. This is the step most people miss.
- The SEOmatic page says "This connection request expired".
- Start the connection again from Codex, or paste the setup prompt again.
- The Authorize page shows the wrong email or no workspace.
- Click Switch account on that page and sign in with the SEOmatic account that owns the site.
- Why does Codex say it cannot change my site?
- Fixes need a live paid plan or trial. On the Free plan, or when billing is paused or failed, your assistant can read and answer only.
- How do I disconnect?
- Open Settings > AI Agents, scroll to API Keys and delete the row named OAuth: Codex. See disconnect an assistant.
Was This Article Helpful?
Still need help?Email contact@seomatic.ai with your site address and a screenshot. A person replies, usually within one business day.


