MCP server tools are not exposed to the model when using the built-in lmstudio provider (identical setup works with the openai provider)

Open 💬 1 comment Opened Jun 11, 2026 by MatthiasKloepperQC

What version of Codex CLI is running?

codex-cli 0.139.0

What subscription do you have?

ChatGPT Enterprise — but the bug concerns the built-in lmstudio provider with a local model, where no subscription is involved; the subscription account was only used for the working gpt-5.5 control case.

Which model were you using?

google/gemma-4-26b-a4b-qat vs. gpt-5.5

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What terminal emulator and version are you using (if applicable)?

Windows Terminal — PowerShell 7.6.2; no multiplexer.

Codex doctor report

{
  "schemaVersion": 1,
  "generatedAt": "1781171963s since unix epoch",
  "overallStatus": "warning",
  "codexVersion": "0.139.0",
  "checks": {
    "app_server.status": {
      "id": "app_server.status",
      "category": "app-server",
      "status": "ok",
      "summary": "background server is not running",
      "details": {
        "control socket": "C:\\Users\\MatthiasKlöpper\\.codex\\app-server-control\\app-server-control.sock",
        "daemon state dir": "C:\\Users\\MatthiasKlöpper\\.codex\\app-server-daemon",
        "mode": "ephemeral",
        "pid file": "C:\\Users\\MatthiasKlöpper\\.codex\\app-server-daemon\\app-server.pid (missing)",
        "settings": "C:\\Users\\MatthiasKlöpper\\.codex\\app-server-daemon\\settings.json (missing)",
        "status": "not running",
        "update-loop pid file": "C:\\Users\\MatthiasKlöpper\\.codex\\app-server-daemon\\app-server-updater.pid (missing)"
      },
      "remediation": null,
      "durationMs": 0
    },
    "auth.credentials": {
      "id": "auth.credentials",
      "category": "auth",
      "status": "ok",
      "summary": "auth is configured",
      "details": {
        "auth file": "C:\\Users\\MatthiasKlöpper\\.codex\\auth.json",
        "auth storage mode": "File",
        "stored API key": "false",
        "stored ChatGPT tokens": "true",
        "stored agent identity": "false",
        "stored auth mode": "chatgpt"
      },
      "remediation": null,
      "durationMs": 0
    },
    "config.load": {
      "id": "config.load",
      "category": "config",
      "status": "ok",
      "summary": "config loaded",
      "details": {
        "CODEX_HOME": "C:\\Users\\MatthiasKlöpper\\.codex",
        "config.toml": "C:\\Users\\MatthiasKlöpper\\.codex\\config.toml",
        "config.toml parse": "ok",
        "cwd": "C:\\Users\\MatthiasKlöpper",
        "enabled feature flags": "shell_tool, shell_snapshot, terminal_resize_reflow, sqlite, hooks, enable_request_compression, multi_agent, apps, tool_suggest, plugins, in_app_browser, browser_use, browser_use_external, computer_use, plugin_sharing, image_generation, skill_mcp_dependency_install, steer, guardian_approval, goals, collaboration_modes, tool_call_mcp_elicitation, personality, fast_mode, tui_app_server, workspace_dependencies",
        "feature flag overrides": "none",
        "feature flags enabled": "26",
        "log dir": "C:\\Users\\MatthiasKlöpper\\.codex\\log",
        "mcp servers": "1",
        "model": "gpt-5.5",
        "model provider": "openai",
        "sqlite home": "C:\\Users\\MatthiasKlöpper\\.codex"
      },
      "remediation": null,
      "durationMs": 0
    },
    "git.environment": {
      "id": "git.environment",
      "category": "git",
      "status": "ok",
      "summary": "git version 2.53.0.windows.3",
      "details": {
        "PATH git #1": "C:\\Program Files\\Git\\cmd\\git.exe",
        "PATH git entries": "1",
        "git build options": "git version 2.53.0.windows.3; cpu: x86_64; built from commit: f8165afd89b0c190677a093f20894f5fce12f97a; sizeof-long: 4; sizeof-size_t: 8; shell-path: D:/git-sdk-64/usr/bin/sh; rust: disabled; feature: fsmonitor--daemon; gettext: enabled; libcurl: 8.18.0; OpenSSL: OpenSSL 3.5.5 27 Jan 2026; zlib: 1.3.1; SHA-1: SHA1_DC; SHA-256: SHA256_BLK; default-ref-format: files; default-hash: sha1",
        "git exec path": "C:/Program Files/Git/mingw64/libexec/git-core",
        "git version": "git version 2.53.0.windows.3",
        "repo detected": "false",
        "selected git": "C:\\Program Files\\Git\\cmd\\git.exe"
      },
      "remediation": null,
      "durationMs": 53
    },
    "installation": {
      "id": "installation",
      "category": "install",
      "status": "ok",
      "summary": "installation looks consistent",
      "details": {
        "PATH codex #1": "C:\\Users\\MatthiasKl�pper\\AppData\\Local\\Programs\\OpenAI\\Codex\\bin\\codex.exe",
        "PATH codex #2": "C:\\Users\\MatthiasKl�pper\\AppData\\Roaming\\npm\\codex",
        "PATH codex #3": "C:\\Users\\MatthiasKl�pper\\AppData\\Roaming\\npm\\codex.cmd",
        "PATH codex entries": "3",
        "current executable": "C:\\Users\\MatthiasKlöpper\\AppData\\Local\\Programs\\OpenAI\\Codex\\bin\\codex.exe",
        "install context": "standalone (windows, package C:\\Users\\MatthiasKlöpper\\.codex\\packages\\standalone\\releases\\0.139.0-x86_64-pc-windows-msvc, bin C:\\Users\\MatthiasKlöpper\\.codex\\packages\\standalone\\releases\\0.139.0-x86_64-pc-windows-msvc\\bin, resources C:\\Users\\MatthiasKlöpper\\.codex\\packages\\standalone\\releases\\0.139.0-x86_64-pc-windows-msvc\\codex-resources, path C:\\Users\\MatthiasKlöpper\\.codex\\packages\\standalone\\releases\\0.139.0-x86_64-pc-windows-msvc\\codex-path)",
        "managed by bun": "false",
        "managed by npm": "false",
        "managed package root": "not set"
      },
      "remediation": null,
      "durationMs": 41
    },
    "mcp.config": {
      "id": "mcp.config",
      "category": "mcp",
      "status": "ok",
      "summary": "MCP configuration is locally consistent",
      "details": {
        "configured servers": "1",
        "disabled servers": "0",
        "stdio servers": "1"
      },
      "remediation": null,
      "durationMs": 5
    },
    "network.env": {
      "id": "network.env",
      "category": "network",
      "status": "ok",
      "summary": "network-related environment looks readable",
      "details": {
        "proxy env vars": "none"
      },
      "remediation": null,
      "durationMs": 0
    },
    "network.provider_reachability": {
      "id": "network.provider_reachability",
      "category": "reachability",
      "status": "ok",
      "summary": "active provider endpoints are reachable over HTTP",
      "details": {
        "ChatGPT base URL": "https://chatgpt.com/backend-api/ reachable (HTTP 403)",
        "reachability mode": "ChatGPT auth"
      },
      "remediation": null,
      "durationMs": 91
    },
    "network.websocket_reachability": {
      "id": "network.websocket_reachability",
      "category": "websocket",
      "status": "ok",
      "summary": "Responses WebSocket handshake succeeded",
      "details": {
        "DNS": "2 IPv4, 2 IPv6, first IPv6",
        "auth mode": "chatgpt",
        "connect timeout": "15000 ms",
        "endpoint": "wss://chatgpt.com/backend-api/<redacted>",
        "handshake result": "HTTP 101 Switching Protocols",
        "model provider": "openai",
        "models etag present": "true",
        "provider name": "OpenAI",
        "proxy env vars": "none",
        "reasoning header": "false",
        "server model present": "false",
        "supports websockets": "true",
        "wire API": "responses"
      },
      "remediation": null,
      "durationMs": 849
    },
    "runtime.provenance": {
      "id": "runtime.provenance",
      "category": "runtime",
      "status": "ok",
      "summary": "running standalone on windows-x86_64",
      "details": {
        "commit": "unknown",
        "current executable": "C:\\Users\\MatthiasKlöpper\\AppData\\Local\\Programs\\OpenAI\\Codex\\bin\\codex.exe",
        "install method": "standalone (windows, package C:\\Users\\MatthiasKlöpper\\.codex\\packages\\standalone\\releases\\0.139.0-x86_64-pc-windows-msvc, bin C:\\Users\\MatthiasKlöpper\\.codex\\packages\\standalone\\releases\\0.139.0-x86_64-pc-windows-msvc\\bin, resources C:\\Users\\MatthiasKlöpper\\.codex\\packages\\standalone\\releases\\0.139.0-x86_64-pc-windows-msvc\\codex-resources, path C:\\Users\\MatthiasKlöpper\\.codex\\packages\\standalone\\releases\\0.139.0-x86_64-pc-windows-msvc\\codex-path)",
        "platform": "windows-x86_64",
        "version": "0.139.0"
      },
      "remediation": null,
      "durationMs": 0
    },
    "runtime.search": {
      "id": "runtime.search",
      "category": "search",
      "status": "ok",
      "summary": "search is OK (bundled)",
      "details": {
        "search command": "C:\\Users\\MatthiasKlöpper\\.codex\\packages\\standalone\\releases\\0.139.0-x86_64-pc-windows-msvc\\codex-path\\rg.exe",
        "search command readiness": "file exists",
        "search provider": "bundled"
      },
      "remediation": null,
      "durationMs": 0
    },
    "sandbox.helpers": {
      "id": "sandbox.helpers",
      "category": "sandbox",
      "status": "ok",
      "summary": "sandbox configuration is readable",
      "details": {
        "approval policy": "OnRequest",
        "codex-linux-sandbox helper": "none",
        "execve wrapper helper": "none",
        "filesystem sandbox": "unrestricted",
        "network sandbox": "enabled"
      },
      "remediation": null,
      "durationMs": 0
    },
    "state.paths": {
      "id": "state.paths",
      "category": "state",
      "status": "ok",
      "summary": "state paths and databases are inspectable",
      "details": {
        "CODEX_HOME": "C:\\Users\\MatthiasKlöpper\\.codex (dir)",
        "active rollout files": "13 files, 1911759 total bytes, 147058 average bytes",
        "archived rollout files": "18 files, 1681555 total bytes, 93419 average bytes",
        "goals DB": "C:\\Users\\MatthiasKlöpper\\.codex\\goals_1.sqlite (file)",
        "goals DB integrity": "ok",
        "log DB": "C:\\Users\\MatthiasKlöpper\\.codex\\logs_2.sqlite (file)",
        "log DB integrity": "ok",
        "log dir": "C:\\Users\\MatthiasKlöpper\\.codex\\log (missing)",
        "memories DB": "C:\\Users\\MatthiasKlöpper\\.codex\\memories_1.sqlite (file)",
        "memories DB integrity": "ok",
        "sqlite home": "C:\\Users\\MatthiasKlöpper\\.codex (dir)",
        "standalone release cache": "1 entries in C:\\Users\\MatthiasKlöpper\\.codex\\packages\\standalone\\releases",
        "state DB": "C:\\Users\\MatthiasKlöpper\\.codex\\state_5.sqlite (file)",
        "state DB integrity": "ok"
      },
      "remediation": null,
      "durationMs": 344
    },
    "state.rollout_db_parity": {
      "id": "state.rollout_db_parity",
      "category": "threads",
      "status": "warning",
      "summary": "rollout files and state DB thread inventory differ",
      "details": {
        "default model provider": "openai",
        "rollout DB active files": "13",
        "rollout DB active rows": "13",
        "rollout DB archive mismatches": "0",
        "rollout DB archived files": "18",
        "rollout DB archived rows": "18",
        "rollout DB duplicate DB paths": "0",
        "rollout DB duplicate rollout thread ids": "0",
        "rollout DB malformed file names": "0",
        "rollout DB missing active rows": "0",
        "rollout DB missing archived rows": "1",
        "rollout DB missing archived sample": "C:\\Users\\MatthiasKlöpper\\.codex\\archived_sessions\\rollout-2026-06-11T03-41-08-019eb457-1e7b-7973-b885-95b4a0a5f550.jsonl",
        "rollout DB model providers": "lmstudio=24, openai=7",
        "rollout DB rows": "31",
        "rollout DB scan cap reached": "false",
        "rollout DB scan errors": "0",
        "rollout DB sources": "vscode=21, cli=10",
        "rollout DB stale row sample": "C:\\Users\\MatthiasKlöpper\\.codex\\sessions\\2026\\06\\11\\rollout-2026-06-11T03-41-08-019eb457-1e7b-7973-b885-95b4a0a5f550.jsonl",
        "rollout DB stale rows": "1"
      },
      "issues": [
        {
          "severity": "warning",
          "cause": "rollout files are missing from the state DB",
          "measured": "0 active, 1 archived",
          "expected": "every rollout file has a matching threads row",
          "remedy": null,
          "fields": []
        },
        {
          "severity": "warning",
          "cause": "state DB rows point at missing or unusable rollout files",
          "measured": "1 stale rows",
          "expected": "every state DB rollout path is a file on disk",
          "remedy": null,
          "fields": []
        }
      ],
      "remediation": null,
      "durationMs": 713
    },
    "system.environment": {
      "id": "system.environment",
      "category": "system",
      "status": "ok",
      "summary": "OS language de-DE",
      "details": {
        "EDITOR": "not set",
        "VISUAL": "not set",
        "os": "Windows 10.0.26200 (Windows 11 Enterprise) [64-bit]",
        "os language": "de-DE",
        "os type": "Windows",
        "os version": "10.0.26200"
      },
      "remediation": null,
      "durationMs": 0
    },
    "terminal.env": {
      "id": "terminal.env",
      "category": "terminal",
      "status": "ok",
      "summary": "terminal metadata was detected",
      "details": {
        "color output": "enabled",
        "console input code page": "850",
        "console output code page": "850",
        "stderr console mode": "0x00000007 (VT processing: true)",
        "stderr is terminal": "true",
        "stdin is terminal": "true",
        "stdout console mode": "0x00000007 (VT processing: true)",
        "stdout is terminal": "true",
        "terminal": "unknown",
        "terminal size": "120x30"
      },
      "remediation": null,
      "durationMs": 0
    },
    "terminal.title": {
      "id": "terminal.title",
      "category": "title",
      "status": "ok",
      "summary": "terminal title default",
      "details": {
        "terminal title activity": "true",
        "terminal title items": "activity, project-name",
        "terminal title project source": "cwd",
        "terminal title project value": "MatthiasKlöpper",
        "terminal title source": "default"
      },
      "remediation": null,
      "durationMs": 0
    },
    "updates.status": {
      "id": "updates.status",
      "category": "updates",
      "status": "ok",
      "summary": "update configuration is locally consistent",
      "details": {
        "cached latest version": "0.139.0",
        "check for update on startup": "true",
        "last checked at": "2026-06-10T23:45:37.180971300Z",
        "latest version": "0.139.0",
        "latest version status": "current version is not older",
        "update action": "standalone installer",
        "version cache": "C:\\Users\\MatthiasKlöpper\\.codex\\version.json"
      },
      "remediation": null,
      "durationMs": 229
    }
  }
}

