﻿<head><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4357510538660394"
     crossorigin="anonymous"></script></head>URL: /developers/agents/codex

---
title: "Website audits in OpenAI Codex"
sidebarTitle: "OpenAI Codex"
description: "Run a website audit in OpenAI Codex CLI by adding the squirrelscan hosted MCP server and installing the audit skills, then ask Codex to audit."
icon: "square-terminal"
---

To run a website audit in OpenAI Codex, add the squirrelscan hosted MCP server, install the skills, and ask Codex to audit your site. For a step-by-step walkthrough, see the [Codex guide](https://squirrelscan.com/for/codex).

Codex connects to squirrelscan over the hosted MCP server and reads Agent Skills from `~/.agents/skills`, so it can run audits, read findings as tools, and fix them in your repo.

## 1. Install the CLI

The skills and local audits run through the `squirrel` binary.

<Tabs>
  <Tab title="macOS / Linux">
    ```bash
    curl -fsSL https://install.squirrelscan.com | bash
    ```
  </Tab>
  <Tab title="Windows">
    ```powershell
    iwr -useb https://install.squirrelscan.com/install.ps1 | iex
    ```
  </Tab>
</Tabs>

Local audits run entirely on your machine. Signed out, they need no account and cost nothing; signed-in audits spend credits. Verify with `squirrel --version`.

## 2. Add the MCP server

<Tabs>
  <Tab title="OAuth (recommended)">
    ```bash
    codex mcp add squirrelscan --url https://mcp.squirrelscan.com/mcp
    codex mcp login squirrelscan
    ```

    `codex mcp login` opens the browser, runs PKCE with a local loopback callback, and stores the token encrypted (Codex CLI 0.140.0+), not in `config.toml`.
  </Tab>
  <Tab title="API key">
    ```bash
    codex mcp add squirrelscan --url https://mcp.squirrelscan.com/mcp \
      --bearer-token-env-var SQUIRRELSCAN_API_KEY
    ```

    Codex sends `SQUIRRELSCAN_API_KEY` as `Authorization: Bearer <value>`. Export it in your shell or CI first.
  </Tab>
  <Tab title="config.toml">
    Hand-write the block into `~/.codex/config.toml` (global) or `<project>/.codex/config.toml` (honored once the project is trusted):

    ```toml
    [mcp_servers.squirrelscan]
    url = "https://mcp.squirrelscan.com/mcp"
    # bearer_token_env_var = "SQUIRRELSCAN_API_KEY"   # omit if using OAuth
    ```
  </Tab>
</Tabs>

<Note>Don't set `experimental_environment` for this server, it's for stdio-over-remote-executor and doesn't support streamable HTTP. More detail on the [MCP client setup](/developers/mcp-clients#codex-cli) page.</Note>

## How to check which MCP servers are enabled in Codex

Run `codex mcp list`. Each server is listed with a **Status** column reading `enabled` or `disabled`, so that one command tells you whether squirrelscan is registered and switched on.

Remote servers like squirrelscan print in their own table, keyed by **Url** rather than **Command**, alongside the **Bearer Token Env Var** column that shows whether you configured API-key auth. Add `--json` if you want to parse the result:

```bash
codex mcp list --json
```

To inspect one server instead of all of them, pass its name to `codex mcp get`:

```bash
codex mcp get squirrelscan
```

If squirrelscan is missing from the list entirely, the `codex mcp add` step above did not write to the config file Codex is reading. Remember that `codex mcp add` only ever touches the global `~/.codex/config.toml`, so a hand-written project-level `.codex/config.toml` will not appear until that project is trusted.

## 3. Install the skills

Codex reads Agent Skills from `~/.agents/skills`, where `squirrel skills install` puts them:

```bash
squirrel skills install
```

## 4. Run an audit

Ask Codex in natural language, it will call the squirrelscan tools or the CLI:

```text
Use squirrelscan to audit nutshop.squirrelscan.com, then fix the high-severity issues.
```

Scope large sites to keep runs fast:

```text
Audit only /blog/* on nutshop.squirrelscan.com, cap it at 20 pages, and list the SEO regressions.
```

<Tip>The ChatGPT desktop app, Codex CLI, and IDE extension share MCP config for the same Codex host, so set it up once and switch clients freely.</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="Fix your website with a coding agent" icon="wand-sparkles" href="/guides/fix-your-site-with-an-ai-agent">
    A full worked example of the audit-and-fix loop.
  </Card>
  <Card title="Hosted MCP server" icon="plug" href="/developers/mcp">
    The full tool list, auth, and credits.
  </Card>
  <Card title="MCP client setup" icon="toy-brick" href="/developers/mcp-clients#codex-cli">
    Scopes, API-key auth, and TOML config.
  </Card>
  <Card title="Rules reference" icon="list-checks" href="/rules">
    Every audit rule and how it's fixed.
  </Card>
  <