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

# Codex

> Connect Spyro AI to OpenAI Codex with browser sign-in or a key, using config.toml or the codex mcp commands.



Let your AI agent configure this for you

        Copy configuration prompt


      \<details><summary>Preview the prompt</summary>
        \<pre /></details>

Codex is OpenAI's coding agent. It stores MCP servers in `config.toml` and works in the CLI and the IDE extension.## Connect with sign-in**1. Add the server**Add it to `~/.codex/config.toml`:```toml ~/.codex/config.toml theme={null}
[mcp_servers.spyro-ai]
url = "https://mcp.spyro.app/mcp"
```Or use the command: `codex mcp add spyro-ai --url https://mcp.spyro.app/mcp`**2. Sign in**```bash theme={null}
codex mcp login spyro-ai
```Sign in in your browser, choose your workspaces and click **Allow**.## Connect with a key`bearer_token_env_var` holds the **name** of an environment variable, not the key. If the variable is missing when Codex starts, the server fails to connect.```bash theme={null}
export SPYRO_AI_MCP_KEY="sk_mcp_..."
``````toml ~/.codex/config.toml theme={null}
[mcp_servers.spyro-ai]
url = "https://mcp.spyro.app/mcp"
bearer_token_env_var = "SPYRO_AI_MCP_KEY"
```You can also set it with the command: `codex mcp add spyro-ai --url https://mcp.spyro.app/mcp --bearer-token-env-var SPYRO_AI_MCP_KEY`.## Scope it to one projectCodex can read a project's `.codex/config.toml`, but only in projects you have trusted. Put the server there to share a setup with your team, and keep the key in each person's environment.## Manage it```bash theme={null}
codex mcp list    # configured servers
```Inside the Codex terminal UI, `/mcp` shows connected servers and tools.## Try these prompts- *"Use Spyro AI to find my critical SEO issues and open fixes for the ones in this repo."*
- *"Check Spyro AI for the keywords I am almost ranking for and update those pages' headings."*
- *"Ask Spyro AI for my competitor keyword gaps and write a content brief."*## Tips- The key name in the file is snake case: `mcp_servers`, not `mcpServers`.
- Keep the key at **Read** access. Raise it only for a pipeline that should make changes. Each change still needs a person to confirm it in Spyro AI.
- If your Codex version supports tool approval settings, keep approval on for the nine `manage*` tools. Spyro AI also asks you to confirm each change.## If it fails- **Server fails to start:** check the environment variable is set in the same shell that starts Codex.
- **401 error:** run `codex mcp login spyro-ai` again, or check the key.
- More: [Troubleshooting](https://spyro.app/docs/product/mcp-troubleshooting.md).OpenAI's guide: [Codex and MCP](https://developers.openai.com/codex/mcp).## Related- [All connection options](https://spyro.app/docs/product/mcp-connect.md)
- [Developer guide](https://spyro.app/docs/product/mcp-developers.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.