bumblebee icon indicating copy to clipboard operation
bumblebee copied to clipboard

mcp: servers configured in ~/.codex/config.toml are not inventoried

Open howardhsieh opened this issue 3 weeks ago • 0 comments

~/.codex is a default MCP config root (cmd/bumblebee/roots.go:258; the comment at line 245 says the dotfile homes cover Claude Code, Codex and Gemini CLI), and a scan does walk it. But Codex keeps its MCP servers in ~/.codex/config.toml as [mcp_servers.<name>] tables (see load_global_mcp_servers in codex-rs/config/src/mcp_edit.rs in openai/codex), while mcp.IsKnownMCPConfig only dispatches JSON basenames and nothing in the scanner reads TOML. So every Codex MCP server is missing from the inventory, with no diagnostic.

Reproduce (c1e83c0, macOS arm64)

H=$(mktemp -d); mkdir -p "$H/.codex"
cat > "$H/.codex/config.toml" <<'EOF'
[mcp_servers.codex-stdio-demo]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]

[mcp_servers.codex-http-demo]
url = "https://mcp.example.invalid/mcp"
EOF
# control: same directory, JSON format
cat > "$H/.codex/mcp.json" <<'EOF'
{ "mcpServers": { "json-control": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-everything"] } } }
EOF
HOME="$H" bumblebee scan --root "$H/.codex" --ecosystem mcp 2>/dev/null \
  | jq -r 'select(.record_type=="package") | .server_name'

Expected: codex-stdio-demo, codex-http-demo, json-control Actual: json-control only

The default baseline profile behaves the same: ~/.codex is listed in the summary's roots as mcp_config_root, and the config.toml servers are not emitted.

Possible fix

  • Path-aware dispatch like IsGeminiSettingsJSON: config.toml whose parent directory is .codex.
  • A small stdlib-only reader for the subset Codex writes ([mcp_servers.<name>] tables, including quoted names; string, array and boolean values), mapped onto the existing serverEntry fields (command, args, url) so the records match the JSON path.
  • Tests with t.TempDir() fixtures, per CONTRIBUTING.

I'm happy to send a PR for this if the approach works for you.

howardhsieh avatar Nov 06 '26 02:11 howardhsieh