Repository navigation
Description
Summary
A mcp.servers entry defined in a project opencode.json is never loaded. opencode debug config lists the project file as a configuration source, but opencode mcp list reports No MCP servers configured and no MCP tools appear in a session started from that directory.
The same server definition in the global config (~/.config/opencode/opencode.jsonc) does load, so the definition itself is valid.
Environment
- opencode v2.3.2
- Windows 11
- TUI, started from the project directory
Expected
Per the config docs, project opencode.json(c) is merged with the global config and "settings that do not conflict are preserved". A project-only mcp.servers entry should be available in sessions started in that project.
Actual
- Create
C:\work\my-app\opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"newtake": { "type": "remote", "url": "https://mcp.newtake.ai/mcp" }
}
}
}cd C:\work\my-appopencode debug config→ the project file is listed as adocumentsource, with themcpblock in itsinfo.opencode mcp list→No MCP servers configured- Start a session in that directory → no
newtaketools.
What I also tried
opencode.jsoncinstead ofopencode.json— same result.opencode --standalone mcp list— same result.XDG_CONFIG_HOMEpointing at a directory whoseopencode/opencode.jsonccontains the server:opencode debug pathsreports the new config path,opencode mcp liststill reports no servers.- Defining the server in the global config works (
mcp listshows it aspending), so the config shape and the endpoint are fine.
Why it matters
MCP tool definitions are paid for in context on every session that loads them. Users who want a server only in one project currently have to add it to the global config, which enables it for every session and every project, and opencode mcp has no per-session or per-project toggle (list, add, auth, logout only). Project-scoped MCP is the natural way to opt in, and per the docs it should already work.
Possibly related
- server: location reload invalidates the caller's held layer, so its tool catalog is empty #59993 — location reload invalidates the caller's held layer, tool catalog empty
- MCP servers disabled with /mcps reconnect after an idle Location eviction #62868 — MCP servers disabled after an idle Location eviction
- [FEATURE]: Spawn MCP servers on demand (first tool use) instead of eagerly at session start #53028 — spawn MCP servers on demand instead of eagerly
- [FEATURE]: Project and session configuration restrictions #63705 — project and session configuration restrictions
Activity
opencodejr commentedon Nov 19, 2026
Thanks for the detailed steps. I tried this on Linux with v2.3.2, using a clean home whose global config has no MCP servers and a project
opencode.jsonwith only yournewtakeentry undermcp.servers. There the project server does load:opencode mcp listin the new directory printedNo MCP servers configured.⚠ newtake needs authentication, andGET /api/mcpfor that directory returned the server.That empty first call is the known startup race tracked in #54192.
opencode --standalone mcp listwas empty every time here too, as in #63723.What you describe goes further: the list stays empty on every call, and sessions get no tools. I didn't see that on Linux, so it may be specific to Windows (#50710 discusses a possible Windows path mismatch). A maintainer with a Windows machine will need to look at it.
If you can, these would help:
opencode service restart, thenopencode mcp listfromC:\work\my-appa few times about 10 seconds apart. Does it ever listnewtake?opencode api get "/api/mcp?location[directory]=C:\work\my-app".opencode debug paths), with anything private removed.Related issues, most likely first:
mcp listis empty on the first request for a new directory.debug configshows the servers butmcp listis empty.mcp list --standalonenever lists servers.