MCP Init
Use this skill to configure Codex MCP servers in
${CODEX_HOME:-$HOME/.codex}/config.toml.
When To Use
Use this skill when the user asks to:
- Set up, initialize, or repair Codex MCP configuration.
- Add or refresh Jina, Firecrawl, Hugging Face, or Git MCP server blocks.
- Bootstrap
~/.codex/config.toml. - Bind Git MCP to a specific repository.
- Validate MCP config syntax or configured server names.
Do not use this skill when:
- The user is asking about MCP concepts only and no local config change is needed.
- The request targets a non-Codex MCP client unless the user explicitly wants compatible config guidance.
- The user wants secrets hardcoded; discourage this unless explicitly required.
Workflow
- Resolve the target config path; default to
${CODEX_HOME:-$HOME/.codex}/config.toml. - Check whether
npxis available for Firecrawl anduvxis available for Git. - Use
scripts/init_mcp_config.pyto merge or replace managed MCP blocks. The script creates a timestamped.bakbefore writing. - Ask for API keys only if the user wants connectivity validation. For config creation, use env var names without seeing secret values.
- Verify the config parses as TOML.
- Report the configured MCP server names and any missing runtime or env var.
References
- Use
scripts/init_mcp_config.pyas the canonical deterministic tool. - Useful command:
python .codex/skills/operations/mcp-init/scripts/init_mcp_config.py - Use
--config <path>for a non-default config. - Use
--git-repository <repo>to bind Git MCP to a repository. - Use
--dry-runto print the merged config without writing.
Environment
jina: remote MCP athttps://mcp.jina.ai/v1, authenticated byJINA_API_KEYthroughbearer_token_env_var.firecrawl: local stdio server launched withnpx -y firecrawl-mcp, readingFIRECRAWL_API_KEYfrom the Codex process environment.huggingface: remote MCP athttps://huggingface.co/mcp, authenticated byHF_TOKENthroughbearer_token_env_var.git: local stdio server launched withuvx mcp-server-git, optionally with--repository.
Rules
- Never hardcode API keys unless the user explicitly asks.
- Prefer environment variables and tell the user which variables to export before starting Codex.
- Do not hide missing
npxoruvxbehind fallback installs; report the exact missing runtime. - Prefer binding Git MCP to the current project when the user wants a narrow repository scope.
Output
Final responses should include:
- Config path changed or inspected.
- Backup path when a write occurred.
- Server names configured.
- Validation command and result.
- Missing runtimes or environment variables, if any.