> For the complete documentation index, see [llms.txt](https://docs.flora.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flora.ai/mcp/install/codex.md).

# Install FLORA MCP in OpenAI Codex

Add FLORA MCP to OpenAI Codex (CLI, IDE extension and desktop app) with codex mcp add or config.toml, then sign in with your FLORA account.

Codex connects to [FLORA MCP](https://flora.ai/mcp) as a Streamable HTTP server and signs in with OAuth. One command adds it, and the Codex CLI, IDE extension and desktop app all share the same configuration.

|             |                                                                                                                                                                                                                 |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Fastest** | `codex mcp add flora --url https://agents.flora.ai/mcp`, then `codex mcp login flora`                                                                                                                           |
| **Or**      | Add `[mcp_servers.flora]` to `~/.codex/config.toml`                                                                                                                                                             |
| **Needs**   | Codex, and a FLORA plan: Starter or above for ongoing use, or Free on the $2.50 of usage every new workspace gets ([pricing](/plans-and-billing/pricing.md), [details](/mcp/authentication.md#who-can-connect)) |
| **Sign in** | `codex mcp login flora` opens FLORA's sign-in page                                                                                                                                                              |
| **Verify**  | "List my FLORA workspaces. Don't generate anything."                                                                                                                                                            |
| **Remove**  | `codex mcp logout flora`, then `codex mcp remove flora`                                                                                                                                                         |

## Install with the CLI

```bash
codex mcp add flora --url https://agents.flora.ai/mcp
codex mcp login flora
```

`codex mcp add` writes the server to `~/.codex/config.toml`. `codex mcp login flora` opens your browser on FLORA's sign-in page. Sign in with the account you use at [app.flora.ai](https://app.flora.ai), then return to Codex.

## Or edit config.toml

Add this to `~/.codex/config.toml` (create the file if it doesn't exist):

```toml
[mcp_servers.flora]
url = "https://agents.flora.ai/mcp"
```

Then run `codex mcp login flora`.

Codex config is TOML. Pasting a JSON `mcpServers` block from another client's docs won't parse.

### Share it with your team

Put the same table in `.codex/config.toml` at the root of a repo. Codex loads project config only in projects you trust, so each teammate trusts the project, then runs `codex mcp login flora` once to sign in as themselves.

The [flora-mcp-skills](https://github.com/florafauna-ai/flora-mcp-skills) repo already contains this `.codex/config.toml`.

## Check it works

In the Codex TUI, run `/mcp`. `flora` should be listed with its tools. Then ask:

> List my FLORA workspaces. Don't generate anything.

Codex calls `flora_list_workspaces` and lists your workspaces. From a script, check the config with:

```bash
codex mcp list
codex mcp get flora
```

## Use an API key instead (headless)

For CI or a remote box where no one can sign in through a browser, have Codex read a FLORA API key from an environment variable. See [API keys](/mcp/authentication.md#api-keys-for-headless-setups) for creating one.

```toml
[mcp_servers.flora]
url = "https://agents.flora.ai/mcp"
bearer_token_env_var = "FLORA_API_KEY"
```

Codex sends it as `Authorization: Bearer <key>`. Skip `codex mcp login` when you use a key.

## Skills

Your agent can load any FLORA skill on demand with `flora_discover_skills`, so nothing else is required. To keep the skills as files in your project, see [Skills and plugins](/mcp/skills.md).

## Gotchas

| Symptom                                  | Cause                                                                     | Fix                                                                                              |
| ---------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| `config.toml` fails to parse             | A JSON block was pasted into TOML                                         | Use the `[mcp_servers.flora]` table above.                                                       |
| Project config is ignored                | The project isn't trusted                                                 | Trust the project in Codex, or put the table in `~/.codex/config.toml`.                          |
| Tools fail with `401`                    | The sign-in expired or was never completed                                | Run `codex mcp logout flora`, then `codex mcp login flora`.                                      |
| The sign-in callback never reaches Codex | Codex runs on a remote machine or devbox, or the callback port is blocked | Set a fixed `mcp_oauth_callback_port` in `config.toml` and forward that port, or use an API key. |
| `flora` connects but returns 404         | Trailing slash in the URL (`/mcp/` returns 404)                           | Use exactly `https://agents.flora.ai/mcp`.                                                       |

ChatGPT and Codex keep separate connections. Adding FLORA to Codex doesn't connect it in ChatGPT; see [Use FLORA in ChatGPT](/mcp/install/chatgpt.md).

## Remove

```bash
codex mcp logout flora
codex mcp remove flora
```

If you added the server by hand, delete the `[mcp_servers.flora]` table from `~/.codex/config.toml` (or the project's `.codex/config.toml`) instead. If you used an API key, revoke it in FLORA; see [Disconnect and revoke](/mcp/authentication.md#disconnect-and-revoke).

## Next

* [Quickstart](/mcp/quickstart.md): your first image, with a cost quote first.
* [Batch-generate 20 to 500 assets](/mcp/recipes/batch.md): Codex is a good fit for batch jobs.
* [Tools reference](/mcp/tools.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flora.ai/mcp/install/codex.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
