Test, Debug, Iterate
Outcome
Set up a fast debugging loop so MCP issues are easy to diagnose.
Common Failure Modes
- Build output missing (
dist/index.jsdoes not exist). - Wrong command/path in Codex MCP config.
- Tool listed but argument shape mismatches schema.
- Unhandled runtime errors inside tool handlers.
Quick Debug Checklist
- Rebuild:
pnpm --filter @create-something/codex-demo-mcp build
- Confirm output file exists:
ls packages/codex-demo-mcp/dist
- Confirm Codex points to the right server command:
codex mcp get codex-demo
- Add temporary logs in
src/index.ts:
console.error('[codex-demo-mcp] tool call', request.params.name, request.params.arguments);
- Restart Codex session and run the same prompt again.
Add One Real Tool
After echo_text, add a tool tied to your daily work. Example:
list_workspace_packagesfind_todossummarize_changed_files
Keep each tool focused and deterministic.
Next
Continue to Ship and Extend.