What issue are you seeing?

MCP server tools are not exposed to the model when using the built-in lmstudio provider (identical setup works with the openai provider)

Versions / platform

  • codex-cli: 0.139.0 (npm install and Codex desktop app bundled CLI, both same version)
  • OS: Windows 11 x64
  • Local backend: LM Studio 0.4.15, /v1/responses endpoint, model google/gemma-4-26b-a4b-qat (GGUF)
  • Provider: built-in lmstudio provider (no custom [model_providers] block)

Summary

An MCP server configured under [mcp_servers.playwright] starts correctly and its tools are registered with the harness (visible via /mcp). When the session runs against the built-in lmstudio provider, none of the MCP tools are included in the tool list delivered to the model — the model only receives Codex built-ins (shell_command, apply_patch, update_plan, ...). Switching only the model to gpt-5.5 (openai provider), same config and same MCP server, delivers the full MCP toolset to the model.

This looks like the provider-specific branch of session tool-list serialization dropping MCP entries for local providers, related to but distinct from #19871 (which reports unreliable invocation; here the tools are absent from the model's tool list entirely). The general case in #20771 (tools invisible on all providers, v0.128.0) does not reproduce on 0.139.0 — the openai provider path works.

Configuration (relevant excerpt)

model = "google/gemma-4-26b-a4b-qat"
model_provider = "lmstudio"

