Repository navigation
Description
What variant of Codex are you using?
Codex Desktop on Windows (installed package 26.1021.3705.0).
What feature would you like to see?
Expose an agent-callable operation to reconnect configured MCP servers and rediscover their tools in an existing Desktop chat.
This is a feature request for an explicit control, rather than a claim that a particular connection failure is a bug.
Use case
While working with a networked service, I enable an additional tool on its MCP server. The agent should be able to refresh the existing connection, discover the newly exposed tool and continue in the same chat. Requiring me to operate the desktop settings UI breaks unattended or remote workflows, particularly when I am away from the computer.
Proposed behavior
Provide a narrow built-in/app tool, for example refresh_mcp_connections, that uses the existing Desktop host's MCP refresh machinery. The public app-server API already documents config/mcpServer/reload; the missing capability is an agent-accessible route to the host actually serving the chat.
- Preserve the chat and existing credentials. Do not require a new chat, application restart or repeat login when authentication remains valid.
- Respect existing tool exposure, allowlists and approval policies. Discovering a write tool must not authorize its use.
- Prefer a named-server refresh if supported. Otherwise, clearly disclose host-wide scope and safely handle other chats and in-flight calls; do not imply the current reload API already supports server selection.
- Return an observable completion or failure result. An acknowledgement that a refresh was queued should be distinguishable from the updated catalogue actually being available to the model.
- Do not require a generic app-server RPC tool, debug port or browser/computer automation.
Acceptance test
- Start an existing Desktop chat connected to an MCP server.
- Add or expose a harmless read-only tool on that server.
- Have the agent request a refresh through the new control.
- Without restarting Desktop or creating another chat, verify that the same agent can discover and successfully call the new tool.
- Report the outcome clearly if refresh fails or cannot safely proceed.
Additional information
Related requests and reports:
- In app /mcp reload #41717 — user-facing
/mcp reloadrequest. - Need way to hot-load local MCP changes into existing Codex thread #20605 — automatic hot-loading of local MCP changes. This request specifically asks for an explicit agent-callable control.
- [Linux Desktop 26.1007.71326] Optional MCP tools missing in existing chat after server recovery; delayed refresh with no reconnect action #54301 — related Desktop report discussing access to the existing host's reload API; no identical root cause is assumed.
No credentials, service addresses, private configuration or conversation logs are attached.
Activity
github-actions commentedon Oct 25, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
JohannesTripolt commentedon Oct 25, 2026
Reviewed the suggested duplicate, #55864. It is related, but the requested outcome here is narrower and explicitly agent-facing.
#55864 reports an existing remote plugin connection retaining an old tool inventory in a cloud conversation and asks for supported refresh/re-discovery.
This issue requests a built-in, agent-callable refresh operation on the actual local Desktop host, usable in an existing chat without a human operating settings. It remains useful even if automatic inventory invalidation works correctly: an authorized agent should be able to request deliberate rediscovery after a server/configuration change and receive a clear completion or failure result.
The existing
config/mcpServer/reloadAPI is a possible implementation building block, not a claim that it is currently reachable through an agent tool or that #55864 shares our underlying cause. The requested control should preserve existing approval policies and clearly describe its scope and effects on other active work.I am leaving this open as a feature request for that explicit control. If maintainers prefer tracking it under #55864 or #20605, please retain the agent-callable operation and same-chat acceptance criteria when consolidating.
Alexelsea commentedon Oct 29, 2026
An additional real Desktop recovery use case, observed 2026-10-29: a configured MCP server failed
initializein one existing chat with HTTP429 / JSON-RPC-32000(Rate limit exceeded). Later connections in the same restarted application reachedready, and a normal independent client check returned HTTP200 about eight minutes later. The affected chat still lacked that server's tools in the inspected session. This is evidence of a transient startup failure followed by service availability; it is not proof that the server limiter is defective or that the affected chat later recovered.This makes the requested supported refresh control useful without any credential, grant, configuration or limit change. A queued refresh acknowledgement should remain distinct from a successful handshake, updated catalogue, and harmless tool call in the same chat. Any automatic transient-startup recovery should respect
Retry-After, use bounded backoff, distinguish rate limiting from authentication refusal, and never replay consequential tool calls or silently reload other active chats.No private RPC, debug port, credential access, policy bypass or protected UI workaround was used. No service addresses, account details or private conversation identifiers are attached.
Alexelsea commentedon Oct 29, 2026
Follow-up with server-side evidence for the previously reported transient-startup case:
A complete historical 20-second proxy-log window during Desktop restart contains 141 requests to the configured MCP endpoint, including 138 Codex-class and 3 Claude-class user agents. It includes 56 HTTP429s across POST/GET/DELETE, interleaved with 84 HTTP200/202s and one GET404. The historical deployment-scoped query reproduces those counts. No raw addresses, service URL, headers, account information, credentials or private conversation identifiers are attached. Shared source address does not prove a shared credential, and timing alone does not identify the affected chat's exact request.
The affected chat emitted starting then HTTP429 failed during initialize and has no subsequent startup/ready event in the inspected logs. A later normal independent check returned HTTP200, while one supported resource-list inspection in the existing chat still failed while acquiring the client with the original startup-error chain. That inspection is not asserted to have sent another HTTP request.
This reinforces the distinction between rate-respecting startup recovery and an observable refresh of the existing chat's tool catalogue. A bounded, single-in-flight recovery should honor Retry-After, avoid credential/limit changes, distinguish authentication refusal from transient throttling, and never replay consequential tool calls. Current public source retains a shared startup result for custom servers; that source has not been mapped to the exact immutable bundled binary, so this is not a claim about a specific shipped implementation commit.
No private RPC, protected UI, unrelated plugin installation, policy bypass or new connection retry was used.
derrickburns commentedon Nov 3, 2026
A source-level addition to this existing request: please support a single loaded thread / named MCP server cutover with explicit preservation and observable completion, without requiring thread resume or host-wide reload. A stateful local stdio server may own task leases and unresolved action receipts, so merely reconnecting its pipes is insufficient.
I reviewed release tag
rust-v0.166.0, commit6ff1e1ca3b30fc8b914720681fcf5fe62e95f856. This is public release-source analysis, not an attestation that the installed binary or a particular running host was built from those bytes, and not a newly reproduced upstream defect.Concrete implementation seams:
app-server/src/mcp_refresh.rs: the reload planner iterates the loaded thread set. The request processor invokes it without a target selector.codex-mcp/src/runtime.rs:McpRuntimealready publishes an immutable runtime snapshot; previous bindings can retain their exact connection set.replace_freshandreconnect_on_next_refreshdo not establish the proposed named-server preservation transaction.codex-mcp/src/connection_manager.rsandconnection_pool.rs: normal shutdown can release native connection leases and ultimately shut down the client. These native connection leases are distinct from the MCP application's own durable task/browser leases.@openai/codex-core-agent-team. The contribution policy requests issue-based analysis rather than external PRs. This comment is that owner handoff, not an attempted local override.Smallest proposed contract, with no claim that an API of this name/shape exists today:
thread/resume.Disposable acceptance proposal for the owning native test harness (not executed on any production conversation):
The source currently visible at main commit
f58acd6ede312266a7a0eaa63fd8dadacb4de239retains the broad reload loop; its runtime changes do not establish this targeted preservation operation. If there is an equivalent supported owner contract, please identify its public entrypoint, scope, completion/inspection semantics and applicable release. Otherwise please disposition this as a native connection-manager prerequisite for safe initial adoption as well as refresh.No production thread identifiers, credentials, service endpoints, local paths, lease secrets, private case content or raw logs are included. No production connector/goal/provider operation or external code PR was performed for this analysis.
derrickburns commentedon Nov 3, 2026
Additional bounded diagnostic evidence, separate from the proposed warm-connector feature:
I ran the installed native 0.166.0 binary in an isolated configuration with no production credentials or conversations, a credential-free MCP identity fixture, and a loopback model endpoint that rejects execution. The physical native binary SHA256 was
39acf979729dd290f9a24ee38b2914e036c91b65952872e28ae2a6b88a7db7c1; this does not attest it to the release-source commit cited above.The fresh synthetic persisted goal was blocked. I then:
thread/closed,notLoaded, and an empty completethread/loaded/listunder the fixture's one-second unload policy.thread/resumewithexcludeTurns: trueand an MCP definition, keeping that subscriber open.codex resume --no-alt-screen --remote unix://<owned-fixture-socket> <synthetic-thread>without submitting user input.The goal stayed blocked after both boundaries, preserving objective, creation time, token budget 1000, and zero usage counters. The actual TUI displayed the resume-goal choice, with no turn-start event and no request to the rejecting model endpoint. MCP identity calls before and after unload reached different fixture process IDs, establishing that the old fixture connection was not simply retained. All owned processes were settled afterward.
This minimal case did not reproduce goal activation. It does not establish preservation for an existing populated conversation, nonzero goal accounting, another client's configuration, a Case/cmux launcher, a production stateful MCP server or its custody transfer. It also does not add a supported warm named-server replacement operation. Two earlier fixture caller failures (wrong socket framing; omitted empty params on loaded-list) were retained and corrected; they are not asserted as Codex defects.
This narrows the separate cold-resume question and is not a reason to reopen a real blocked conversation as a test. The proposed connector-scoped contract and stateful adoption acceptance above remain unimplemented/unverified by this diagnostic.
Positive-control follow-up: after native input became ready, a separate disposable fixture deliberately selected the default Resume-goal choice with one Enter. The observer captured an active-goal notification and one turn start. Only the rejecting loopback model endpoint was reached; no production provider or conversation was used. The goal identity, objective, creation time and budget remained unchanged. The synthetic goal was then explicitly blocked and its synthetic turn interrupted through their supported controls before normal cleanup; the owned TUI and foreground app-server exited. Earlier input-readiness and cleanup failures are retained as fixture failures.
The controlled contrast is: no submitted input preserved blocked state; deliberate selection activated it. This establishes that the detector can observe the transition. It does not establish that unexpected input caused any historical production activation, nor that production restore/history/custody is preserved.
derrickburns commentedon Nov 3, 2026
A concrete next implementation milestone for @openai/codex-core-agent-team, separate from application configuration delivery and requester diagnostic cleanup:
Please disposition a supported prepare/inspect contract for one already loaded thread and one named MCP connection, as the first part of preserving initial enrollment from a fixed local stdio child into a replacement or stable frontend. The application can install a future per-thread server definition without changing its current loaded connection. That independent configuration delivery does not provide the initial native cutover.
The release-source seams remain
McpRequestProcessor::mcp_server_refresh_response, which accepts null parameters and delegates to the broad reload planner, andMcpRuntime::replace/replace_fresh, which publish runtime snapshots. These references identify implementation seams, not an attestation of a running binary's source or an existing scoped API.Proposed first contract, with method naming left to the owner:
The first owner acceptance can be small and decisive: two credential-free synthetic threads, a second server in the target thread, a blocked populated goal and entered draft, and a stateful stdio fixture whose ordinary shutdown discards custody. Exercise stale generation and missing custody capability through the actual native handler. Require explicit no-effect refusal, zero old shutdowns/new starts, unchanged draft/goal/other connections, and one inspectable operation after a lost reply. This prepares an honest contract boundary; it does not certify the later successful cutover.
If an equivalent supported contract already exists, please identify its exact public entrypoint, minimum release, scope and preservation/completion semantics. Otherwise please assign/disposition this first native connection-manager milestone. This remains a capability request, not attribution of a historical goal-activation defect. No production identifiers, endpoints, credentials, custody state or raw logs are included.
birbprophet commentedon Nov 9, 2026
The same limit shows up in the CLI, and it blocks the usual "paste a setup skill, sign in, keep going" flow for any remote MCP server.
Repro with Codex CLI 0.167.0 on macOS (arm64), in a fresh
CODEX_HOMEwith a minimal stdio MCP server that exposes one tool,ping_secret:codex exec: the agent runscodex mcp add ping -- bun ping-mcp.tsin its shell (printsAdded global MCP server 'ping'.). In the same turn,ping_secretisn't among its tools.codex mcp add. Turn 2 asks forping_secret, and the agent answers that it has no such tool./mcp./mcplistsping: unknown (1 tool). On the next turn the model's tool list still doesn't include it (the rollout's code-mode tool lookup returns[]).codex exec resume --laston the conversation from step 1 callsping_secretand gets the answer.So a server added mid-session only reaches the model in a new process. In 0.167 the TUI runs on the app-server daemon, which already has
config/mcpServer/reloadand theRefreshMcpServersop. An agent-callable refresh, or running that refresh aftercodex mcp add/codex mcp loginand after/mcp, would let a person finish setup in the same conversation.