Add an MCP Server to Codex CLI and Let It Fix Your Website
Connect the squirrelscan MCP server in two commands. Codex runs the audit, reads 350+ checks across SEO, performance, security and accessibility, and ships the fixes.
Add an MCP server to Codex CLI
# any remote MCP server
codex mcp add <name> --url <url>
# or with a bearer token read from an environment variable
codex mcp add <name> --url <url> --bearer-token-env-var <ENV_VAR>
# the worked example: squirrelscan
codex mcp add squirrelscan --url https://mcp.squirrelscan.com/mcp
codex mcp login squirrelscan
- 350+
- audit rules
- 22
- categories
- Local
- runs on your machine, free while signed out
Codex CLI runs shell commands as part of its normal workflow, so pointing it at squirrelscan takes about as long as installing the CLI. Tell it to audit a URL and it drives the command itself, reads the output, and starts proposing fixes.
If you want Codex to reach for audits, reports, and the issue tracker as first-class tools instead of parsed terminal text, connect the hosted squirrelscan MCP server. It's two commands: one to add the server, one to sign in.
How do you check which MCP servers are enabled in Codex?
Run codex mcp list to print every configured server with its status. Codex reads them from ~/.codex/config.toml, so you can also open that file directly to see what is registered.
codex mcp list prints two tables: stdio servers with their command, args, and working directory, and streamable HTTP servers with their URL. Both carry a Status column reading enabled or disabled, and an Auth column, so a server you added but later turned off is visible rather than silently absent.
codex mcp get <name> narrows that to one server and prints its transport, URL, and bearer token environment variable. It is the faster check when you want to confirm how a specific server is wired rather than what is installed overall.
Inside a running Codex session, /mcp lists the servers that session has active, which is the check to run when a server is configured but its tools do not show up.
Adding a server writes to the same file, so codex mcp add and a hand-edit of ~/.codex/config.toml are interchangeable. Adding squirrelscan for a headless run looks like codex mcp add squirrelscan --url <url> --bearer-token-env-var SQUIRRELSCAN_API_KEY.
codex mcp list
codex mcp get squirrelscanRun it locally
The squirrel CLI on your machine, free while signed out.
Install the squirrelscan CLI
Local audits run wherever your Codex session has shell access, free when signed out or with --offline.
Install the CLIbashcurl -fsSL https://install.squirrelscan.com | bashAsk Codex to audit a site
In a Codex CLI session, describe the task in plain language. It runs the CLI and summarizes the results.
textRun squirrel audit https://nutshop.squirrelscan.com --format llm and tell me the top 3 issues to fix first
Run it hosted
The cloud: rendering, scheduling, the issue tracker and shareable reports.
Connect the hosted MCP server
codex mcp add registers the streamable HTTP server and writes a [mcp_servers.squirrelscan] table to config.toml. It does not sign you in: codex mcp login runs the browser OAuth flow as a separate step, and the token lands in Codex's own credential store, not in config.toml, so a committed config stays clean. On a machine with no browser, codex mcp login squirrelscan --no-browser prints the authorization URL; open it elsewhere and paste the full redirect URL back into the terminal.
MCP client setup for Codex CLIbashcodex mcp add squirrelscan --url https://mcp.squirrelscan.com/mcp codex mcp login squirrelscanOr use an API key for headless runs
For CI or a machine without a browser, skip OAuth and point Codex at an environment variable holding a squirrelscan API key. Codex reads it at connect time and sends it as a bearer token.
bashcodex mcp add squirrelscan --url https://mcp.squirrelscan.com/mcp \ --bearer-token-env-var SQUIRRELSCAN_API_KEY
Frequently asked questions
- How do I get Codex to fix my site's SEO?
- Install the squirrel CLI, then in a Codex session ask it to run squirrel audit <url> --format llm and fix the top issues. Codex reads the compact report, maps each finding to the file it comes from, edits the code, and can re-run the audit to confirm the fix. For a guided loop, install the skills with squirrel skills install (or let squirrel setup do it) and prompt Codex to use the audit-website skill.Fix your site with an AI agent
- Do I need an account, or is it free?
- No account is needed for local CLI audits: signed out, or with --offline, they are free and run wherever Codex has shell access. Signing in unlocks the cloud, which adds browser rendering, scheduled audits, the issue tracker, and shareable reports, and from then on every audit spends credits (50 per audit plus 2 per audited page). Every account gets 500 free credits per month, and audits beyond that spend credits pay-as-you-go. run_audit returns a cost estimate for Codex to show you before anything runs.How credits work
- Can Codex use squirrelscan as native tools instead of parsing terminal output?
- Yes. Run codex mcp add squirrelscan --url https://mcp.squirrelscan.com/mcp then codex mcp login squirrelscan to connect the hosted server. Codex then calls tools like run_audit, get_report, and list_issues directly, so it can poll a running audit, work the issue tracker, and browse the rule catalog without shelling out each time. Piping squirrel report --format llm into a prompt still works with zero setup for one-off audits.Hosted MCP server
- Can I connect squirrelscan from CI or a headless container?
- Yes. Instead of the browser OAuth flow, add the server with --bearer-token-env-var SQUIRRELSCAN_API_KEY and export a squirrelscan API key. Codex reads the variable at connect time and sends it as an Authorization bearer token, so no browser is needed. Mint a key with squirrel keys create --shell.
- How do I add a local (stdio) MCP server to Codex?
- Put the command after a double dash: codex mcp add <name> -- <command>, with --env KEY=VALUE for any environment variables the server needs. Codex launches the process itself. squirrelscan ships one too: codex mcp add squirrelscan-local -- squirrel mcp runs the local server, free when you are signed out.
- Is codex mcp-server the same as codex mcp?
- No. codex mcp manages the external servers Codex connects to as a client. codex mcp-server, which ran Codex itself as an MCP server, was deprecated on 24 August 2026 and removed on 5 September 2026, and OpenAI now points those integrations at the Codex app server. To give Codex new tools, such as squirrelscan's audits, you want codex mcp add.
- Can I limit squirrelscan to one project instead of every Codex session?
- codex mcp add and codex mcp login only write the global ~/.codex/config.toml. To scope it to a single project, hand-write the same [mcp_servers.squirrelscan] block into that project's .codex/config.toml, which Codex loads once the project is trusted.
- Why does Codex say the squirrelscan server needs login after codex mcp add?
- Because codex mcp add only registers the server. OAuth is a separate step, so run codex mcp login squirrelscan and approve the organization in the browser. Per OpenAI's MCP docs, Codex can connect to a server without credentials when none resolve, so a missing login shows up as a server that is listed but cannot call its tools, not as a failed add.
- Can I give Codex only the read-only squirrelscan tools?
- Yes. Codex supports an enabled_tools allow list per server, so enabled_tools = ["get_report", "list_issues", "list_rules"] in the [mcp_servers.squirrelscan] table exposes reading reports, issues and the rule catalog while leaving run_audit, which spends credits, out of the session. default_tools_approval_mode = "prompt" is the other lever: Codex then asks before each call.
- Why does a long audit not time out in Codex?
- Codex gives a tool call 60 seconds by default (tool_timeout_sec), and starts a server within 10 (startup_timeout_sec). run_audit does not hold the call open: it returns a run id, and Codex polls get_audit_status until the audit finishes, so each call stays well inside the limit.
Keep going
Follow the docs quickstart, or see what a finished audit looks like.