> For clean Markdown of this page, append .md to its URL. For the complete documentation index, see https://www.superagent.sh/llms.txt.


Connect Codex to Superagent MCP and complete a finding-to-report workflow.

# Set up Codex

Connect Codex to Superagent MCP, then use your trusted runner to deliver findings and receive structured agent reports.

## Connect Superagent MCP

Add the server to `~/.codex/config.toml`:

```toml
experimental_use_rmcp_client = true

[mcp_servers.superagent]
url = "https://www.superagent.sh/mcp"
bearer_token_env_var = "SUPERAGENT_API_KEY"
```

Export `SUPERAGENT_API_KEY` before launching Codex. The setting takes the environment variable name, not the token.

## Configure the finding handoff

Use an authenticated relay or trusted CI runner to verify and deduplicate the signed [Superagent webhook](https://www.superagent.sh/docs/webhooks), then start the Codex task for the configured repository. Keep Codex credentials on the runner.

## Test the complete loop

1. Verify the MCP connection with `/mcp`.
2. Send a Superagent webhook test event to the runner.
3. Confirm one Codex task starts with the finding context.
4. Let Codex investigate or remediate within its assigned scope.
5. Return the structured agent report through Superagent MCP.
6. Confirm that Superagent retained the report.
7. Leave consequential changes for normal review.

## Next steps

- [Use Superagent MCP](https://www.superagent.sh/docs/mcp)
- [Subscribe to events with Webhooks](https://www.superagent.sh/docs/webhooks)
- [Compare Superagent interfaces](https://www.superagent.sh/docs/build)

---
Source: https://www.superagent.sh/docs/connect/codex
Index: https://www.superagent.sh/llms.txt
