OpenAI Codex CLI + Inliner.ai
Give OpenAI's Codex CLI the power to generate AI images. With the Inliner MCP server, Codex can create, edit, and manage images directly from your terminal.
Prerequisites
- OpenAI Codex CLI installed (installation guide)
- An Inliner.ai account (free tier available)
- Node.js 18+ installed
Quick Setup
Step 1: Get Your API Key
- Log into your Inliner.ai dashboard
- Go to Account > API Keys
- Click Create API Key and copy the key
Step 2: Configure MCP Server
Add the Inliner MCP server to your Codex CLI config:
~/.codex/config.toml
[mcp.inliner]
command = "npx"
args = ["@inliner/mcp-server"]
[mcp.inliner.env]
INLINER_API_KEY = "inl_your-api-key-here"
Step 3: Restart Codex CLI
Close and reopen Codex CLI to load the MCP server. The Inliner tools will now be available.
Tip: You can also set your API key as an environment variable:
export INLINER_API_KEY=inl_xxx
What Codex Can Do
With the Inliner MCP server, Codex CLI gains these capabilities:
- generate_image — Create images from text descriptions
- edit_image — Modify existing images with AI
- get_projects — List your Inliner projects
- get_usage — Check your credit balance
- list_images — Browse generated images
Example Interactions
Using with @inliner/cli
You can also use the standalone Inliner CLI alongside Codex for batch operations:
Terminal
# Generate images directly from terminal
npx @inliner/cli "hero-banner_1200x600.png" -p myproject
# Pipe through other tools
npx @inliner/cli gen "logo" -p brand --size 512x512 | convert - -resize 64x64 favicon.png
See the CLI documentation for more examples.