codex icon indicating copy to clipboard operation
codex copied to clipboard

Codex 0.20.0 fails to convert several MCP tools (JSON Schema parsing): integer unsupported, union types rejected, and missing type — Obsidian MCP server

Open optimikelabs opened this issue 1 year ago • 3 comments

What version of Codex is running?

codex-cli 0.20.0

Which model were you using?

GPT-5

What platform is your computer?

  • Windows 11 • PowerShell 7 (x64) - WSL2 (Debian 2) • bash

What steps can reproduce the bug?

Summary On Codex 0.20.0, MCP tool discovery fails for 3 tools exposed by the cyanheads/obsidian-mcp-server. The exact same server lists 8/8 tools and works in other clients (e.g., Gemini CLI). Codex logs show schema-conversion errors during tools/list and hides those tools.

Environment

  • Client: Codex CLI codex-cli 0.20.0

  • Node/npm: v22.13.1 / 11.5.2

  • MCP server: cyanheads/obsidian-mcp-server (Docker)

  • OS / shells tested (same result)

    • Windows 11 • PowerShell 5.1
    • Windows 11 • PowerShell 7 (x64)
    • WSL2 (Ubuntu) • bash
  • Config: standard ~/.codex/config.toml with a [mcp_servers.obsidian] entry invoking the Docker image (same invocation used by Gemini CLI)

Expected All 8 tools from the Obsidian MCP server are visible and callable from Codex (including obsidian_global_search, obsidian_list_notes, obsidian_manage_frontmatter).

Actual Codex hides 3 tools and logs conversion errors on startup:

2025-08-11T23:51:01.117396Z ERROR Failed to convert "obsidian__obsidian_global_search" MCP tool to OpenAI tool: Error("unknown variant `integer`, expected one of `boolean`, `string`, `number`, `array`, `object`", line: 0, column: 0)
2025-08-11T23:51:01.117515Z ERROR Failed to convert "obsidian__obsidian_list_notes" MCP tool to OpenAI tool: Error("invalid type: sequence, expected variant identifier", line: 0, column: 0)
2025-08-11T23:51:01.117598Z ERROR Failed to convert "obsidian__obsidian_manage_frontmatter" MCP tool to OpenAI tool: Error("missing field `type`", line: 0, column: 0)

Repro steps

  1. Install Codex 0.20.0.

  2. Configure ~/.codex/config.toml with an MCP server entry, e.g.:

    [mcp_servers.obsidian]
    command = "docker"
    args = ["run","--rm","-i","--env-file","PATH_TO_.env","obsidian-mcp-server-fixed"]
    
  3. Launch codex, trigger MCP discovery (/mcp list), then check ~/.codex/log/codex-tui.log.

  4. Observe the 3 conversion errors above and the missing tools.

Cross-checks

  • With Gemini CLI against the exact same Docker command, all 8 tools are listed and callable.
  • Reproduced identically on PowerShell 5.1, PowerShell 7 (x64), and WSL2 (Ubuntu).

Notes / Hypothesis

  • Errors suggest the converter currently rejects JSON Schema inputs such as:

    • type: "integer" (accepted by JSON Schema, but seemingly unsupported here — only number works)
    • Union/nullable forms (e.g., type: ["string","null"])
    • Missing explicit type: "object" at schema roots
  • Request: clarify the supported subset of JSON Schema for MCP tools, or consider relaxing the converter to accept common patterns above.

Ask

  • Confirm whether integer and union-types are intentionally unsupported or if this is a regression.
  • If unsupported by design, please document the required JSON-Schema subset.
  • If regression, please fix so Codex loads the full toolset from community MCP servers like cyanheads/obsidian-mcp-server.

Labels suggested: bug, mcp, schema-conversion

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

optimikelabs avatar Aug 12 '25 00:08 optimikelabs

FYI, https://github.com/openai/codex/pull/1975 went into https://github.com/openai/codex/releases/tag/rust-v0.21.0, which was just released, so give that a try?

bolinfest avatar Aug 12 '25 04:08 bolinfest

Great, that solves the problem. Thanks a lot.

optimikelabs avatar Aug 12 '25 05:08 optimikelabs

FYI, #1975 went into https://github.com/openai/codex/releases/tag/rust-v0.21.0, which was just released, so give that a try?

is that mean we can use mcp Json or still use toml?

aldinokemal avatar Aug 12 '25 12:08 aldinokemal