コンテンツにスキップ

Codex CLIConnect

Codex CLI

このコンテンツはまだ日本語訳がありません。

To connect without a key, copy the Codex command from Quick Install in Console (opens in new tab) and run it in an interactive terminal. Sign in when your browser opens. If Flovia is added but you never sign in, every Codex session starts without Flovia.

If Codex shows AuthRequired or Flovia’s tools are missing, run codex mcp login flovia in your own terminal, not from an agent’s shell, and leave it open until it prints Successfully logged in. A browser page that says Authentication complete is not a finished sign-in. If the browser cannot connect, run codex mcp login flovia again in that terminal and leave it open. If sign-in still cannot finish, create an API key in Console (opens in new tab) and connect Codex with it.

For runs without a browser, such as codex exec, CI or cron, use a key (below), or sign in once in an interactive terminal on that machine so Codex can refresh the sign-in by itself. For those runs, add required = true under [mcp_servers.flovia] in ~/.codex/config.toml so the run waits for Flovia’s tools before starting.

Save your key in the private shell profile used to start Codex:

Terminal window
export FLOVIA_KEY='<your key>'

Reload the profile, then run:

Terminal window
codex mcp add flovia --url https://api.flovia.dev/mcp --bearer-token-env-var FLOVIA_KEY

This adds the server to your Codex configuration, normally ~/.codex/config.toml. The file stores the variable name only. codex mcp list shows Bearer token when that name is saved, even if the key is missing or wrong. Codex then starts with no Flovia tools and no error in the chat. Restart Codex CLI with FLOVIA_KEY set, open /mcp, then check your connection. If FLOVIA_KEY is empty in the shell that starts Codex, Codex sends no key at all.

If Codex shows AuthRequired or Flovia’s tools are missing with a key, check that FLOVIA_KEY is set in the shell that starts Codex. An app opened from the Dock does not read ~/.zshrc. Quit it fully and open it again after the variable is set where the app reads it. To switch to sign-in, run codex mcp remove flovia, then codex mcp add flovia --url https://api.flovia.dev/mcp, and finish the browser sign-in.

export and shell profiles do not apply in PowerShell. Run this in PowerShell, paste your key when asked, then press Enter:

Terminal window
[Environment]::SetEnvironmentVariable('FLOVIA_KEY', (Read-Host 'Paste your Flovia key').Trim(), 'User')
codex mcp add flovia --url https://api.flovia.dev/mcp --bearer-token-env-var FLOVIA_KEY

The key is saved as a user environment variable and stays out of the command and its history. The add command is the same as above and also runs in cmd. A user variable reaches only programs started after it is set, so start Codex from a new terminal. The configuration is in %USERPROFILE%\.codex\config.toml. If you run Codex inside WSL, use the steps above in WSL: variables you export in WSL do not reach Windows apps.

With Flovia connected, Codex may still use its own web search or page fetching instead of Flovia. To make it use Flovia first, add this line to ~/.codex/AGENTS.md. The Codex app and the IDE extension read the same file.

Flovia (MCP server "flovia") is connected. For crypto prices, wallets, transactions, onchain and Solana reads, web search (Exa), reading web pages (Firecrawl) and text generation (OpenAI), use the flovia tools before your own web search, page fetching or other tools.
Terminal window
codex mcp remove flovia

If tools are missing or your key is rejected, see By client.