Skip to content

MCP Server: codex-reply tool missing conversationId in response #8580

@Galaxy-0

Description

@Galaxy-0

Summary

When using codex mcp-server as an MCP server (e.g., integrated with Claude Code), the codex tool does not return the conversationId in its response, making it impossible to use codex-reply for continuous conversations without manually retrieving the session ID from the filesystem.

Current Behavior

  1. Call codex MCP tool → Get result text only
  2. codex-reply requires conversationId (UUID format)
  3. The session ID is only available by parsing filenames in ~/.codex/sessions/YYYY/MM/DD/rollout-{timestamp}-{SESSION_ID}.jsonl

Expected Behavior

The codex MCP tool response should include the conversationId so that subsequent codex-reply calls can be made seamlessly:

{
  "result": "...",
  "conversationId": "019b63ce-02a4-7223-8d1d-f5dc6a1b4877"
}

Reproduction Steps

  1. Configure codex mcp-server in an MCP client (e.g., .mcp.json)
  2. Call the codex tool with a prompt
  3. Attempt to call codex-reply - fails because no conversationId was provided in the initial response
  4. Workaround: Manually extract UUID from ~/.codex/sessions/ directory

Workaround

# Get the latest session ID from filesystem
ls -t ~/.codex/sessions/$(date +%Y)/$(date +%m)/$(date +%d)/*.jsonl | head -1 | \
  grep -oE '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'

Environment

  • Codex CLI version: latest
  • MCP integration: Claude Code
  • OS: macOS

Impact

This limitation prevents seamless multi-turn conversations when using Codex as an MCP server, which is a key use case for AI-to-AI collaboration workflows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIenhancementNew feature or requestmcpIssues related to the use of model context protocol (MCP) serversmcp-serverIssues related to the use of the `codex mcp-server` subcommand

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions