1Install imagic and start the trial
The MCP server ships with imagic Max, and the free 7-day trial unlocks everything with no card. Download it from the desktop page first, because Codex CLI needs something to talk to.
If you installed with pip rather than the packaged app, MCP is an optional extra: pip install imagic[mcp].
2Add imagic to Codex CLI
Codex CLI runs local MCP servers directly, with no tunnel and no remote endpoint.
codex mcp add imagic -- imagic-mcp
Configuration
Codex CLI reads ~/.codex/config.toml.
The top-level key is mcp_servers, which is not the mcpServers key most other clients use.
[mcp_servers.imagic] command = "imagic-mcp"
Where that file lives
| macOS | ~/.codex/config.toml |
|---|---|
| Linux | ~/.codex/config.toml |
OpenAI publishes this path in ~ form only and documents no Windows expansion, so use the command or the UI above rather than guessing where it lands.
3Ask for a cull
Restart Codex CLI if it was already running, then point it at a shoot:
Cull the shoot in D:/Shoots/eva_tom, apply my style, and export the keepers.
Codex CLI will call scan_directory, analyze_photos, apply_my_style and export_photos in turn. Every one of those runs on your machine: the agent sends instructions, never your photos.
Things that catch people out
- This is TOML, not JSON, and the key is mcp_servers with an underscore.
- A project-scoped .codex/config.toml is only loaded if you trust the project.
- Startup timeout defaults to 10 seconds and tool timeout to 60; raise startup_timeout_sec if a large library is slow to open.
- OpenAI publishes no Windows-specific path for config.toml.
What imagic can do once it is connected
That is 18 tools in total, covering the library, culling, editing and your learned style. See the full tool reference, or the workflows for what to actually ask for.
Setting up a different client?
Try it on a real shoot
The 7-day trial includes imagic Max, the MCP server and every tool on this page. No card required.
Configuration verified against OpenAI's documentation. If Codex CLI changes its setup and this page falls behind, tell us and we will fix it.