Skip to content

Codex MCP setup doesn't match new standard. #154

@Kadajett

Description

@Kadajett

Summary

semfora-engine setup --clients openai-codex still assumes Codex MCP config lives in JSON files like ~/.codex/mcp.json, but current Codex stores MCP servers in config.toml (~/.codex/config.toml globally or .codex/config.toml per project) under
[mcp_servers.<name>].

Current behavior

The OpenAI Codex installer code still uses legacy JSON paths:

  • ~/.codex/mcp.json
  • ~/.openai/codex/mcp.json
  • ~/.config/codex/mcp.json
  • project .codex/mcp.json

Relevant code:

  • src/installer/clients/openai_codex.rs:27-35
  • src/installer/clients/openai_codex.rs:74-79
  • src/installer/clients/openai_codex.rs:99-104

It also writes mcpServers JSON instead of TOML [mcp_servers.<name>].

Expected behavior

For Codex, Semfora should write either:

  • global: ~/.codex/config.toml
  • project: .codex/config.toml

using the current schema, for example:

[mcp_servers.semfora-engine]
command = "/absolute/path/to/semfora-engine"
args = ["serve", "--repo", "/absolute/path/to/repo"]
startup_timeout_sec = 20
tool_timeout_sec = 120

## Repro

1. Build/install Semfora.
2. Run semfora-engine setup --clients openai-codex.
3. Observe that it targets legacy mcp.json paths instead of Codex config.toml.

## Workaround

Manual project-scoped Codex config works today:

[mcp_servers.semfora-engine]
command = "/Users/jeremy.stover/.cargo/bin/semfora-engine"
args = ["serve", "--repo", "/Users/jeremy.stover/dev/semfora-engine"]
startup_timeout_sec = 20
tool_timeout_sec = 120

## Suggested fix

- Replace the Codex client implementation to read/write TOML config.
- Target ~/.codex/config.toml and .codex/config.toml.
- Model Codex separately from Claude/Cursor JSON mcpServers handling.
- Add tests covering both global and project-scoped Codex config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions