code-context-engine icon indicating copy to clipboard operation
code-context-engine copied to clipboard

codex CLI issue

Open arita37 opened this issue 7 months ago • 2 comments

Have this in codex CLI (when running both claude code ...)

[mcp_servers.code-context-engine]
command = "cce"
args = ["mcp"]
enabled = true




⚠ MCP client for `code-context-engine` failed to start: MCP startup failed: handshaking with MCP
  server failed: connection closed: initialize response

⚠ MCP startup incomplete (failed: code-context-engine)



    ● mcp          running  managed by Claude Code



arita37 avatar May 04 '26 07:05 arita37

Thanks for the report — this is a config issue, not a server crash.

cce does not have an mcp subcommand. The MCP server is started via cce serve. Calling cce mcp exits immediately with Error: No such command 'mcp' (exit 2), which Codex then surfaces as connection closed: initialize response because the process died before responding to the MCP initialize handshake.

Your config also needs --project-dir so the server knows which project's index to expose.

Fix

Replace your ~/.codex/config.toml block with:

[mcp_servers.context-engine]
command = "cce"
args = ["serve", "--project-dir", "/absolute/path/to/your/project"]

(Use the absolute path to the project you want indexed.)

Easier: let cce init write it for you

From inside your project directory:

cce init

This auto-detects Codex (when .codex/ exists) and writes the correct TOML block, plus indexes the project. No hand-editing.

To verify the server actually starts

cce serve --project-dir /absolute/path/to/your/project

It should sit waiting on stdio (no output, no exit). Ctrl-C to stop. If that runs cleanly, Codex will be able to connect.

Let us know if cce init doesn't pick up your Codex setup and we'll dig in.

fazleelahhee avatar May 04 '26 07:05 fazleelahhee

@fazleelahhee Thanks it works. Please add those config in the readme.

What happen if I use Claude Code and Codex at same time ? ---> 2 MCP server running ?

arita37 avatar May 04 '26 07:05 arita37