OpenAI Codex CLI + Inliner.ai
Connect OpenAI Codex CLI to Inliner projects, smart hosted image URLs, local image files, and AI editing workflows through the Inliner MCP server.
Last updated: June 10, 2026
Prerequisites
- OpenAI Codex CLI installed and authenticated (official setup 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 with Codex's MCP command:
Terminal
codex mcp add inliner --env INLINER_API_KEY=inl_your-api-key-here -- npx -y @inliner/mcp-server
For manual setup, add the server to your Codex config:
~/.codex/config.toml
[mcp_servers.inliner]
command = "npx"
args = ["-y", "@inliner/mcp-server"]
[mcp_servers.inliner.env]
INLINER_API_KEY = "inl_your-api-key-here"
INLINER_DEFAULT_PROJECT = "your-project-namespace"
Step 3: Verify and Restart Codex CLI
Check that Codex sees the server, then start a new Codex session so the Inliner tools load.
Terminal
codex mcp list
Inside Codex, run /mcp to view active MCP servers and exposed tools.
Tip: Set
INLINER_DEFAULT_PROJECT when you want Codex to use the same Inliner project namespace by default.
What Inliner Adds to Codex
Codex can use the Inliner MCP server to work with production-ready, hosted image assets:
- generate_image_url - Build hosted Inliner image URLs and ready-to-use HTML image tags
- generate_image - Generate images from full prompts and optionally save them locally
- create_image - Quickly generate an image with sensible defaults
- edit_image - Edit an Inliner URL or upload a local file, then save the result
- get_projects, create_project, and get_project_details - Manage project namespaces and settings
- get_usage and get_current_plan - Check credits and plan capabilities
- list_images and get_image_dimensions - Browse assets and pick dimensions for common use cases
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.