Guide · SEO Inside Codex

SEO Inside Codex: Run Keyword and SERP Research

You are in the terminal with Codex, halfway through building something. Maybe it is scaffolding a new docs section, maybe you just asked it to draft the copy for a landing page, and a question lands in your head. Is anyone actually searching for the phrase you are about to put in that H1, and who already ranks for it? The old answer was to break flow, alt-tab to a browser, log into a $129 dashboard, run one lookup, and then try to remember where you were when you get back.

There is a better answer now. Codex, OpenAI’s command-line coding agent, speaks the Model Context Protocol, the same plug standard that lets it talk to GitHub, Postgres, and your file system. Point it at a live SEO data source and you can ask that keyword question in the terminal, get a real volume and difficulty number back in seconds, and never leave the session you were working in.

This guide covers how to wire SEO data into Codex, what you can actually ask once it is connected, where ContextBolt SEO fits, and the honest limits of doing SEO this way. I build solo, I write my own copy, and I do this every day, so this is the workflow as it actually runs, not a feature list.

Quick answer
  • Yes, you can do SEO inside Codex. It speaks MCP, so a connected SEO server returns live data right in the terminal.
  • Setup is one block in a config file. Add it under [mcp_servers] in ~/.codex/config.toml, restart the session, done.
  • You ask in plain language. Keyword volume, difficulty, SERP results, domain and competitor data, no dashboard.
  • Codex config is TOML, not JSON. It uses a url key, and the field name genuinely differs from one tool to the next.
  • The data is Ahrefs-grade, decision-useful and directional, not Ahrefs’ exact numbers. ContextBolt SEO runs this way for $35/month.

Why pull SEO data into Codex

The case is not “Codex is now an SEO tool”. It is that the cost of asking an SEO question should be near zero, and in the usual setup it is not.

Most builders who do their own SEO use a thin slice of what a dashboard offers, and only now and then. You want to know if a keyword is winnable before you write the page. You want a quick read on a competitor’s traffic. You want to check whether the slug Codex just generated matches what people actually search. None of that needs a 40-tab research session. It needs one number, fast, without a context switch out of the terminal. The friction is not the data, it is the trip to go get it, and Codex already lives in the window where the question came up.

The Model Context Protocol, or MCP, is what makes this possible. It is an open standard, introduced by Anthropic in late 2024, that lets AI agents call external tools and data sources through one common interface. Codex reads its MCP servers from a config file at startup, and once connected the agent can call their tools mid-conversation. SEO data is just another source the agent can reach, sitting alongside your repo and your shell.

The payoff is flow. When the answer to “is this keyword soft enough to rank” lives in the same window as your code, you ask it. When it lives behind a login two tabs away, you guess instead, and guessing is how you end up with a page optimized for a phrase nobody types. If you want the longer argument for why the agent beats the dashboard, the SEO MCP server explainer makes the full case.

How do you connect SEO data to Codex?

Codex keeps its config in a single TOML file at ~/.codex/config.toml, and MCP servers live under a [mcp_servers.<name>] table. A hosted server that hands you one remote URL is the least work. Here is the whole block for a remote SEO server like ContextBolt SEO, which gives you a URL on signup.

[mcp_servers.contextbolt-seo]
url = "https://seo.contextbolt.app/mcp/YOUR_TOKEN"

That is the entire setup. There are no braces, no command, no arguments, because the server runs remotely and you are just pointing at it. Save the file, then start a fresh Codex session, because it only reads config.toml at startup. A restart is not optional here, it is how the tools load. Once the session is up, ask “what SEO tools do you have?” and you should see the keyword, SERP, domain, and competitor tools listed back.

Two caveats worth stating plainly. First, that URL contains a personal token, so treat config.toml like a password. Keep it out of public repos, or pull the URL from an environment variable if you share your dotfiles. Second, and this one quietly trips people up when they move between tools, the field name is not standardized. Codex uses url in TOML. Cursor also uses url, but in a JSON mcp.json. Windsurf and Google Antigravity want serverUrl. Gemini CLI wants httpUrl. Same server, same token, different key depending on which agent you are configuring, so if a connection silently fails, check the key name before you check anything else.

SEO tool ContextBolt SEO· Get found on Google and in ChatGPT· $35/mo See it

What can you actually ask once it’s connected?

This is where it stops being a config exercise and starts being useful. You type a question, the agent picks the tool, the data comes back inline. A few of the moves I run most from the terminal.

  • Keyword reality checks: “What keywords should my developer-tools blog target?” Codex runs keyword research and returns related terms with volume, difficulty, and intent, so you get a content shortlist before you write a word.
  • Difficulty plus SERP in one ask: “How hard is ‘rust web framework’ to rank for, and who’s in the top 10?” It chains a difficulty score and the live page-one results, so you learn both whether you can win and what kind of page already wins.
  • Domain and competitor mining: “What does vercel.com rank for, and who competes for those terms?” You get a content map plus the rivals chasing the same keywords, run from the same shell you deploy from.
  • Backlink gaps: “Who links to my top competitor but not to me?” It returns a spam-scored prospect list, a ready-made outreach shortlist. Backlink questions cost more, three lookups each, because the data behind them is heavier.
  • On-page audits: “Audit my docs site and show the worst pages first.” You get a graded fix-list, and because Codex writes code, you can tell it to fix the top few and re-audit in the same session.
  • Chained research: “Find ten low-difficulty keywords for my docs site, check which ones a competitor already ranks for, and list the gaps.” That is one prompt, not ten dashboard sessions, and the whole chain is written to disk as it runs.

