TL;DR: . There are two pieces to install:
- The skill goes in
.agents/skills/nb2lite-image/for one project, or~/.agents/skills/nb2lite-image/for every project.
- The MCP registration tells Codex how to start
server.pyand which environment-variable names to forward. The API key itself is never written into the Codex config.
Pick one path below. Each path installs both pieces unless noted otherwise.
Path A: The plugin marketplace (fewest keystrokes)
From a terminal, add the marketplace:
CODEcodex plugin marketplace add xbill9/nb2lite-skill-codex
Then open Codex's Plugins Directory and install NB2Lite Image (
nb2lite-image).
The plugin manifest points Codex at both the packaged skill and.mcp.json, so
thenb2lite-agentserver is registered automatically.
The plugin intentionally carries no secret. Before launching Codex, expose your
key in the same shell:
CODEexport GEMINI_API_KEY="your-key"
codex
Approve the server when Codex prompts, then run
/mcp; it should list
nb2lite-agentand its four tools.
Path B: Clone and bootstrap (this repo)
CODE# 1. Get the code
git clone https://github.com/xbill9/nb2lite-skill-codex.git
cd nb2lite-skill-codex
# 2. One-command setup: installs deps, refreshes the repository skill,
# and prompts for your API key (stored in ~/gemini.key)
./init.sh
# 3. Start or restart Codex from this checkout
codex
Inside Codex, approve the server and run
/mcp. The checked-in
.codex/config.tomllaunches the authoritative rootserver.py; the repository
skill lives at.agents/skills/nb2lite-image/.init.shis safe to rerun.
Path C: Project-scoped install
From a clone of the repo:
CODEmake init TARGET=/path/to/your/project ARGS='--output-dir ./images'
This copies the skill into
<project>/.agents/skills/nb2lite-image/and writes
an idempotentnb2lite-agentblock into<project>/.codex/config.toml. The
server path is absolute, whileIMAGE_OUTPUT_DIRcan be project-relative.
CODEcd /path/to/your/project
export GEMINI_API_KEY="your-key"
codex
Approve the server, then verify it with
/mcp.
Path D: User-wide skill and MCP registration
To make the skill available to every Codex project:
CODEmake init ARGS='--global'
This installs the skill under
~/.agents/skills/nb2lite-image/and runs
codex mcp addto registernb2lite-agentin the user Codex configuration.
As with every other path, exportGEMINI_API_KEYbefore starting Codex.
Path E: Manual Codex registration
If you already copied the skill and only need the MCP server, Codex can register
it directly:
CODEpython3 -m pip install -r /absolute/path/to/nb2lite-image/mcp/requirements.txt
codex mcp add nb2lite-agent \
--env GEMINI_MODEL_NAME=gemini-3.1-flash-lite-image \
-- python3 /absolute/path/to/nb2lite-image/mcp/server.py
For a project-scoped setup, the equivalent
.codex/config.tomlblock is:
CODE[mcp_servers.nb2lite-agent]
command = "python3"
args = ["/absolute/path/to/nb2lite-image/mcp/server.py"]
env_vars = ["GEMINI_API_KEY", "GOOGLE_API_KEY"]
[mcp_servers.nb2lite-agent.env]
GEMINI_MODEL_NAME = "gemini-3.1-flash-lite-image"
IMAGE_OUTPUT_DIR = "./images"
Notice the split:
env_varsforwards secret values already present in the
shell; the[...env]table contains safe, non-secret defaults.
Path F: Docker (nothing on the host but Docker)
The server is published as . No manual compositing or retouching: Codex discovered the skill, called the MCP tools, read the saved paths, and produced the artifact used by the article.
Worth noticing:
The square concept became a real editorial asset.edit_local_imageis the bridge from any file on disk into the stateful workflow.
The visual identity survived the format change. The graphite body, expressive eyes, and ultraviolet glow carry from the mascot study into the wide cover.
The next change would be stateful. The local edit returned an interaction ID, so another request—"make the MCP nodes brighter"—would useedit_imagewith the newest ID.
Dogfooding is the cheapest credibility there is: the tool's real output is
literally the first thing you saw when you opened this article. The cover also
tests more than generation—it exercises Codex skill discovery, MCP tool
registration, local-file editing, aspect-ratio adaptation, saving, and the
handoff to a real publishing workflow.
Links
Repo:
Interactions API reference:
This is a third-party community project, not affiliated with or endorsed by OpenAI or Google. Bring your own Gemini API key — and remember generations are billable, so draft on
lowand savehighfor the money shot.↗ Original-Artikel auf dev.to lesenVollständiger Original-BerichtAusführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
Teaching Codex to Paint: A Stateful Image-Editing Skill Built on Gemini's Interactions API and MCP
- ▸ Background: why another image tool?
- ▸ The Interactions API: images with a memory
- ▸ What is MCP, in one minute
- ▸ And what's a Codex skill?
- ▸ Installing the skill and MCP server in Codex
- ↳ Path A: The plugin marketplace (fewest keystrokes)
- ↳ Path B: Clone and bootstrap (this repo)
- ↳ Path C: Project-scoped install
- ↳ Path D: User-wide skill and MCP registration
- ↳ Path E: Manual Codex registration
- ↳ Path F: Docker (nothing on the host but Docker)
- ↳ Troubleshooting, the whole guide
- ▸ Examples: a session in practice
- ▸ Dogfooding: about that cover image 🐕🍖
- ▸ Links
SOCIAL SHARE CARD GENERATOR