Repository navigation
Description
Summary
opencode mcp list only resolves servers from an opencode.json in the current
directory. When the config lives in a parent directory, mcp list prints
No MCP servers configured, even though opencode debug config in the same
directory shows that file as a loaded source and the server is fully usable in
the session.
Environment
- opencode version: 2.3.2
- OS: Windows 10.0.19045.6466 (win32 x64)
- Terminal:
xterm-256color(TERM_PROGRAMunset) - Shell:
C:\Windows\system32\cmd.exe(launched from PowerShell 7) - Install/channel: latest, npm install of
@opencode/cli - Active plugins: none found in config
Reproduction
Layout: a project root with a config file, and a nested working directory with no
config of its own.
C:\work\project\opencode.json <- mcp.servers.<name> defined here
C:\work\project\sub\dir\ <- no opencode.json anywhere inside
-
From the project root:
> cd C:\work\project > opencode mcp list ✓ <name> connected -
From the nested directory (still inside the project):
> cd C:\work\project\sub\dir > opencode mcp list No MCP servers configured -
In that same nested directory, the config is resolved:
> opencode debug config [ { "type": "directory", "path": "C:\\Users\\<user>\\.config\\opencode" }, { "type": "document", "path": "C:\\work\\project\\opencode.json", "info": { "mcp": { "servers": { "<name>": { "type": "local", "command": [ ... ] } } } } } ] -
Starting a session in
C:\work\project\sub\dirworks normally: the MCP
server is connected and its tools are available. Onlymcp listdisagrees.
Expected Behavior
mcp list should report the servers from the same resolved configuration the
session uses, so it lists <name> (and its connection status) from any directory
under the project root.
Actual Behavior
From C:\work\project\sub\dir:
No MCP servers configured
while opencode debug config in the same directory lists
C:\work\project\opencode.json as a loaded document containing that exact
server. Reproducible every time; no service restart involved, and the result
does not change after opencode service restart.
Additional Context
- The docs state that during project discovery OpenCode searches the current
directory and every ancestor up to the filesystem root, merging
opencode.json(c)files from the farthest ancestor down.debug config
behaves that way;mcp listappears to look only at the current directory. - Consequence: in a monorepo or any project whose config sits at the repo root,
mcp listclaims there are no servers whenever it is run from a package or
subfolder, which is easy to misread as "the server is not configured". - One level up (the project root) the same command reports
✓ <name> connected,
so the config file itself is valid and the server is healthy. - Related issues: cli: mcp list / mcp auth ignore the global config — servers added with --global are invisible #55811 (
mcp list/mcp authignore the global config,
closed as duplicate), mcp list reports "No MCP servers configured" on cold start (v2.2.6) #62902 / cli: mcp list says "No MCP servers configured" before a location boots #63053 / cli: mcp list reports no servers on first run in a fresh directory #63722 (mcp listreports no servers
on cold start), and cli: show which config sources were loaded (and why) in mcp list / debug config #60015 (open: show which config sources were loaded in
mcp list/debug config). This report is the ancestor-directory case
and is not covered by those: no cold start or missing global config is
involved, and the session loads the server correctly. - Workaround: run
opencode mcp listfrom the directory that owns
opencode.json, or useopencode debug configto confirm what was loaded.
Activity
opencodejr commentedon Nov 22, 2026
Thanks for the detailed report. I tried this on Linux with the released v2.3.2: a project with an
opencode.jsonat its root defining one local MCP server, andopencode mcp listrun from a nestedsub/dirwith no config of its own.On Linux the subfolder did pick up the parent config. The first
opencode mcp listinsub/dirprintedNo MCP servers configured, and every call after that listed the server (○ demo pending). The project root behaved the same way: empty on the first call, listed afterwards. That empty first call is the known startup race tracked in #54192.opencode debug configinsub/dirshowed the parentopencode.json, as in your output.So the empty list on every call from a subfolder doesn't happen on Linux, and is probably specific to Windows. A maintainer with a Windows machine will need to look at it. One thing that may help them: from
C:\work\project\sub\dir, runopencode mcp lista few times about 10 seconds apart and say whether it ever lists the server. It would also help to know whether the drive letter in your prompt is upper- or lower-case (C:vsc:).Related issues, ordered by likelihood:
debug configshows the project file butmcp listis always empty. Open PR fix(cli): wait for plugins in mcp commands and normalize windows drive casing #65233 targets it, and also changes how Windows drive-letter case is handled.mcp listis empty on the first request for a new directory.debug configshows the servers butmcp listis empty.neriousy commentedon Dec 2, 2026
Thanks for the report! This looks like the same bug as #64941, so I'm closing this one to keep the discussion in one place. If yours turns out to be different, leave a comment and we'll reopen it.