Skip to main content

Codex Integration

Codex is OpenAI’s coding agent with built-in MCP support. You can register Cognee MCP once, then use Cognee memory and retrieval tools directly in your Codex sessions.
For most users, the Cognee memory plugin is the simpler path — it adds persistent memory with a few commands and no separate MCP server to run. The MCP setup below is for connecting Cognee’s full MCP tool set.

Prerequisites

  • Codex CLI installed and authenticated
  • Cognee MCP server running (see Quickstart or Local Setup)
  • OpenAI API key (for Cognee’s LLM operations)

Setup Steps

1

Add Cognee MCP Server

Choose the command that matches how you started the Cognee MCP server:
Use this if you started the server with Docker:
If a cognee server entry already exists, remove it first:
2

Verify Server Registration

You should see cognee in the MCP server list.
3

Start Codex and Use Cognee Tools

Codex can now call Cognee tools automatically when relevant.Example prompts:
  • “Remember this repository note in Cognee: the billing API uses Stripe webhooks for subscription updates”
  • “Recall authentication logic from Cognee before editing this file”
  • “Improve the current Cognee dataset with the architecture notes in this repository”
  • “Use Cognee to find prior decisions about database migrations”

Where to Use This Configuration

Codex stores MCP server settings in ~/.codex/config.toml under the mcp_servers section. Once added, the Cognee server is available to Codex sessions unless removed or disabled. You can also configure the mcp server directly in the config.toml file.

Need Help?

Join Our Community

Get support and connect with other developers using Cognee MCP.