`resolveDiscoveredConfig` does not read workspace `.mcp.json` — `includeWorkspaceSources` never set
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- javascript
- Domain
- cli
Research direction
Start at resolveDiscoveredConfig() and trace its call to jv(), using the provided workingDirectory and workspace .mcp.json reproduction. Verify that config discovery includes workspace sources, then rerun the SDK session scenario and confirm the time MCP server is loaded from .mcp.json.
Written by the indexing model from the issue text.
Description
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.jsonin a working directory:{ "mcpServers": { "time": { "command": "uvx", "args": ["mcp-server-time"] } } } - Create a session via the SDK with
enableConfigDiscovery: trueandworkingDirectorypointing to that directory. - Observe that no MCP servers from
.mcp.jsonare 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
});
- Dominant language
- Shell
- Stars
- 11.2k
- Forks
- 1.9k
- Avg merge
- 14h 16m
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/copilot-cli
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
github/copilot-cli#4848 ·
-
area:agents area:mcp
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
github/copilot-cli#4729 ·
-
area:sessions
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
github/copilot-cli#4712 ·
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
github/copilot-cli#4638 ·
-
Expose large_output_file_path on TaskShellProgress so clients can read complete shell-task output Openarea:tools
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
github/copilot-cli#4630 · 1 comment ·
All issues in github/copilot-cli
Similar issues
-
docs(agents): strengthen the no-backslash-escaped-backticks rule with an issue-creation example Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
oSoWoSo/vOid_Community_repOsitory#148 · 1 comment ·
-
chore
Difficulty 1/5 Under an hour Newbie friendliness 91/100
alunduil/alunduil-chezmoi#792 ·
-
area: compat bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
zenhub-dev
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OpenLiberty/ci.docker#747 ·