Summary
When the SDK creates a session with enableConfigDiscovery: true and a workingDirectory, the CLI's resolveDiscoveredConfig() calls the internal MCP config loader (jv()) without passing includeWorkspaceSources: true. That parameter defaults to false, so the workspace .mcp.json is never read — even though the intent of enableConfigDiscovery is clearly to discover it.
Version
@github/copilot v1.0.41-0 (commit 3f18c2c)
Steps to reproduce
- Place a valid
.mcp.json in a working directory:
{
"mcpServers": {
"time": {
"command": "uvx",
"args": ["mcp-server-time"]
}
}
}
- Create a session via the SDK with
enableConfigDiscovery: true and workingDirectory pointing to that directory.
- Observe that no MCP servers from
.mcp.json are discovered.
Expected behaviour
The MCP servers defined in the workspace .mcp.json should be discovered and loaded into the session.
Actual behaviour
The CLI logs:
Loaded MCP config from installed plugins: 0 server(s):
No MCP config loaded from ODR (ODR unavailable or returned no usable servers)
No workspace .mcp.json is read. The flag triggers config resolution, but the resolution skips the workspace source.
Root cause
In resolveDiscoveredConfig(), the call to jv() omits includeWorkspaceSources:
async resolveDiscoveredConfig(e) {
if (!e.enableConfigDiscovery) return {};
let r = e.workingDirectory || process.cwd();
// ...
let c = await jv({
cwd: r,
repoRoot: l,
settings: this.options.settings,
installedPlugins: s
// ← missing: includeWorkspaceSources: true
});
}
Inside jv(), the parameter defaults to false. When false, the function skips the code path that reads .mcp.json from the working directory:
async function jv(t = {}) {
let { includeWorkspaceSources: s = false } = t;
// ...
if (!s) d = { ...c }; // ← only copies global config
else {
// reads .mcp.json from cwd/repoRoot — this path is never taken
}
}
Suggested fix
Pass includeWorkspaceSources: true in the jv() call within resolveDiscoveredConfig():
let c = await jv({
cwd: r,
repoRoot: l,
settings: this.options.settings,
installedPlugins: s,
includeWorkspaceSources: true // ← add this
});
Summary
When the SDK creates a session with
enableConfigDiscovery: trueand aworkingDirectory, the CLI'sresolveDiscoveredConfig()calls the internal MCP config loader (jv()) without passingincludeWorkspaceSources: true. That parameter defaults tofalse, so the workspace.mcp.jsonis never read — even though the intent ofenableConfigDiscoveryis clearly to discover it.Version
@github/copilotv1.0.41-0 (commit3f18c2c)Steps to reproduce
.mcp.jsonin a working directory:{ "mcpServers": { "time": { "command": "uvx", "args": ["mcp-server-time"] } } }enableConfigDiscovery: trueandworkingDirectorypointing to that directory..mcp.jsonare discovered.Expected behaviour
The MCP servers defined in the workspace
.mcp.jsonshould be discovered and loaded into the session.Actual behaviour
The CLI logs:
No workspace
.mcp.jsonis read. The flag triggers config resolution, but the resolution skips the workspace source.Root cause
In
resolveDiscoveredConfig(), the call tojv()omitsincludeWorkspaceSources:Inside
jv(), the parameter defaults tofalse. When false, the function skips the code path that reads.mcp.jsonfrom the working directory:Suggested fix
Pass
includeWorkspaceSources: truein thejv()call withinresolveDiscoveredConfig():