[mcp_servers.playwright]
enabled = true
command = "npx"
args = ["-y", "@playwright/mcp@latest", "--browser", "msedge", "--image-responses", "omit"]
startup_timeout_sec = 120
tool_timeout_sec = 600

Reproduction

  1. Start LM Studio with any tool-capable model loaded and the local server on port 1234.
  2. Use the config above (built-in lmstudio provider, any stdio MCP server).
  3. Launch codex, run /mcp — the playwright server is connected and lists ~24 browser_* tools. ✅
  4. Prompt: List the exact names of every tool/function you can call, verbatim, one per line. Do not execute anything.
  5. The model lists only built-ins: shell_command, list_mcp_resources, list_mcp_resource_templates, read_mcp_resource, update_plan, request_user_input, view_image, get_goal, create_goal, update_goal, apply_patch. No mcp__playwright.* entries. ❌
  6. Direct invocation (Call mcp__playwright.browser_navigate with url https://example.com) fails; the model reports the tool does not exist and falls back to shell improvisation.
  7. Re-run steps 4–6 with codex --model gpt-5.5 (openai provider), same config, same MCP server process: the verbatim tool list now contains the full set, e.g. mcp__playwright.browser_navigate, mcp__playwright.browser_snapshot, ... (24 tools), plus connector tools (mcp__codex_apps__github.*). Tool calls work. ✅

Evidence

/mcp output (lmstudio session — harness side is healthy):

• playwright
  • Auth: Unsupported
  • Tools: browser_click, browser_close, browser_console_messages, browser_drag,
    browser_drop, browser_evaluate, browser_file_upload, browser_fill_form,
    browser_handle_dialog, browser_hover, browser_navigate, browser_navigate_back,
    browser_network_request, browser_network_requests, browser_press_key,
    browser_resize, browser_run_code_unsafe, browser_select_option, browser_snapshot,
    browser_tabs, browser_take_screenshot, browser_type, browser_wait_for

Model's verbatim tool list, lmstudio provider (gemma-4-26b-a4b-qat):

shell_command
list_mcp_resources
list_mcp_resource_templates
read_mcp_resource
update_plan
request_user_input
view_image
get_goal
create_goal
update_goal
apply_patch

Model's verbatim tool list, openai provider (gpt-5.5), same config — excerpt:

functions.shell_command
...
mcp__playwright.browser_click
mcp__playwright.browser_close
...
mcp__playwright.browser_navigate
mcp__playwright.browser_snapshot
...

Expected behavior

MCP server tools should be included in the tool list sent to the model regardless of provider, matching what /mcp reports.

Actual behavior

For the built-in lmstudio provider, MCP tools are silently omitted from the model-visible tool list. Built-in tools are delivered and callable, so the tools array itself does reach the model.

Additional observations

  • A warning is emitted at session start: Model metadata for 'google/gemma-4-26b-a4b-qat' not found. Defaulting to fallback metadata; this can degrade performance and cause issues. Possibly relevant if fallback metadata gates MCP tool exposure.
  • Reproduces identically in the Codex desktop app (Windows) and the CLI.
  • The MCP server itself is healthy: it starts within the timeout, responds to tools/list, and works end-to-end in the gpt-5.5 session.

Related issues

  • #19871 — MCP tool invocation regressed for custom/local providers (Responses API) in v0.117.0+
  • #20771 — MCP servers load but tools not exposed to the model (closed; that general case does not reproduce on 0.139.0 — the openai provider path works here)

What steps can reproduce the bug?

  1. Start LM Studio with any tool-capable model loaded and the local server on port 1234.
  2. Use the config above (built-in lmstudio provider, any stdio MCP server).
  3. Launch codex, run /mcp — the playwright server is connected and lists ~24 browser_* tools. ✅
  4. Prompt: List the exact names of every tool/function you can call, verbatim, one per line. Do not execute anything.
  5. The model lists only built-ins: shell_command, list_mcp_resources, list_mcp_resource_templates, read_mcp_resource, update_plan, request_user_input, view_image, get_goal, create_goal, update_goal, apply_patch. No mcp__playwright.* entries. ❌
  6. Direct invocation (Call mcp__playwright.browser_navigate with url https://example.com) fails; the model reports the tool does not exist and falls back to shell improvisation.
  7. Re-run steps 4–6 with codex --model gpt-5.5 (openai provider), same config, same MCP server process: the verbatim tool list now contains the full set, e.g. mcp__playwright.browser_navigate, mcp__playwright.browser_snapshot, ... (24 tools), plus connector tools (mcp__codex_apps__github.*). Tool calls work. ✅

What is the expected behavior?

MCP server tools should be included in the tool list sent to the model regardless of provider, matching what /mcp reports.

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