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
{{ message }}
Repository navigation
Browsing directories in the workspace picker or /cd starts a location runtime and its MCP servers for every directory listed #46826
Every location-scoped fs endpoint runs through LocationMiddleware, so the
first read against a directory constructs the full location runtime
(config discovery, plugins, watchers) and starts one process set per MCP
server in that directory's config chain. Directory navigation uses those
endpoints.
Measured: opening the workspace picker on a directory with 68 subdirectories,
each inheriting two local MCP servers from the parent config, spawned 68
runtimes and 136 MCP processes (~21 GB RSS). Runtimes persist until the
location-activity sweep.
Plugins
None required; GET /api/fs/list?location[directory]=<abs> reproduces it on
its own.
Put a local MCP server in ~/workspace/.opencode/opencode.json.
In the TUI, type /cd ~/workspace/. Listing workspace's children
materializes a runtime for ~/workspace itself and starts its MCP
processes.
Type deeper: /cd ~/workspace/<subdir>/. That subdirectory gets its own
runtime and a second set of the same MCP processes. Each deeper level the
path reaches adds another.
The app picker does the same in bulk: opening it on ~/workspace creates
one runtime and MCP process set per subdirectory immediately.
Screenshot and/or share link
Process table from the measured run can be attached if useful.
This issue might be a duplicate of existing issues. Please check:
core: cached locations multiply MCP subprocesses #37844: Same root cause — each acquired Location eagerly starts its full MCP subprocess set, leading to multiplied processes and excessive RSS. That issue tracks the general case (multiple Locations open across TUIs); this issue surfaces the same problem specifically through directory navigation/browsing.
Web/Desktop directory picker persists every subdirectory of $HOME as a project (v2) #46679: Same trigger path — the directory picker issues GET /api/fs/list calls that pass through LocationMiddleware, booting a Location per directory. That issue focuses on the side-effect of persisting directories as projects; this issue focuses on the MCP process explosion from the same underlying mechanism.
If these cover the same problem, it may be worth consolidating. If this issue captures a distinct aspect (e.g. the fs/list endpoint specifically, or the /cd command path), please clarify so it can be tracked separately.
Activity
github-actions commentedon Sep 2, 2026
This issue might be a duplicate of existing issues. Please check:
$HOMEas a project (v2) #46679: Same trigger path — the directory picker issuesGET /api/fs/listcalls that pass throughLocationMiddleware, booting a Location per directory. That issue focuses on the side-effect of persisting directories as projects; this issue focuses on the MCP process explosion from the same underlying mechanism.If these cover the same problem, it may be worth consolidating. If this issue captures a distinct aspect (e.g. the fs/list endpoint specifically, or the
/cdcommand path), please clarify so it can be tracked separately.