Skip to main content
Lesson 5 of 6 25 min

Test, Debug, Iterate

Add fast feedback loops so your MCP behaves reliably under real prompts.

Test, Debug, Iterate

Outcome

Set up a fast debugging loop so MCP issues are easy to diagnose.

Common Failure Modes

  1. Build output missing (dist/index.js does not exist).
  2. Wrong command/path in Codex MCP config.
  3. Tool listed but argument shape mismatches schema.
  4. Unhandled runtime errors inside tool handlers.

Quick Debug Checklist

  1. Rebuild:
pnpm --filter @create-something/codex-demo-mcp build
  1. Confirm output file exists:
ls packages/codex-demo-mcp/dist
  1. Confirm Codex points to the right server command:
codex mcp get codex-demo
  1. Add temporary logs in src/index.ts:
console.error('[codex-demo-mcp] tool call', request.params.name, request.params.arguments);
  1. 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_packages
  • find_todos
  • summarize_changed_files

Keep each tool focused and deterministic.

Next

Continue to Ship and Extend.