Skip to content

Codex CLI Support: Emit strict object-shaped input schemas for MCP tools #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexmahrou
Copy link

@alexmahrou alexmahrou commented Aug 14, 2025

Summary

  • Generated dynamic Pydantic models for every tool, emitting strict Draft‑07 object schemas with additionalProperties: false and eliminating "type": "integer" across the board.
  • Added a lightweight tools/list shim to coerce any legacy descriptors into compliant schemas.

There are around 10's of millions of ChatGPT Plus users who now have the ability to sign in with their ChatGPT Credentials in the Codex CLI at no additional cost or API token hit. Providing compatibility with this platform will provide another onramp into QC Ecosystem. The changes tighten every tool’s input schema so it is a Draft‑07 JSON object with additionalProperties: false and no "integer" types. By returning schemas that conform to the same spec most MCP clients expect, OpenAI’s Codex, Anthropic’s Claude, and any other MCP-compliant client can parse arguments deterministically without needing client‑specific shims or guessing field types. This reduces “missing field 'type'” errors and ensures consistent validation for all clients, not just Codex.

I've tested this branch locally with Codex CLI and it works.

Related to #21

@alexmahrou alexmahrou changed the title Emit strict object-shaped input schemas for MCP tools; remove integer… Codex CLI Support: Emit strict object-shaped input schemas for MCP tools Aug 14, 2025
@alexmahrou alexmahrou force-pushed the codex/fix-mcp-tool-schemas-for-codex-compatibility branch from 5c0f4bb to cf2a504 Compare August 19, 2025 10:51
@jaredbroad
Copy link
Member

@alexmahrou We tested this with codex and it still had issues. Perhaps there's some nuance about your setup that made it work for you? Can you please share a screen recording? We'd love to make it work with Codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants