Set up Expand for Codex with the Expand Skill and MCP tools.
Install the Expand Skill so Codex knows when to use Expand, then install MCP so Codex can call Expand Fetch tools directly. Codex uses both: the skill teaches intent, MCP provides the tools. Codex has no Expand hook path.
expandai login
expandai skill install codex project
expandai mcp install codex projectRun this from your project root. Project setup writes .agents/skills/expandai/ and .codex/config.toml. If Codex does not pick up the new skill or MCP server, restart or reopen Codex.
MCP verification prompt:
Use the Expand MCP fetch tool to fetch https://news.ycombinator.com.
Show me the first 10 lines of Markdown and confirm the Fetch succeeded.If MCP is not wired up yet, the skill can still drive the CLI. Cross-agent check:
Use Expand to fetch https://news.ycombinator.com.
Show me the first 10 lines of Markdown and confirm the Fetch succeeded.Optional local auth check:
expandai whoami| Piece | What it does |
|---|---|
| Expand Skill | Installs SKILL.md so Codex knows when to use Expand and how to fall back to the CLI. |
| MCP server | Registers the Expand MCP server as expandai, run with expandai mcp run. |
| Shared auth | Codex config does not receive API keys. The MCP server reads local Expand CLI auth from expandai login. |
Codex does not have an Expand hook path. For Codex, install both Skill and MCP.
Project scope is the default. It keeps Expand scoped to one repo and lets you commit the config for collaborators.
| Scope | Install commands | Writes to | When to use |
|---|---|---|---|
| Project | expandai skill install codex projectexpandai mcp install codex project | <project root>/.agents/skills/expandai/<project root>/.codex/config.toml | Recommended for one repo. |
| Global |
Codex uses .agents/skills/expandai/ for skills, not .codex/skills/expandai/.
Commit project-scoped .agents/skills/expandai/ and .codex/config.toml only if the team wants Expand enabled for collaborators.
If Codex ignores project config, make sure the project is trusted in Codex.
The skill gives Codex instructions for when to use Expand. MCP gives Codex native tools such as fetch and fetch_search.
Skill alone can work when Codex can run shell commands. Add MCP when you want Codex to call Expand as native tools. For Codex, install both. Codex does not have an Expand hook path, so there is no automatic interception of its built-in fetching.
This is a reference for debugging. The installer writes these for you, and you usually should not edit them by hand.
Skill path:
<project root>/.agents/skills/expandai/SKILL.mdMCP config shape in .codex/config.toml:
[mcp_servers.expandai]
command = "expandai"
args = ["mcp", "run"]
enabled = trueThe installed MCP server runs without --docs, so the optional expand:// docs resources are not exposed by default. To expose them, see MCP Tools & Resources.
Uninstall both pieces if you want Codex to forget the Expand instructions and remove the native MCP tools.
expandai skill uninstall codex project
expandai mcp uninstall codex projectGlobal uninstall:
expandai skill uninstall codex global
expandai mcp uninstall codex global<project root>/.agents/skills/expandai/SKILL.md exists for project setup..codex/skills/.<project root>/.codex/config.toml contains [mcp_servers.expandai] for project setup.~/.codex/config.toml contains [mcp_servers.expandai] for global setup./mcp, if available.Codex may ignore project config until the project is trusted. Trust the project, then restart or reopen Codex.
Expand writes project-scoped Codex config to your current directory, not a detected repo root. If Codex cannot find the skill or MCP server, confirm you ran the install commands from the project root and check where .codex/config.toml and .agents/skills/expandai/ actually landed.
Run expandai login and expandai whoami in your terminal, then try the verification prompt again. Do not paste API keys into Codex config.
Ask Codex explicitly to use the Expand MCP fetch tool, then retry.
expandai skill install codex globalexpandai mcp install codex global~/.agents/skills/expandai/~/.codex/config.toml |
| Use Expand across projects. |