Python tools for interacting with OpenAI's Codex CLI via the Model Context Protocol (MCP)
Hoopoe defines 4 tools with reasonable descriptions and mostly complete schemas. Tool naming follows verb_noun conventions (codex, codex-reply, git-new-branch-pr, git-push-to-branch), though the hyphenation in git tool names is non-standard. Descriptions are present (10-250 chars) but lack actionable context for LLM selection. Parameters have type definitions and descriptions, but error handling guidance is absent. The codebase includes detailed inline documentation about parameter naming strategy (snake_case to dash-case conversion), which aids maintenance but suggests API friction. Output schemas are not explicitly documented. Security controls for destructive git operations are not visible in provided code.
Start a new Codex conversation with an initial user prompt. Returns the session ID, model name, and initial response.
Continue an existing Codex conversation with a follow-up prompt. Requires a valid session ID from a prior codex tool call.
Create a new git branch, commit files, push to remote, and create a pull request. Workflow: validates current branch is main/master, creates new branch, adds files, commits, pushes, and creates PR using gh CLI.
Push changes to an existing git branch. Validates user is on the correct branch, fetches remote state, stages files, commits, and pushes. Optionally updates PR description.
No output schemas documented for any tool. LLMs cannot plan downstream steps or extract return values when the response structure is hidden.
Tool descriptions lack LLM-optimized guidance. None explain WHEN to use the tool vs alternatives, WHAT prerequisites exist, or WHAT the return value structure is. Descriptions should be 50-200 chars with actionable context.
No error recovery guidance. If codex returns a rate-limit error, session not found, or invalid prompt, the response provides no guidance on retryability, user-fixable steps, or next actions.
git-new-branch-pr tool name contains 'and' (create AND push AND PR), violating single-responsibility principle. Should be split into separate tools or renamed to reflect primary action.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | C | 61 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 21 | - | v1 |
Destructive operations (git push, PR creation) accept no dry-run, confirmation, or idempotency hints. LLMs may invoke these without user confirmation, risking unintended commits or PRs.
Tool names use hyphenation (git-new-branch-pr, git-push-to-branch) instead of snake_case convention. While FastMCP may support this, it diverges from Python naming standards and can confuse LLMs that parse names as identifiers.
codex and codex-reply tools names are not action verbs. Preferred names: 'start_codex_session', 'continue_codex_conversation' would better signal intent to LLMs.
No idempotency documentation. Git push operations inherently risk side effects on retry (duplicate commits, multiple PRs). Should declare idempotency behavior or include safeguards.