The thread through all of these is plain language. You are not learning a tool’s menu or remembering which report lives where. You ask the way you would ask a colleague, and the agent translates it into the right lookup, then the next one. That chaining is the part a dashboard cannot match, because a dashboard makes you the one clicking between screens.

Where ContextBolt SEO fits

ContextBolt SEO is the one I make, and it exists for exactly this workflow. It is a hosted MCP server that wraps Ahrefs-grade data and hands you a single URL. You paste that URL into ~/.codex/config.toml, restart, and you have nine tools in the terminal. Six research tools, keyword research, keyword difficulty, SERP overview, domain overview, ranked keywords, and competitor keywords, cost one lookup each. Three backlink tools, backlink overview, referring domains, and competitor gap, cost three each. The plan is $35 a month for 1,000 lookups, roughly a quarter of the entry price of the big suites, and there is no account to provision or deposit to fund. The free Google Search Console tools and the automatic cross-session memory never spend a lookup. Every tool returns a digested answer with a verdict line rather than a wall of raw JSON, so the terminal stays readable while you keep coding. The step-by-step is on the Codex setup page.

Where Codex specifically makes this shine is file access. Because Codex can write to your project, every lookup also saves to a ./seo-findings/ folder as markdown, one clean file per keyword or domain, plus an INDEX. Your SEO research lands in the repo next to the feature it informed. You can grep it, commit it, diff it next month, or open it in Obsidian. Ask about the same keyword a week later and the answer leads with what changed since you last looked, a volume or difficulty delta, with no extra prompt and no extra lookup. Most agents lose their research when the session ends. Here it accretes into something you own.

There is one more move that only pays off inside a coding agent. Say “audit my docs site” and ContextBolt SEO grades the mechanical health of every page against a strict ruleset, title and meta lengths, a single H1, thin content, broken links, canonical tags, then hands back its own 0-100 score with the fixes worst first. Because Codex edits code, you say “fix the top three” and it rewrites the pages in the same session, then re-audits and leads with the delta, health 80 to 91. Ahrefs reports the problems. ContextBolt hands them to the thing that can fix them. Find it, then fix it.

The honest framing the product holds to applies here too. This is Ahrefs-grade data, not the same numbers as Ahrefs. It sits on DataForSEO estimates, which are decision-useful and directionally accurate, the same class of data inside many dashboards you already trust. For deciding what to build and what to write, that is more than enough. The full tour of tools and workflows walks through the rest.

The honest limits

Doing SEO inside Codex is not a magic replacement for everything a suite does, and pretending otherwise would be the kind of overclaim this blog tries to avoid.

You do not get a visual dashboard. If you think in charts and like clicking around a keyword explorer, the terminal will feel sparse at first. You do not get scheduled rank tracking. An MCP server answers when you ask, it does not watch your positions every day and email you when something moves. If daily rank monitoring is core to your job, keep a tool that does it. And the agent can be confidently wrong about strategy even when the underlying numbers are right, so treat its SEO advice the way you already treat its code, useful, fast, and in need of a human check before it ships.

There is also a usage shape to respect. A metered server has a monthly lookup budget, so you spend it on real questions, not idle curiosity. In practice that is a feature, because it nudges you toward the lookups that actually change a decision, but it is worth knowing going in.

What you gain in return is the thing that matters most when you build solo and time is the scarce resource. The answer arrives where you already are, in the terminal, in the seconds you would otherwise spend alt-tabbing to a dashboard, at a price that does not make you wince. For most builders doing their own SEO, that trade is an easy yes. The keyword you were nervous about might be wide open, and now you can find out without ever leaving the session.

SEO Inside Codex: FAQs

Can you do SEO in Codex?
Yes. Codex speaks the Model Context Protocol, so you can connect an SEO MCP server and ask for keyword volumes, difficulty scores, and SERP results in plain language. The answers come back in the terminal, next to the code you are shipping, with no separate dashboard to open.
How do you add an MCP server to Codex?
Edit ~/.codex/config.toml. It is TOML, not JSON, and MCP servers go under a [mcp_servers.<name>] table. For ContextBolt SEO, add [mcp_servers.contextbolt-seo] and a url line pointing at your MCP URL, then restart the session so Codex reloads the config.
What SEO data can Codex pull?
Keyword research and volume, keyword difficulty, live Google SERP results, domain traffic and authority estimates, the keywords a domain ranks for, competitor overlap, and backlink profiles. You ask in plain English and the agent calls the right tool for you.
Is doing SEO in Codex as good as Ahrefs?
For everyday research, yes. The data is Ahrefs-grade, decision-useful and directionally accurate, not identical to Ahrefs' exact numbers. You lose the visual dashboard and scheduled rank tracking, but you gain answers where you already work and a much lower price.
Where does the SEO research get saved?
In a ./seo-findings/ folder in your project. Because Codex has file access, every lookup writes a markdown file there, one per keyword or domain plus an INDEX. You can grep it, commit it to git, or open it in Obsidian.