Leafage Help
Download

Connect Leafage to Codex MCP

Let Codex inspect projects, create nodes, open project windows, and start Leafage generations through local MCP tools.

Last updated June 26, 2026

Leafage can expose a local MCP server so Codex can work with the running desktop app instead of editing project files by hand.

Use this when you want Codex to help create or modify a Leafage project through typed tools.

What the MCP connection can do

The Leafage MCP server lets Codex:

  • List projects in the current project location.
  • Create projects.
  • Read the current project snapshot.
  • Open or focus project windows.
  • Create text and image generation nodes.
  • Connect nodes.
  • Update node prompts and settings.
  • Select generated versions.
  • Start and cancel generations.
  • List running generations.

Leafage stays the authority for project state. Codex should use the MCP tools instead of directly editing project files.

Connect automatically

  1. Open Projects.
  2. Click Settings.
  3. Open the Codex tab.
  4. In Codex MCP, click Connect Codex.
  5. Start a new Codex session.

Leafage starts a local server and writes the MCP configuration to your Codex config file.

When the connection is saved, Leafage shows the config path. By default, that path is ~/.codex/config.toml unless CODEX_HOME points somewhere else.

Example prompts for Codex

After connecting Leafage MCP, start a new Codex session and ask Codex to work through the Leafage tools.

Create a new project:

Use Leafage to create a new project called "Spring product concepts", then open it.

Build an initial canvas:

In my open Leafage project, create a small canvas graph for a botanical skincare campaign: one text node for the creative brief, three image generation nodes for hero directions, and connections from the brief to each image node. Start the image generations at 4:5, x2, medium reasoning.

Branch from an existing result:

Look at the current Leafage project, find the selected image generation that feels most like a premium product ad, then create three connected follow-up image nodes exploring warmer lighting, tighter product crop, and a more editorial background.

Generate from a specific node:

Use Leafage to generate four new versions from the selected image node. Keep the prompt mostly the same, but make the set feel more minimal, with softer shadows and less visual clutter.

Organize a busy canvas:

Inspect the Leafage canvas and rename the major branches based on what they are exploring. Do not delete anything. Open the project window when you are done so I can review it.

Check running work:

List the running Leafage generations in this project. If any have been running for a long time and are no longer useful, ask me before cancelling them.

Prompting tip

Ask Codex to use Leafage, inspect the current project, and preserve project files. Leafage MCP is designed so Codex edits through the app instead of changing project files directly.

Update an existing connection

If Leafage shows Update Codex, click it after the app shows a new endpoint or token. Then start a new Codex session so Codex reads the updated config.

Manual setup

If automatic setup is not available:

  1. Open Settings -> Codex.
  2. In Codex MCP, click Manual setup.
  3. Copy the URL.
  4. Copy the Authorization header value.
  5. Add those values to your Codex MCP configuration.

Leave the Bearer token env var field empty. Leafage provides the token as an HTTP header.

Turn off the MCP server

  1. Open Settings -> Codex.
  2. In Codex MCP, click Turn off server.

This stops the local Leafage MCP server and detaches the MCP actor from open project sessions.

Security model

The server binds to 127.0.0.1 and requires a bearer token. It is designed for local use on the same Mac as Leafage and Codex.

Do not share the URL or token. If you think the token was exposed, click Update Codex to write a fresh connection.