src/TypeScript sources (ESM):index.tsMCP entrypoint (stdio server)tools/MCP tools (*.tool.ts),registry.ts,index.ts(registration)utils/execution, logging, parsing helpersconstants.tsshared types/strings
dist/compiled output (generated bytsc).docs/VitePress docs.scripts/maintenance utilities (e.g., wiki deploy).
Example: add a tool under src/tools/my-feature.tool.ts, then register it in src/tools/index.ts by pushing to toolRegistry.
npm run build— compile TypeScript todist/.npm start— run server fromdist/.npm run dev— compile once then run (no watch).npm run lint— type-check only (tsc --noEmit).- Docs:
npm run docs:dev|docs:build|docs:preview— develop/build/preview VitePress site.
Requirements: Node >=16. The server shells out to the codex CLI; ensure it's installed and authenticated in your environment.
- Language: TypeScript (ESM, Node16 resolution). Imports use
.jsextensions insrc/to match ESM output. - Indentation: 2 spaces; prefer single quotes in strings except where template literals or readability favors otherwise.
- Filenames:
kebab-case. Tools end with.tool.ts(e.g.,fetch-chunk.tool.ts). - Types: keep
zodschemas colocated with tools; export aUnifiedTooland register it.
- Currently no automated tests (
npm testis a stub). If adding tests, place them alongside sources (e.g.,src/**/__tests__) and mirror filenames. - Aim for unit coverage on parsing/execution utilities in
src/utils/and schema validation.
- Commits: concise, imperative subject (e.g.,
feat: add brainstorm tool,fix(utils): handle quota errors). - PRs: include a clear description, linked issues, reproduction steps, and sample CLI output (stdout/stderr) when relevant.
- Keep changes scoped; update docs in
docs/orREADME.mdwhen behavior/CLI changes.
- Tools exposed:
ask-codex,brainstorm,fetch-chunk,ping,Help(register insrc/tools/index.ts). - Quick local run (no build):
npx tsx src/index.ts. - Codex flags passthrough: prefer
fullAuto,approvalPolicy,sandboxMode,yolo,cdin tool args over hardcoding flags.
- Never commit secrets. Configure Codex credentials via the
codexCLI/env locally. - Validate untrusted input through
zodschemas; avoid spawning arbitrary commands beyond the intendedcodexCLI.
- Create
src/tools/your-tool.tool.ts - Define zod schema for arguments
- Export
UnifiedToolobject with name, description, schema, and execute function - Register in
src/tools/index.tsby adding totoolRegistry.push()