> ## Documentation Index
> Fetch the complete documentation index at: https://docs.semgrep.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up Semgrep Guardian with Codex

> Configure the Semgrep MCP server for Codex.

Integrate Semgrep Guardian with Codex through [Codex MCP](https://developers.openai.com/codex/mcp).

## Prerequisites

* A Semgrep account
* [Semgrep CLI installed and signed in](/semgrep-guardian/install-cli)

## Setup

<Steps>
  <Step>
    [Install the Semgrep CLI](/semgrep-guardian/install-cli).
  </Step>

  <Step>
    Update your `~/.codex/config.toml` file and paste the following:

    ```bash theme={null}
    [mcp_servers.semgrep]
    command = "semgrep"
    args = ["mcp"]
    ```
  </Step>
</Steps>

Codex does not expose a post-write hook, so Semgrep tools are surfaced through MCP and invoked when the agent calls them.

## What rules does this setup use?

This integration scans with the rules enabled for your Semgrep organization through your Policies. See [Rules and configuration](/semgrep-guardian/rules-and-configuration) for how this differs from the Claude Code remote plugin.

## Next steps

* [Enterprise deployment](/semgrep-guardian/enterprise-deployment) for authentication and organization-wide rollout
* [Semgrep Guardian overview](/semgrep-guardian/overview)
* [Rules and configuration](/semgrep-guardian/rules-and-configuration)
