Skip to content

Commit 6bfe33d

Browse files
docs(codex): add troubleshooting for MCP Transport closed error (#443)
Document the recovery sequence and prevention policy for the stale MCP stdio session failure mode that surfaces as "Transport closed" in Codex after binary replacement, config edits, or force-stopped engram processes. Closes #167
1 parent 789c9bb commit 6bfe33d

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

docs/AGENT-SETUP.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,30 @@ command = "engram"
376376
args = ["mcp"]
377377
```
378378

379+
### Troubleshooting: "MCP Transport closed"
380+
381+
Codex communicates with Engram over a stdio MCP session that is started fresh each time Codex launches. If that session becomes stale — for example after replacing the `engram` binary, editing `config.toml` or the instruction files, or force-stopping an `engram` process — subsequent tool calls fail with:
382+
383+
```
384+
Transport closed
385+
```
386+
387+
**Recovery sequence**
388+
389+
1. Close the current Codex chat or window entirely.
390+
2. If any `engram` processes are still running, stop them:
391+
- macOS/Linux: `pkill -x engram`
392+
- Windows: `taskkill /IM engram.exe /F`
393+
3. Open a new Codex chat. Codex starts a fresh `engram mcp` stdio process on launch, which clears the stale session.
394+
395+
**Prevention**
396+
397+
- After replacing `engram.exe` / the `engram` binary, always start a new Codex chat before using memory tools.
398+
- After editing `~/.codex/config.toml`, `engram-instructions.md`, or `engram-compact-prompt.md`, restart Codex to pick up the new config.
399+
- Avoid force-killing `engram` while a Codex session is active; prefer closing the chat first so Codex can shut down the MCP process cleanly.
400+
401+
> **Windows note:** On Windows the stale process is most commonly left behind after an in-place binary replacement. The `taskkill` command above reliably clears it. If Codex shows the error immediately on a fresh chat, confirm that the new `engram.exe` is in `PATH` and that no older copy is shadowing it.
402+
379403
---
380404

381405
## VS Code (Copilot / Claude Code Extension)

0 commit comments

Comments
 (0)