# Codex integration
> Connect OpenAI Codex to Omentir with a streamable HTTP MCP server in config.toml. Keep the token in an env var. Draft in the session. Send from the workspace. This is not the ChatGPT connector.
- HTML: https://omentir.com/integrations/codex
- Markdown: https://omentir.com/integrations/codex.md

TOML MCP path for Codex CLI and the IDE extension: url, bearer_token_env_var, then /mcp.

## Highlights

- config.toml
- bearer_token_env_var
- Shared CLI and extension

## Setup

1. **Create and export a token.** Generate an Omentir API key and export it as OMENTIR_API_KEY before you launch Codex.
2. **Add mcp_servers.omentir.** In ~/.codex/config.toml, set url to https://omentir.com/api/agent/v1/mcp and bearer_token_env_var to OMENTIR_API_KEY.
3. **Confirm with /mcp.** If the server is missing, the env var was empty, the table name is wrong, or a project file is in an untrusted repo.
4. **Read before write.** Fetch agents.md, then get_context and list_agents, before you let Codex create a finder.

## Why Codex users connect Omentir

Codex is already in the repo. Connected to Omentir, it can read My Product, inspect finders, and leave a scored list without becoming a LinkedIn client. The CLI and the IDE extension share ~/.codex/config.toml. ChatGPT's connector list is a different store.

## Setup in config.toml

Create a revocable API key. Export it before you launch Codex. Add an mcp_servers.omentir table. The table name needs an underscore. bearer_token_env_var is the name of the variable, not the token and not $OMENTIR_API_KEY.

- url: https://omentir.com/api/agent/v1/mcp
- bearer_token_env_var: OMENTIR_API_KEY
- Confirm with /mcp in the session
- Project-local .codex/config.toml only loads for trusted projects

## Codex versus ChatGPT chat

ChatGPT uses Settings, Connectors, and workspace approval. No API key for that path. Codex uses TOML and a Bearer env var. Do not paste a token into the ChatGPT connector UI. Do not wait for workspace approval inside Codex.

## A first Codex session that does not invent targeting

Codex moves fast in a repo. Treat create, delete, and reply as named requests. Ask it to show a create_agent config and wait. A refactor that also spins up a finder is how targeting drifts.

Keep LinkedIn off Codex. Caps and send stay in Omentir. Close the session and the work stops.

## When ChatGPT chat is the better surface

If you wanted a conversation this afternoon with no repo open, use the ChatGPT connector. Codex earns the TOML file when that coding agent is already the loop you live in.

## Related

- [Codex for LinkedIn outreach](https://omentir.com/blogs/codex-linkedin-outreach.md): TOML, /mcp, and a first session job.
- [ChatGPT integration](https://omentir.com/integrations/chatgpt.md): Connector path for ChatGPT chat.
- [Cursor integration](https://omentir.com/integrations/cursor.md): Editor MCP client, same Bearer pattern.
- [How do I connect Codex to Omentir?](https://omentir.com/help/how-do-i-connect-codex-to-omentir.md): Short help version of the TOML path.

## Frequently asked questions

**Can I put the API key in the TOML file?**

You can. You should not. The file is easy to commit. Use bearer_token_env_var with the variable name.

**Will Codex send LinkedIn messages by itself?**

Only through Omentir tools under your campaign and safety settings. Your prompts should still require approval for replies and agent lifecycle changes.

**Where is the operator prompt?**

https://omentir.com/agents.md is the operator guide. Fetch it before you let Codex create a finder.

[Create an Omentir account](https://omentir.com/signup). Pro is $49/month.
