Skip to content

Codex runtime does not expose configured MCP tools in agent-compose run #323

Description

@0x0334

Codex runtime does not expose configured MCP tools in agent-compose run

Summary

In agent-compose v2607.8.0 and v2607.9.0, a project can declare an MCP server and
the Guest Codex CLI can list that server when invoked directly. However, a Codex model
started through agent-compose run <agent> --prompt ... reports that the configured MCP
tool is unavailable. The model session also does not expose a terminal tool.

This prevents the model from invoking an MCP tool even though the MCP server and transport
work in direct control tests.

Environment

  • Docker driver
  • Guest image: ghcr.io/chaitin/agent-compose-guest:v2607.8.0
  • Reproduced again with daemon and Guest at v2607.9.0
  • Provider: codex
  • MCP transport: local stdio server

No private endpoint, credential, internal hostname, project name, or host-specific path is
required for this report.

Minimal configuration

name: mcp-repro

workspaces:
  source:
    provider: local
    path: .

mcp_servers:
  example-search:
    type: local
    command: python3
    args:
      - /workspace/mcp/stdio_server.py

agents:
  repro:
    provider: codex
    image: ghcr.io/chaitin/agent-compose-guest:v2607.9.0
    driver:
      docker: {}
    workspace:
      name: source
    mcp_servers:
      - example-search

The stdio server can be any local MCP server that exposes one harmless read-only tool,
for example search_demo.

Reproduction

Run a prompt that explicitly requests the configured tool:

agent-compose --file agent-compose.yml --json run repro --rm \
  --prompt 'Call the example-search/search_demo MCP tool once and report its result.'

Expected:

  1. The Codex run emits an MCP tool-call event.
  2. The stdio server receives a JSON-RPC tools/call request.
  3. The model reports the tool result.

Actual on both tested releases:

The configured MCP tool is not available in this session.

The MCP server receives no request from the model run.

Control tests

The same Guest can list the MCP server with the Codex CLI directly. The same stdio server
also succeeds when invoked directly, and agent-compose explicit command mode can execute a
fixed client command successfully. These controls show that the MCP server, Guest image,
Docker driver, and transport are functional; the failure is specific to the model runner's
tool exposure boundary.

Additional evidence

The runtime builds prompt options containing an MCP configuration, while the Codex runner
starts the Codex SDK without visibly passing that resolved MCP configuration into the SDK
thread/session. A wrapper that adds equivalent -c mcp_servers... overrides was also tested;
the wrapper was invoked, but the model still reported no MCP tool on both releases.

Impact

Agents that depend on MCP cannot perform their intended model-driven tool calls. A model
prompt also cannot reliably fall back to a shell command when no terminal tool is exposed.

Suggested fix

Please ensure the Codex runner passes the resolved MCP configuration into the Codex SDK/thread
configuration, or otherwise guarantees that the SDK process receives the same MCP configuration
shown by codex mcp list.

A regression test should assert that agent-compose run:

  1. emits an MCP tool-call event for a configured local server;
  2. delivers the JSON-RPC tools/call request to that server;
  3. exposes the tool to the model without a user-managed wrapper; and
  4. reports a clear startup error when the server cannot start.

Security

This report intentionally excludes credentials, private endpoints, internal hostnames/IPs,
project identifiers, sandbox/run identifiers, and application-specific data.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions