codex icon indicating copy to clipboard operation
codex copied to clipboard

Codex Desktop connects to remote OAuth MCP servers but their tools never reach threads

Open ajam1097 opened this issue 2 weeks ago • 2 comments

Version

Codex Desktop 26.1111.21308 on macOS. Codex CLI works with the same config.

What happens

I have three remote Streamable HTTP MCP servers (things_3, mealie, firewalla) behind Cloudflare Access OAuth. codex mcp list shows them enabled with OAuth, and the same requests work in the CLI. In a new Desktop thread, outside any project, the model reports "tools unavailable in this chat" and then tries a network test that fails DNS in the sandbox. A local stdio server (ynab) works fine in the same threads.

Evidence from ~/.codex/logs_2.sqlite

At startup, the app initializes all three servers successfully (Things 3.4.11, Mealie 1.12.0), and codex_mcp::connection_manager::tool_catalog logs:

built MCP tool list available_server_count=8 unavailable_server_count=0 tool_count=676

No MCP errors or warnings appear. The sessions are then cancelled and deleted (quit_reason=Cancelled).

Tried

  • Full restarts
  • mcp_oauth_credentials_store = "file" with a fresh codex mcp login
  • network_access = true
  • New threads outside any project
  • Disabling the GitHub and Cloudflare plugins to shrink the tool list

Expected

Remote OAuth MCP tools are available in Desktop threads, the same as in the CLI.

ajam1097 avatar Nov 16 '26 02:11 ajam1097

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #61325

Powered by Codex Action

github-actions[bot] avatar Nov 16 '26 02:11 github-actions[bot]

One source-grounded diagnostic distinction may help narrow this (current main, not a reproduction of Desktop 26.1111.21308): the log built MCP tool list ... available_server_count=8 ... tool_count=676 comes from codex-rs/codex-mcp/src/connection_manager/tool_catalog.rs::list_catalogs_with_errors(). That counts the normalized catalog, not the final tool set exposed to an individual model turn.

In the same file, capture_binding_with_metadata() separately assembles the per-turn McpBinding: pending optional startup can omit a server, prepare_tools_for_model / tool_is_model_visible can filter tools, and with a ready client a missing config.permission_profile_for_server(server_key) causes that server's tools to be skipped. Thus a successful OAuth initialize and a nonempty catalog do not establish that those tools crossed the later binding/exposure boundary. Source: tool_catalog.rs.

A useful Desktop-vs-CLI regression/discriminator would capture for the same configured remote server (1) raw catalog count and ready/cached/pending state, (2) effective permission profile and model-visibility filtering, (3) final McpBinding advertised names/call keys, and (4) the actual turn's model-facing tool declarations. If tools disappear at (3), investigate binding/config/exposure; if they survive (3) but not (4), investigate turn routing. The working local stdio server is a helpful control. #61325 reports a closely related same-version Desktop-vs-CLI failure and an earlier working Desktop version.

This locates a measurement seam, not a confirmed cause or fix; no affected Desktop runtime was available to reproduce it.

84dnnvbdvp-debug avatar Nov 16 '26 03:11 84dnnvbdvp-debug