Skip to content

Commit fe1ca03

Browse files
julienldclaude
andauthored
feat: add Codex CLI support to setup wizard (#387)
* feat: add Codex CLI support to setup wizard Add Codex (OpenAI CLI) as a client option in the setup wizard. - Add codex.md client definition with TOML config format - Support stdio and streamable-http transports - Add configuration generation for Codex CLI commands - Uses OpenAI logo and order position 13 Implements #382 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: correct Codex CLI syntax for Windows compatibility - Remove backslashes from commands (Windows incompatible) - Use correct `-- command args` syntax instead of `--command --args` - Update TOML examples to match actual config format - Use `[mcp_servers.name]` sections instead of `[[mcp.servers]]` - Test verified with actual `codex mcp add` command 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 963b879 commit fe1ca03

2 files changed

Lines changed: 93 additions & 0 deletions

File tree

site/src/content/clients/codex.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
name: Codex
3+
company: OpenAI
4+
logo: /logos/openai.svg
5+
transports: ['stdio', 'streamable-http']
6+
configFormat: cli
7+
configLocation: ~/.codex/config.toml
8+
accuracy: 4
9+
order: 13
10+
---
11+
12+
## Configuration
13+
14+
Codex CLI supports MCP servers via TOML configuration with stdio and HTTP streaming transports.
15+
16+
### Config File Location
17+
18+
- **Configuration:** `~/.codex/config.toml`
19+
- Shared between CLI and IDE extension
20+
21+
### stdio Configuration (Local)
22+
23+
```toml
24+
[mcp_servers.home-assistant]
25+
command = "uvx"
26+
args = ["ha-mcp@latest"]
27+
28+
[mcp_servers.home-assistant.env]
29+
HOMEASSISTANT_URL = "{{HOMEASSISTANT_URL}}"
30+
HOMEASSISTANT_TOKEN = "{{HOMEASSISTANT_TOKEN}}"
31+
```
32+
33+
### Streamable HTTP Configuration (Network/Remote)
34+
35+
```toml
36+
[mcp_servers.home-assistant]
37+
url = "{{MCP_SERVER_URL}}"
38+
```
39+
40+
### With Authentication
41+
42+
```toml
43+
[mcp_servers.home-assistant]
44+
url = "{{MCP_SERVER_URL}}"
45+
46+
[mcp_servers.home-assistant.headers]
47+
Authorization = "Bearer {{API_TOKEN}}"
48+
```
49+
50+
## Quick Setup with CLI Commands
51+
52+
### stdio (Local)
53+
54+
```bash
55+
codex mcp add homeassistant --env HOMEASSISTANT_URL={{HOMEASSISTANT_URL}} --env HOMEASSISTANT_TOKEN={{HOMEASSISTANT_TOKEN}} -- uvx ha-mcp@latest
56+
```
57+
58+
### HTTP Streaming (Network/Remote)
59+
60+
```bash
61+
codex mcp add home-assistant --url {{MCP_SERVER_URL}}
62+
```
63+
64+
## Management Commands
65+
66+
```bash
67+
# List configured servers
68+
codex mcp list
69+
70+
# Show server details
71+
codex mcp get home-assistant
72+
73+
# Remove a server
74+
codex mcp remove home-assistant
75+
```
76+
77+
## Notes
78+
79+
- Configuration uses TOML format (not JSON)
80+
- Supports stdio and HTTP streaming transports
81+
- OAuth 2.0 authentication available for remote servers
82+
- Config file shared between CLI and IDE extension

site/src/pages/setup.astro

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,6 +1392,17 @@ mcpServers:
13921392
} else {
13931393
config = `gemini mcp add --transport http home-assistant ${mcpUrl}`;
13941394
}
1395+
} else if (state.client.id === 'codex') {
1396+
// Codex CLI
1397+
if (isStdio) {
1398+
if (isDocker) {
1399+
config = `codex mcp add homeassistant --env HOMEASSISTANT_URL={{HOMEASSISTANT_URL}} --env HOMEASSISTANT_TOKEN={{HOMEASSISTANT_TOKEN}} -- docker run --rm -i ghcr.io/homeassistant-ai/ha-mcp:latest`;
1400+
} else {
1401+
config = `codex mcp add homeassistant --env HOMEASSISTANT_URL={{HOMEASSISTANT_URL}} --env HOMEASSISTANT_TOKEN={{HOMEASSISTANT_TOKEN}} -- uvx ha-mcp@latest`;
1402+
}
1403+
} else {
1404+
config = `codex mcp add home-assistant --url ${mcpUrl}`;
1405+
}
13951406
} else {
13961407
// Claude Code
13971408
if (isStdio) {

0 commit comments

Comments
 (0)