Codex
Wire the Krafa taste server into Codex so it builds UI against your curated references.
Codex configures MCP servers in TOML and reads bearer tokens from environment variables rather than the config file itself.
Setup
Get your token
Press ⌘K → Connect AI Agent in the board you want Codex to use, then export the token under a name you'll reference from the config:
export KRAFA_TOKEN="krafa_YOUR_TOKEN"Put the export in your shell profile. Codex reads the variable from the environment it launches in, so a token that only exists in one terminal produces a server that only connects in that terminal.
Add the server
[mcp_servers.krafa-taste]
url = "https://app.krafa.ai/api/mcp"
bearer_token_env_var = "KRAFA_TOKEN"Or from the CLI:
codex mcp add krafa-taste \
--url https://app.krafa.ai/api/mcp \
--bearer-token-env-var KRAFA_TOKENA project-scoped .codex/config.toml works the same way in a trusted project.
bearer_token_env_var takes the name of an environment variable, not the token. Codex reads the variable and builds the Authorization: Bearer … header itself. The plaintext bearer_token field is rejected outright for HTTP servers.
Keys are flat. Several guides in circulation show a nested transport = { type = "streamable_http", url = "..." } table. That shape only appears in codex mcp get --json output, and putting it in config.toml is a hard parse error.
If you need the header spelled out (say the value isn't a plain bearer token) use env_http_headers instead, which maps a header name to the environment variable holding its full value:
[mcp_servers.krafa-taste]
url = "https://app.krafa.ai/api/mcp"
env_http_headers = { Authorization = "KRAFA_AUTH_HEADER" }Verify
codex mcp listThe entry shows its URL and the bearer token environment variable it's reading. codex mcp get krafa-taste prints the resolved config, and /mcp inside a session lists the three tools.
On Codex builds from before December 2025, remote MCP servers required an experimental_use_rmcp_client = true flag placed above every [mcp_servers.*] table. That flag has been removed; the modern client is the default path. If you're pinned to an older version, add it back at the top of the file.
Make it automatic
Codex reads AGENTS.md from the project root:
## Design
Before writing or modifying any UI, call `get_taste_profile` from the
krafa-taste MCP server and follow it. Also call `get_exemplars` for
visual work. Do not fall back to default styling.A worked session
Scaffold the onboarding flow. Follow my design taste profile.
Codex pulls the profile, sees your Voice & Tone memories alongside the visual ones, and writes copy that sounds like your product rather than generic placeholder text, which is the category most agents get wrong precisely because nobody thinks to specify it.
Troubleshooting
| Symptom | Cause |
|---|---|
| Server fails to connect | KRAFA_TOKEN isn't exported in the environment Codex launched from |
bearer_token is not supported for streamable_http | Use bearer_token_env_var with a variable name |
| Unknown-field parse error | A transport table in config.toml. Flatten it to url |
| Empty profile | The board has no memories yet |