CodexWrapper.Commands.McpServer (CodexWrapper v0.8.0)

Copy Markdown View Source

Start Codex as an MCP server over stdio.

Wraps codex mcp-server.

This command now uses the config's runner instead of System.cmd. With the default Port runner, execution uses /bin/sh, stdin from /dev/null, and a SIGINT/TERM/KILL watchdog. A missing binary returns {:error, {:exit, 127, output}} instead of raising. Under Forcola, when neither config :timeout nor runner option :timeout_ms is set, the wall bound is the snapshotted :forcola_default_timeout_ms (300,000 ms unless configured), after which the command is cancelled and returns {:error, {:timeout, milliseconds}}. Set an explicit config :timeout for the intended server lifetime under Forcola. The Port runner has no whole-run bound unless :timeout is set; its closed stdin does not provide a duplex MCP connection.

Options

  • :config - list of "key=value" config overrides (-c)
  • :enable - list of feature flags to enable (--enable)
  • :disable - list of feature flags to disable (--disable)

Summary

Functions

Start Codex as an MCP server.

Functions

start(config, opts \\ [])

@spec start(CodexWrapper.Config.t(), keyword()) ::
  {:ok, String.t()} | {:error, term()}

Start Codex as an MCP server.

Options

  • :config - list of "key=value" config overrides
  • :enable - list of feature flags to enable
  • :disable - list of feature flags to disable

Examples

config = CodexWrapper.Config.new()
CodexWrapper.Commands.McpServer.start(config)
CodexWrapper.Commands.McpServer.start(config, config: ["model=\"gpt-5\""], enable: ["web-search"])