Skip to content

mcp: project-level servers are never loaded; only the global config takes effect (v2.3.2, Windows) #64941

In review

Description

@Joonin81

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

  1. Create C:\work\my-app\opencode.json:
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "newtake": { "type": "remote", "url": "https://mcp.newtake.ai/mcp" }
    }
  }
}
  1. cd C:\work\my-app
  2. opencode debug config → the project file is listed as a document source, with the mcp block in its info.
  3. opencode mcp list → No MCP servers configured
  4. Start a session in that directory → no newtake tools.

What I also tried

  • opencode.jsonc instead of opencode.json — same result.
  • opencode --standalone mcp list — same result.
  • XDG_CONFIG_HOME pointing at a directory whose opencode/opencode.jsonc contains the server: opencode debug paths reports the new config path, opencode mcp list still reports no servers.
  • Defining the server in the global config works (mcp list shows it as pending), 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

Activity

  1. added
    area/mcp
    type/bug
    version/v2
    on Nov 19, 2026
  2. opencodejr commented on Nov 19, 2026

    @opencodejr
    Contributor

    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.json with only your newtake entry under mcp.servers. There the project server does load:

    • The first opencode mcp list in the new directory printed No MCP servers configured.
    • Every later call printed ⚠ newtake needs authentication, and GET /api/mcp for that directory returned the server.

    That empty first call is the known startup race tracked in #54192. opencode --standalone mcp list was 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:

    • Run opencode service restart, then opencode mcp list from C:\work\my-app a few times about 10 seconds apart. Does it ever list newtake?
    • Paste the output of opencode api get "/api/mcp?location[directory]=C:\work\my-app".
    • Add the service log lines from the restart onwards (the log path is shown by opencode debug paths), with anything private removed.

    Related issues, most likely first:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/mcpplatform/windowstype/bugversion/v2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions