-
Notifications
You must be signed in to change notification settings - Fork 11
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
base: master
Are you sure you want to change the base?
Codex CLI Support: Emit strict object-shaped input schemas for MCP tools #29
Conversation
5c0f4bb
to
cf2a504
Compare
@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. |
cf2a504
to
a31c35b
Compare
Hi @jaredbroad , Thanks for taking another look at this. I rebased my branch from the latest upstream To mirror the video you shared, I recorded a YouTube walkthrough where Codex selects and runs a Dual Momentum Rotation algorithm: And here’s the backtest Codex produced during the run: 🔧 Repro Instructions (Hello World with Codex CLI)1. Clone & checkout my branchmkdir -p ~/work && cd ~/work
git clone git@github.com:alexmahrou/mcp-server.git
cd mcp-server
git checkout codex/fix-mcp-tool-schemas-for-codex-compatibility 2. Python environmentpython3 -m venv .venv
. .venv/bin/activate
pip install -U pip
pip install -e ".[test]" 3. Codex installationCodex CLI must be installed ( DEBUG=* codex 4. Codex configCodex looks for [projects."/home/alexm"]
trust_level = "trusted"
[projects."/home/alexm/work/mcp-server"]
trust_level = "trusted"
[mcp_servers.quantconnect]
command = "bash"
args = [
"-lc",
"cd /home/alexm/work/mcp-server && exec /home/alexm/work/mcp-server/.venv/bin/python -m src.main"
]
[mcp_servers.quantconnect.env]
QUANTCONNECT_USER_ID = "<your_user_id>"
QUANTCONNECT_API_TOKEN = "<your_api_token>" Replace the env values with your QC credentials. 5. Connect from CodexInside Codex chat:
Expected working tool calls:
This is the minimal repro I tested with. Codex CLI successfully:
I tried to keep this setup guide in parity with your published video, so anyone should be able to follow it 1:1 and reproduce Codex driving the QC MCP server. |
Hi @alexmahrou The video above shows the agent commonly struggles to provide the correct arguments to each tool and some tools still show "tool failed". We've created a GitHub Issue on the Codex repo to get the underlying problem addressed/pointed out. |
Oh sweet good to see this. Curious did you try launching codex with
? Maybe that would give us more verbose logging? |
I used the most verbose logging I could
but the logs still didn't elaborate on the problem. |
a31c35b
to
8c933cb
Compare
Summary
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