`resolveDiscoveredConfig` does not read workspace `.mcp.json` — `includeWorkspaceSources` never set
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- javascript
- Ambito
- cli
Direzione di ricerca
Inizia da resolveDiscoveredConfig() e segui la relativa chiamata a jv(), utilizzando la riproduzione fornita di workingDirectory e workspace .mcp.json. Verifica che la ricerca della configurazione includa le sorgenti del workspace, quindi esegui nuovamente lo scenario di sessione dell'SDK e conferma che il time MCP server venga caricato da .mcp.json.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
});
- Lingua principale
- Shell
- Stelle
- 11.2k
- Fork
- 1.9k
- Merge medio
- 14h 16m
- PR unite (30g)
- 6
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/copilot-cli
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
github/copilot-cli#4932 ·
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
github/copilot-cli#4909 ·
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
github/copilot-cli#4906 ·
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
github/copilot-cli#4848 ·
-
area:agents area:mcp
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
github/copilot-cli#4729 ·
Tutte le issue di github/copilot-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
elastic/gradle-plugins#156 ·
-
Priority/High ready-for-agent Severity/Major Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
comp/cli P3 type/docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
NousResearch/hermes-agent#119756 · 1 commento ·
-
comp: build/pipeline type: bug version: current (v17+)
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
angular/angularfire#3766 ·
-
out-of-date
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
CachyOS/CachyOS-PKGBUILDS#1903 ·