Prerequisites
- Node.js 20 or newer
- Codex CLI installed (
codex --version) - agentmako on PATH
$ npm install -g agentmako $ cd /path/to/your/project $ agentmako connect . --no-db $ agentmako doctor
Add to config.toml
Codex looks for MCP servers in ~/.codex/config.toml
(Linux/macOS) or %USERPROFILE%\.codex\config.toml
(Windows). Append this block:
[mcp_servers.mako-ai] command = "agentmako" args = ["mcp"]
agentmako is a shim (agentmako.cmd),
you may need to point Codex at the full path. Run
where agentmako in PowerShell to find it, then use that
absolute path as command.
Verify in Codex
Start a Codex session from your attached project:
$ cd /path/to/your/project $ codex
Once the session is up, ask Codex to list available tools.
You should see Mako tools (context_packet,
reef_scout, repo_map, cross_search,
ast_find_pattern, etc.) under the mako-ai server.
First task
Before reading any source files, call the mako-ai context_packet tool with the query: "locate and explain the auth callback handler". Show me the packet, then proceed with the task.
If you'd rather drive Mako from a script:
$ codex exec "Use mako-ai context_packet for: fix the broken /auth/callback route. Show packet, then patch."
Tell Codex when to use Mako
Codex respects AGENTS.md at the project root. Drop
the contents of agentmako's AGENTS.md
into your project's AGENTS.md so the agent learns to
reach for context_packet before grep.
AGENTS.md entry is the cheapest token win
in this whole setup.
Troubleshooting
Codex doesn't see mako-ai
Confirm the TOML key is exactly [mcp_servers.mako-ai]
(not [mcp.mako-ai]). Restart any open Codex sessions —
the config is read at startup.
Server starts then exits
Run the server manually to see the error:
agentmako mcp. If you get a stack trace about a missing
project, you haven't run agentmako connect . yet.
Tools call but return empty
Mako needs an attached project per directory. Make sure you
launched codex from the same directory you ran
agentmako connect in.