# Connect Codex CLI to your project over MCP

Canonical: [Connect Codex CLI to your project over MCP](https://contextingo.com/guides/codex-cli-mcp-server-setup)

Locale: en

Purpose: Connect OpenAI Codex CLI to a Contextingo project with one command or by hand, so it reads your team’s decisions and issues and hands off to Claude Code.

Content updated: 2026-10-25

Source revision: content.ts 2026-10-25

Maintenance owner: the Contextingo site owner

[Topic map](https://contextingo.com/llm/topics/guides.md) · [Complete scoped map](https://contextingo.com/sitemap.md)

Codex CLI connects to Contextingo over MCP, with your own personal key, and reads the same project knowledge as every teammate’s Claude Code. Codex runs on your own plan; Contextingo only serves the knowledge.

1. **Copy the setup command.** In Contextingo, open Project → Connect → Copy setup command and run it in the repository folder. It checks that `codex` is installed before it uses the one-time code.

   ```
   npx contextingo init <code>
   ```
2. **What the command sets up.** It registers the server with `codex mcp add`, stores your personal key in `~/.config/contextingo/env` (readable only by you, loaded by your shell profile), adds the work protocol to `AGENTS.md` (an existing file is only appended to) and links the folder with `.contextingo.json`, which holds no key.
3. **Or connect by hand.** Put the personal key from the Connect tab in an environment variable and register the server. The key never goes into a committed file.

   ```
   export CONTEXTINGO_TOKEN="ctm_mcp_..."
   codex mcp add contextingo --url https://contextingo.com/mcp/p/<project-id> --bearer-token-env-var CONTEXTINGO_TOKEN
   ```
4. **Check that it works.** Open a new Codex session in the folder and ask it to call `issue_list`. It should list the project’s issues. An unauthorized error means the key is missing or expired: copy a new command.
5. **Work the same way as everyone else.** Codex follows the protocol in `AGENTS.md` and in the server’s instructions: `context_get` at the start, `context_upsert` for what others need, `session_checkpoint` when it stops, `review_submit` when it is done. A person accepts the work.

## Questions

### Does Codex read CLAUDE.md?

No. Codex reads AGENTS.md (Codex documentation, October 2026). That is why the setup command writes the work protocol to AGENTS.md for Codex and to CLAUDE.md for Claude Code.

### Does Codex get the hook too?

Yes. The setup command wires the same hook into Codex (~/.codex/hooks.json). It reminds Codex to save as it works, sends a turn back once when it changed files without saving, and checks the evidence before a confirmed save. Codex asks you to trust a new hook once under /hooks.

### Can I use Codex and Claude Code on the same project?

Yes. Both read and write the same records, so one can continue what the other started. See the guide on handing off from Claude Code to Codex.
