From 6a7a115e187d0c3c3baa682fb3abab784fadd6b9 Mon Sep 17 00:00:00 2001 From: Sean Cheick Baradji Date: Fri, 27 Mar 2026 13:31:37 -0400 Subject: [PATCH 1/2] fix: normalize Codex Context7 naming --- .codex/AGENTS.md | 3 +++ .codex/config.toml | 2 ++ README.md | 2 ++ scripts/codex/check-codex-global-state.sh | 8 ++++---- scripts/codex/merge-mcp-config.js | 6 +++--- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.codex/AGENTS.md b/.codex/AGENTS.md index ac93fb49..52301662 100644 --- a/.codex/AGENTS.md +++ b/.codex/AGENTS.md @@ -46,12 +46,15 @@ Available skills: Treat the project-local `.codex/config.toml` as the default Codex baseline for ECC. The current ECC baseline enables GitHub, Context7, Exa, Memory, Playwright, and Sequential Thinking; add heavier extras in `~/.codex/config.toml` only when a task actually needs them. +ECC's canonical Codex section name is `[mcp_servers.context7]`. The launcher package remains `@upstash/context7-mcp`; only the TOML section name is normalized for consistency with `codex mcp list` and the reference config. + ### Automatic config.toml merging The sync script (`scripts/sync-ecc-to-codex.sh`) uses a Node-based TOML parser to safely merge ECC MCP servers into `~/.codex/config.toml`: - **Add-only by default** — missing ECC servers are appended; existing servers are never modified or removed. - **7 managed servers** — Supabase, Playwright, Context7, Exa, GitHub, Memory, Sequential Thinking. +- **Canonical naming** — ECC manages Context7 as `[mcp_servers.context7]`; legacy `[mcp_servers.context7-mcp]` entries are treated as aliases during updates. - **Package-manager aware** — uses the project's configured package manager (npm/pnpm/yarn/bun) instead of hardcoding `pnpm`. - **Drift warnings** — if an existing server's config differs from the ECC recommendation, the script logs a warning. - **`--update-mcp`** — explicitly replaces all ECC-managed servers with the latest recommended config (safely removes subtables like `[mcp_servers.supabase.env]`). diff --git a/.codex/config.toml b/.codex/config.toml index 410fb6ac..069fe076 100644 --- a/.codex/config.toml +++ b/.codex/config.toml @@ -45,6 +45,8 @@ startup_timeout_sec = 30 [mcp_servers.context7] command = "npx" +# Canonical Codex section name is `context7`; the package itself remains +# `@upstash/context7-mcp`. args = ["-y", "@upstash/context7-mcp@latest"] startup_timeout_sec = 30 diff --git a/README.md b/README.md index 9289e45c..06ef9adc 100644 --- a/README.md +++ b/README.md @@ -1023,6 +1023,8 @@ cp .codex/config.toml ~/.codex/config.toml The sync script safely merges ECC MCP servers into your existing `~/.codex/config.toml` using an **add-only** strategy — it never removes or modifies your existing servers. Run with `--dry-run` to preview changes, or `--update-mcp` to force-refresh ECC servers to the latest recommended config. +For Context7, ECC uses the canonical Codex section name `[mcp_servers.context7]` while still launching the `@upstash/context7-mcp` package. If you already have a legacy `[mcp_servers.context7-mcp]` entry, `--update-mcp` migrates it to the canonical section name. + Codex macOS app: - Open this repository as your workspace. - The root `AGENTS.md` is auto-detected. diff --git a/scripts/codex/check-codex-global-state.sh b/scripts/codex/check-codex-global-state.sh index 147e9fb3..188443b9 100755 --- a/scripts/codex/check-codex-global-state.sh +++ b/scripts/codex/check-codex-global-state.sh @@ -103,7 +103,7 @@ if [[ -f "$CONFIG_FILE" ]]; then 'mcp_servers.github' \ 'mcp_servers.memory' \ 'mcp_servers.sequential-thinking' \ - 'mcp_servers.context7-mcp' + 'mcp_servers.context7' do if rg -n "^\[$section\]" "$CONFIG_FILE" >/dev/null 2>&1; then ok "MCP section [$section] exists" @@ -112,10 +112,10 @@ if [[ -f "$CONFIG_FILE" ]]; then fi done - if rg -n '^\[mcp_servers\.context7\]' "$CONFIG_FILE" >/dev/null 2>&1; then - warn "Duplicate [mcp_servers.context7] exists (context7-mcp is preferred)" + if rg -n '^\[mcp_servers\.context7-mcp\]' "$CONFIG_FILE" >/dev/null 2>&1; then + warn "Legacy [mcp_servers.context7-mcp] exists (context7 is preferred)" else - ok "No duplicate [mcp_servers.context7] section" + ok "No legacy [mcp_servers.context7-mcp] section" fi fi diff --git a/scripts/codex/merge-mcp-config.js b/scripts/codex/merge-mcp-config.js index 917e2948..48973934 100644 --- a/scripts/codex/merge-mcp-config.js +++ b/scripts/codex/merge-mcp-config.js @@ -89,7 +89,7 @@ const DEFAULT_MCP_STARTUP_TIMEOUT_TOML = `startup_timeout_sec = ${DEFAULT_MCP_ST const ECC_SERVERS = { supabase: dlxServer('supabase', '@supabase/mcp-server-supabase@latest', { startup_timeout_sec: 20.0, tool_timeout_sec: 120.0 }, 'startup_timeout_sec = 20.0\ntool_timeout_sec = 120.0'), playwright: dlxServer('playwright', '@playwright/mcp@latest', { startup_timeout_sec: DEFAULT_MCP_STARTUP_TIMEOUT_SEC }, DEFAULT_MCP_STARTUP_TIMEOUT_TOML), - 'context7-mcp': dlxServer('context7-mcp', '@upstash/context7-mcp@latest', { startup_timeout_sec: DEFAULT_MCP_STARTUP_TIMEOUT_SEC }, DEFAULT_MCP_STARTUP_TIMEOUT_TOML), + context7: dlxServer('context7', '@upstash/context7-mcp@latest', { startup_timeout_sec: DEFAULT_MCP_STARTUP_TIMEOUT_SEC }, DEFAULT_MCP_STARTUP_TIMEOUT_TOML), exa: { fields: { url: 'https://mcp.exa.ai/mcp' }, toml: `[mcp_servers.exa]\nurl = "https://mcp.exa.ai/mcp"` @@ -107,9 +107,9 @@ ECC_SERVERS.supabase.fields.args.push('--features=account,docs,database,debuggin ECC_SERVERS.supabase.toml = ECC_SERVERS.supabase.toml.replace(/^(args = \[.*)\]$/m, '$1, "--features=account,docs,database,debugging,development,functions,storage,branching"]'); // Legacy section names that should be treated as an existing ECC server. -// e.g. old configs shipped [mcp_servers.context7] instead of [mcp_servers.context7-mcp]. +// e.g. older configs shipped [mcp_servers.context7-mcp] instead of [mcp_servers.context7]. const LEGACY_ALIASES = { - 'context7-mcp': ['context7'] + context7: ['context7-mcp'] }; // --------------------------------------------------------------------------- From 432788d0b575e1579de380808ac4e40e4a72e6ab Mon Sep 17 00:00:00 2001 From: Sean Cheick Baradji Date: Fri, 27 Mar 2026 13:53:17 -0400 Subject: [PATCH 2/2] fix: clean up legacy Context7 aliases on update --- scripts/codex/merge-mcp-config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/codex/merge-mcp-config.js b/scripts/codex/merge-mcp-config.js index 48973934..38138dad 100644 --- a/scripts/codex/merge-mcp-config.js +++ b/scripts/codex/merge-mcp-config.js @@ -257,6 +257,10 @@ function main() { if (resolvedLabel !== name) { raw = removeServerFromText(raw, name, existing); } + if (legacyName && hasCanonical) { + toRemoveLog.push(`mcp_servers.${legacyName}`); + raw = removeServerFromText(raw, legacyName, existing); + } toAppend.push(spec.toml); } else { // Add-only mode: skip, but warn about drift