You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TUI's MCP server picker and status modal both report no MCP servers even though the same project has multiple registered servers and opencode2 mcp list reports their connection states correctly.
Install/channel: V2 next beta, installed globally via npm
Reproduction
Configure global and project MCP servers using the native V2 mcp.servers configuration.
Start opencode2 from the project directory.
Confirm that opencode2 mcp list displays the configured servers and their statuses.
In the TUI, press ctrl+p and open MCP Servers.
Observe that the list is empty.
Press ctrl+x, then s to open the status modal.
Observe that it says No MCP Servers.
Expected Behavior
Both TUI dialogs should list the same MCP servers and connection states reported by opencode2 mcp list.
Actual Behavior
The MCP Servers list is empty, and the status modal says No MCP Servers. The CLI command correctly lists connected, disabled, and authentication-required servers.
Additional Context
The issue is consistently reproducible. The background service is healthy at http://127.0.0.1:4096, and /api/health reports version 0.0.0-next-15385.
opencode2 mcp list reports 12 configured servers across connected, disabled, and authentication-required states. Server logs also confirm successful MCP connections and show the project location as the active directory.
This started after migrating global and project configuration from V1 to native V2 configuration.
I traced both paths. The TUI does not derive this list from its loaded config; both dialogs render sync.data.mcp, populated by the SDK's GET /mcp call during non-blocking bootstrap. That call currently does not use throwOnError or inspect result.error:
So any fulfilled API error/missing data is converted to {}, after which the picker looks empty and Status says “No MCP Servers.” By contrast, opencode2 mcp list loads config/MCP state directly in its own process. This makes the leading hypotheses:
/mcp is returning an error that the TUI masks as an empty successful response; or
the TUI request and mcp list are resolving different directory/workspace/server contexts.
Could you provide the following from the same project directory? Please redact server names, command arguments, paths, URLs, headers, and tokens as needed.
Output (including HTTP/API error detail) of:
opencode2 api get /mcp
Whether this reproduces with:
opencode2 --standalone
The exact command used to start the TUI, and whether --server, --port, OPENCODE_SERVER, or experimental workspaces are involved.
Relevant redacted role=cli and role=server log lines from one launch/reproduction, especially any tui bootstrap failed, /mcp, workspace-routing, or instance-loading errors.
One subtlety: depending on this build/launch mode, the TUI may use an embedded worker/private server rather than the healthy service at 127.0.0.1:4096, so the health check alone does not establish that mcp list, api get /mcp, and the TUI share the same instance.
The masking behavior is now tracked broadly in #36582, but the output above should identify the underlying failure for this report.
The MCP servers are now appearing in the TUI. This may have been caused by the TUI or background service retaining stale state after the V1-to-V2 configuration migration; reloading the shell and restarting/reconnecting the service appears to have resolved it. I can no longer reproduce the original issue, so I’m closing this report.
The issue was that mcp.server.refresh() and mcp.resource.refresh() were passing locationQuery(ref) which returns undefined when called during bootstrap (no argument), instead of locationQuery(ref ?? defaultLocation()) like all other location refresh methods do.
This caused MCP data to be stored under a key derived from the server's process.cwd() while DialogMcp reads from the key derived from the client's defaultLocation(), different keys, so nothing showed up.
Addressed by commit 2508a74 and the current location-scoped TUI data API. MCP server and resource sync now key both the request and store update from ref ?? defaultLocation(), using the authoritative location returned by the server; dialogs read from that same location key. This removes the bootstrap mismatch identified in the issue where MCP data was stored under process cwd but read under the client default location. Closing as resolved.
Activity
opencode-agent commentedon Jul 13, 2026
I traced both paths. The TUI does not derive this list from its loaded config; both dialogs render
sync.data.mcp, populated by the SDK'sGET /mcpcall during non-blocking bootstrap. That call currently does not usethrowOnErroror inspectresult.error:So any fulfilled API error/missing
datais converted to{}, after which the picker looks empty and Status says “No MCP Servers.” By contrast,opencode2 mcp listloads config/MCP state directly in its own process. This makes the leading hypotheses:/mcpis returning an error that the TUI masks as an empty successful response; ormcp listare resolving different directory/workspace/server contexts.Could you provide the following from the same project directory? Please redact server names, command arguments, paths, URLs, headers, and tokens as needed.
--server,--port,OPENCODE_SERVER, or experimental workspaces are involved.role=cliandrole=serverlog lines from one launch/reproduction, especially anytui bootstrap failed,/mcp, workspace-routing, or instance-loading errors.One subtlety: depending on this build/launch mode, the TUI may use an embedded worker/private server rather than the healthy service at
127.0.0.1:4096, so the health check alone does not establish thatmcp list,api get /mcp, and the TUI share the same instance.The masking behavior is now tracked broadly in #36582, but the output above should identify the underlying failure for this report.
mwikala commentedon Jul 13, 2026
The MCP servers are now appearing in the TUI. This may have been caused by the TUI or background service retaining stale state after the V1-to-V2 configuration migration; reloading the shell and restarting/reconnecting the service appears to have resolved it. I can no longer reproduce the original issue, so I’m closing this report.
mwikala commentedon Jul 13, 2026
Nevermind, I thought this was a one off but I keep seeing it happen. Sometimes I see my MCPs listed in the TUI, but more often they're not.
At all times though, the MCPs are available to the agent. I do keep seeing it do a
searchthough instead of just calling the MCP directly:entrptaher commentedon Jul 14, 2026
Facing same issue.
Tried with cloning the v2 directly and running, no avail.
entrptaher commentedon Jul 14, 2026
I think I fixed the thing.
opencode-agent commentedon Jul 30, 2026
Addressed by commit 2508a74 and the current location-scoped TUI data API. MCP server and resource sync now key both the request and store update from
ref ?? defaultLocation(), using the authoritative location returned by the server; dialogs read from that same location key. This removes the bootstrap mismatch identified in the issue where MCP data was stored under process cwd but read under the client default location. Closing as resolved.