Codex CLI integration

Point Codex CLI at your persistent AliasMode profiles.

AliasMode registers as a local stdio MCP server in Codex CLI. Profile lifecycle, browser control, and the Playwright action set become tools the terminal agent can call on the machine that holds the profiles.

Local MCP (stdio) — Windows — Tested 2026-09-01

Direct answer

Run aliasmode-mcp setup --yes --client codex, or add the server by hand with codex mcp add. Codex writes the aliasmode entry to ~/.codex/config.toml and loads 40 tools from the beta.47 installer.

stdioLocal transport
config.tomlRegistration file
40Tools on beta.47

Set up Codex CLI

  1. Install AliasMode on Windows

    Download the installer, install CloakBrowser, and create at least one profile. Keep the desktop app available; the MCP helper starts it in the background when needed.

  2. Locate the MCP helper

    The Windows installer places aliasmode-mcp.exe next to AliasMode.exe, by default in %LOCALAPPDATA%\AliasMode.

  3. Register the server automatically

    Run the setup from the install directory. It detects Codex, removes any older aliasmode registration, and writes the new one.

    cd "%LOCALAPPDATA%\AliasMode"
    aliasmode-mcp setup --yes --client codex
  4. Or register manually

    The manual command matches what the setup writes:

    codex mcp add aliasmode -- "%LOCALAPPDATA%\AliasMode\aliasmode-mcp.exe" serve
  5. Confirm the config file

    The command writes an mcp_servers.aliasmode entry to the Codex config at %USERPROFILE%\.codex\config.toml:

    [mcp_servers.aliasmode]
    command = "C:\\Users\\<you>\\AppData\\Local\\AliasMode\\aliasmode-mcp.exe"
    args = ["serve"]
  6. Run a browser test

    Start Codex in the repo where the work happens and ask for a profile run:

    List my AliasMode profiles.
    Open the profile named Checkout headless, visit the staging site, and save a screenshot.
    Close the browser.

Verify the connection

  • codex mcp list shows the aliasmode server.
  • The config.toml entry points at aliasmode-mcp.exe with the serve argument.
  • The tool list includes aliasmode_profiles_list plus 31 Playwright actions — 40 tools on the beta.47 installer.
  • A headless browser opens from a named profile and browser_snapshot returns real page content.
  • Closing the browser returns the profile to closed state in AliasMode.

Troubleshooting

SymptomFix
Codex does not list the aliasmode serverRerun codex mcp add, confirm %USERPROFILE%\.codex\config.toml contains the mcp_servers.aliasmode block, and restart the Codex session.
The path in config.toml fails after hand-editingEscape backslashes in TOML basic strings ("C:\\Users\\...") or switch the value to a single-quoted TOML literal string.
Tool calls fail with a runtime readiness errorThe helper starts AliasMode in the background and waits briefly. Open the desktop app manually, wait for the dashboard to load, then retry.
Playwright tools return a selection errorOpen a profile with aliasmode_browser_open or select an open browser with aliasmode_browser_select before page actions.

What Codex CLI gets

  • Profile lifecycle: list, create, and delete profiles from the terminal agent
  • Browser control: open headful or headless, select an open browser, check status, close safely
  • Page actions: 31 Playwright tools for navigation, forms, screenshots, and verification
  • Project-independent registration: the config.toml entry applies to every Codex session on this machine

config.toml reference

Codex stores MCP servers under mcp_servers in its TOML config. Keep the serve argument in args so the helper starts the stdio server, and keep the full path to the helper in the AliasMode install directory.

[mcp_servers.aliasmode]
command = "C:\\Users\\<you>\\AppData\\Local\\AliasMode\\aliasmode-mcp.exe"
args = ["serve"]

Sources and verification

  • OpenAI · Codex documentation — MCP server configuration (config.toml mcp_servers) (checked September 2026)
  • AliasMode repository · agent/setup.ts — generated Codex registration command (checked September 2026)
  • AliasMode · Generated MCP tool catalog for the released 0.1.0-beta.47 installer (checked September 2026)

Public product details can change after the check date. Facts are re-checked on a monthly cycle.